pref0 vs LangChain Memory

LangChain has built-in memory modules for conversation history. pref0 provides preference learning that goes beyond conversation recall to structured preference extraction.

pref0LangChain Memory
What it storesStructured preferences with confidenceConversation history and summaries
ScopeCross-session preference learningPrimarily within-session memory
ExtractionAutomatic preference extraction from correctionsStores raw messages or generates summaries
Confidence scoringBuilt-in, compounds over timeNot available
FrameworkFramework-agnostic APILangChain-specific
Best forLearning persistent user preferencesMaintaining conversation context

Key differences

Preferences vs. conversation context

LangChain memory maintains conversation context within a session — what was said, conversation summaries, entity references. pref0 extracts structured preferences that persist across sessions and compound in confidence.

Cross-session persistence

LangChain's built-in memory modules are primarily designed for within-session context. pref0 is designed for cross-session learning — preferences from last week inform today's responses.

Framework independence

LangChain memory only works within LangChain. pref0 works with any framework — LangChain, CrewAI, Vercel AI SDK, or raw API calls. You can switch frameworks without losing preference data.

When to use each

Use pref0 when...

  • You need preferences that persist and compound across sessions
  • You want structured preferences, not conversation logs
  • You might switch frameworks in the future
  • Corrections are an important signal for your agent
  • You need preference learning alongside conversation memory

Use LangChain Memory when...

  • You only need within-session conversation context
  • You want conversation summarization
  • You need entity extraction from conversations
  • You're fully committed to the LangChain ecosystem

Frequently asked questions

Can I use pref0 with LangChain memory?

Yes. Use LangChain memory for conversation context within a session. Use pref0 for cross-session preference learning. Add pref0 preferences to the system prompt alongside LangChain's conversation buffer.

Does pref0 replace LangChain memory?

No. They serve different purposes. LangChain memory handles conversation context. pref0 handles preference learning. Most agents benefit from both.

What if I switch from LangChain to another framework?

pref0 preferences carry over. Since pref0 is a REST API, your preference data works with any framework. LangChain memory would need to be reimplemented.

Other comparisons

Not memory. Preference learning.

Your users are already teaching your agent what they want. pref0 makes sure the lesson sticks.