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

LangMemRetrack
What it isAn open-source Python library (MIT); you host the storeA hosted service with a dashboard; open-source Python connector (MIT)
MemorySemantic and episodic memories from conversations; prompt optimisation for behaviourPlaybooks per kind of task, failure signatures with fixes
How behaviour improvesThe optimiser rewrites the system prompt from feedbackA matching playbook is recalled for each task; the base prompt stays yours
VerificationUses the feedback you passRanks signals (test, event, feedback, AI judge) and learns only from verified runs
GovernanceBuild your ownReview queue, approvals, version history, rollback, provenance
Memory poisoning defenceBuild your ownMemory firewall
Tests, model migration, holdoutNot includedBuilt in
CostFree library; you run storage and model callsHosted 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.

Sources