"kgai vs LangMem: memory for your product's agents or for your dev team"
Two different readers land on this page. One is building agents with LangGraph and wants them to remember users and context. The other codes with AI every day and wants the project itself to remember. LangMem serves the first. kgai serves the second. We build kgai, so weigh this page accordingly.
What LangMem is good at. It's the LangChain team's memory SDK. Agents get tools to save and search memories in the hot path, and a background memory manager extracts, consolidates and updates knowledge from conversations without slowing the session down. The agent decides what's worth storing. Storage rides LangGraph's store interface, in-memory for development and a Postgres-backed store for production, and it's available by default on LangGraph Platform deployments. MIT. If your product is a LangGraph agent, this is the native option and it composes with the rest of that stack.
Where kgai differs, structurally.
- Consolidation rewrites, supersession links. LangMem's background manager updates and consolidates what's stored, which is the right call for evolving user knowledge. kgai never rewrites. A new decision supersedes an old one through an explicit link with a reason, recall returns only in-force decisions, and rejected approaches stay in history with why they failed. That's the point of decision memory, the trail is the product.
- The write path. LangMem extracts memories with an LLM, so what lands in the store depends on the run. kgai's decisions are written by the agent as explicit events, and the append-only log replays to the same graph on every machine. No embeddings in the read path either, lexical matching plus graph traversal.
- What you operate. A persistent LangMem deployment wants a database-backed store or the platform. kgai runs from files with no server and no daemon. Team sync is opt-in, lands in an S3 bucket you own, and per-writer shards keep parallel recording free of textual conflicts.
Choose LangMem if you're building memory into a product on LangGraph, especially knowledge distilled from conversations, and you want it native to that ecosystem. Choose kgai if you're an AI-assisted dev team and what you need remembered is the decision record. kgai won't hold conversations and won't personalize per user, by design. For the agent-platform side of this space, kgai vs Letta is the closer read.
Setup is two commands, the store is files, nothing runs in the background. Try it on one project and see if the graph earns its keep.
Try it on your repo. Two commands, MIT, nothing leaves your machine until you configure a bucket.
See how kgai compares to other tools on the comparison page, or browse the other notes.