langmem
LangMem: long-term memory primitives for LangGraph agents that learn and adapt from conversations.
Self-managing, unbounded context and long-term memory for coding agents: one session, for life.
magic-context is an open-source ai agents project by cortexkit (cortexkit/magic-context on GitHub). It has 2,283 GitHub stars and 133 forks, is released under the MIT license, and was last updated on GitHub on 8 October 2026.
Decide which harness you will use it with (OpenCode, Pi, or OMP) and which model should act as historian.
Run the setup wizard via the install script or npx; it detects your harnesses and configures the plugin for you.
Pick historian (and optionally dreamer) models in the generated config, and let the wizard disable the host's built-in compaction so the two do not conflict.
Restart your harness and keep working in the same session; memory capture, consolidation, and recall then happen in the background.
A background historian compresses older history into chronological, importance-scored compartments so the live context window stays small without losing the thread.
During compression, durable knowledge such as decisions, constraints, and conventions is lifted into categorised project memory, and agents can also write memories explicitly.
An optional overnight dreamer verifies memories against the codebase, curates duplicates and stale entries, and promotes recurring knowledge.
Reductions are queued and applied at cache-safe moments, with a deterministic decay rendering, so the cached prompt prefix survives the session.
OpenCode, Pi, and OMP share the same database, so project memories and embeddings pool across tools.
The wizard auto-detects harnesses and resolves plugin conflicts, and the doctor command re-checks registration, conflicts, and database integrity.
Most users install through the wizard rather than from source.
git clone https://github.com/cortexkit/magic-context.git
cd magic-contextThe npx route works on any OS and targets a specific harness if you pass --harness.
npx @cortexkit/magic-context@latest setupCheck the installation health, then restart your harness and continue in one long-lived session.
npx @cortexkit/magic-context@latest doctorIt is maintained by cortexkit as part of the CortexKit family of agent plugins.
Yes, it is MIT-licensed and free to install. You pay only for the models your harness and historian use, and the historian can run on a cheap or local model.
You need model access for your coding harness and for the historian; that can be a provider API key or a local model, since embeddings default to a local model and the historian accepts any provider/model id.
Built-in compaction in tools like OpenCode periodically summarises and drops history inside one session; Magic Context replaces that with continuous, cache-aware management plus durable cross-session project memory.
Run npx @cortexkit/magic-context@latest setup, choose your historian model, restart your harness, and keep using the same session.
LangMem: long-term memory primitives for LangGraph agents that learn and adapt from conversations.
Give your coding agents a persistent memory that survives every session.
Long-term memory runtime for AI agents — plain Markdown as truth, local ranked retrieval, no API key
Open-source AI memory that gives agents persistent long-term recall.
A memory operating system for long-term, personalized AI agents.
User-profile-based long-term memory for AI chatbot applications
The most-starred other AI Agents projects in the LibreAI catalogue — the realistic shortlist if magic-context is not the right fit.
A personal AI that really does things — on any OS, with your data staying yours.
An agentic skills framework & software development methodology that works.
Agent harness optimization system with skills, memory and security for Claude Code, Codex and more
The agent that grows with you — a Python framework for adaptive AI agents.
DeepSeek's plugin-based agent harness where everything is a plugin.
Free and open — grab the source, star the repo, and start creating.