recall.
Mapping
| LangChain | Tex equivalent |
|---|---|
ConversationBufferMemory | recall(q=user_msg, session_id=sid, top_k=20) returns the relevant 20 turns instead of the last N. |
ConversationBufferWindowMemory(k=10) | recall(q=user_msg, session_id=sid, top_k=10) uses the same k, but ranks by relevance. |
ConversationSummaryMemory | Tex stores extracted observations automatically. Read them from recall’s hits.observations. |
ConversationKGMemory | Tex builds an entity graph in the background. Query via hits.entities (linked across observations). |
Migration
- ConversationChain - before
- Tex retrieval - after
Trade-offs
LangChain memory has no network hop. Tex adds a network call: writes are usually around 150ms, and reads can take a few seconds. In return, memory survives deploys, prompts stay bounded, sessions can share memory, and each recall has a confidence score. For a small hobby bot, a buffer may be enough. For a customer-facing app, Tex is usually the cleaner path.Drop-in adapter (optional)
If your codebase has dozens of LangChain chains and you’d rather not rewrite them all, wrap Tex in aBaseChatMemory subclass:
tex_chat_memory.py

