Retrack vs LangMem for LangGraph agents
LangMem is an open-source memory library with prompt optimisation; Retrack is a hosted service with playbooks, a firewall, CI tests and a holdout.
Updated
LangMem and Retrack both serve LangGraph developers. LangMem is an open-source library from LangChain: tools and background managers that extract memories from conversations into a LangGraph store, plus prompt optimisers that rewrite an agent's instructions from feedback. Retrack is a hosted experience-memory service: verified runs become playbooks and failure warnings, protected by a firewall and doubling as tests.
At a glance
| LangMem | Retrack | |
|---|---|---|
| What it is | An open-source Python library (MIT); you host the store | A hosted service with a dashboard; open-source Python connector (MIT) |
| Memory | Semantic and episodic memories from conversations; prompt optimisation for behaviour | Playbooks per kind of task, failure signatures with fixes |
| How behaviour improves | The optimiser rewrites the system prompt from feedback | A matching playbook is recalled for each task; the base prompt stays yours |
| Verification | Uses the feedback you pass | Ranks signals (test, event, feedback, AI judge) and learns only from verified runs |
| Governance | Build your own | Review queue, approvals, version history, rollback, provenance |
| Memory poisoning defence | Build your own | Memory firewall |
| Tests, model migration, holdout | Not included | Built in |
| Cost | Free library; you run storage and model calls | Hosted service in early access |
Choose LangMem when
- you want a free library and are happy to build storage, review and safety yourself,
- your main need is conversational memory or tuning the agent's prompt,
- everything already runs on LangGraph Platform's store.
Choose Retrack when
- you want task-level procedures recalled only when they clearly apply, instead of one ever-growing prompt,
- you need a review queue, rollback and poisoning defence without building them,
- you want memory to double as CI tests and a model-upgrade check, with measured lift.
Using both
LangMem for what users said, Retrack for how tasks are done. Both work in the same LangGraph agent.