Cognitive Memory OS for AI Agents — persistent, self-improving, multi-agent memory
Cognitive Memory OS for AI Agents — persistent, self-improving, multi-agent memory
The next agent starts wiser.
Persistent memory for AI agents that need to carry work forward, recover original evidence, and stop following a lesson when its source changes.
Mnemosyne connects memory to its consequences: a corrected requirement can retire a dependent procedure, a failed trial can withhold a skill, and a new agent can resume from an explicit handoff. Run the local engine in one SQLite file; connect your host through TypeScript, MCP, CLI, or authenticated HTTP with a Python client and live inspector.
2.0.0-rc.9 · Release candidate · MIT · Node.js ≥22.16
Website · Quickstart · Documentation · Examples · Migration · Measured results · npm · Contributing
Both engines ship in 2.0.0-rc.9. Choose the storage and runtime that fit your application:
| Engine | Best starting point | SDK entry point | Guide |
|---|---|---|---|
| Vector Engine | An application using the existing service-backed memory architecture. Requires configured external services. | createMnemosyne from mnemosy-ai |
Working example · Version 2 changes |
| Local Engine | A self-contained SQLite memory store with evidence, corrections and agent lifecycle tools. | createLocalMemory from mnemosy-ai/local |
Local API · Agent lifecycle |
The MemoryAgent adapter uses the Local Engine's runtime. These engines have separate schemas and do not automatically migrate or synchronize data. To transition gradually, explicitly connect your existing store through the read-only migration bridge; it leaves that store unchanged.
Engine choice is separate from release channel: stable mnemosy-ai@latest remains on version 1.x, while mnemosy-ai@next selects the version 2 candidate containing both engines. Review the migration notes before upgrading an existing Vector Engine application.
Install the exact release candidate in your project. Node 24 is recommended; the local memory engine needs no model API key, database server, or Docker.
npm install [email protected]
npx --no-install mnemosy demo
npx --no-install mnemosy learning-demoThe prerelease channel is mnemosy-ai@next. Pin the exact version for reproducible deployments; unqualified npm install mnemosy-ai follows the stable latest channel and still selects version 1.x. Evaluate this candidate on your own workload before production. Python registry publication is separate; the bundled Python client can be installed from the checkout.
To build and run the same candidate from source:
git clone --branch v2.0.0-rc.9 --depth 1 https://github.com/28naem-del/mnemosyne.git
cd mnemosyne
npm ci --ignore-scripts
npm run build
npm run demo
npm run demo:learningThe first demo uses a temporary database to show a handoff, correction, private scope and forgetting. The learning demo exercises capture, a scripted observation job, skill trials, explicit sharing and correction-driven retirement. Both run real local APIs with deterministic fixtures and no model calls. Choose your next example.
For full contributor validation, run npm run check, npm run check:docs and npm run check:public. RC9 refreshes packaging, contact details and release guidance over the RC8 engine; the recorded evaluation reports remain historical measurements of the versions and conditions they name.
To consume your built checkout from another project, run npm install /absolute/path/to/mnemosyne in that project. Keep the checkout and its dist directory available. The older RC8 GitHub release and checksummed downloads remain unchanged.
…The old procedure remains inspectable but is no longer eligible as current guidance. Dependencies must be declared by the controller. observed means the host recorded the source; it does not certify its truth. The default context counter measures UTF-8 bytes conservatively, not a model's tokenizer. Context contract.
| Capability | Behavior | Developer guide |
|---|---|---|
| Memory with evidence | Private-by-default records, explicit sharing, corrections, conflicts, source history and dependent retirement. | Local API |
| Continuity across agents | Structured checkpoints preserve goals, decisions, artifacts and next actions; source changes can retire obsolete handoffs. | Agent lifecycle |
| Adaptive context | Budgeted observations, hierarchical summaries and expandable original source bytes, with evidence revalidation. | Context |
| Recall across words and meaning | Scoped BM25 by default; optional embeddings, hybrid fusion and reranking over authorized records. | Local semantic retrieval |
| Memory across time | Separate asOf and knownAt queries, scheduled corrections and causal invalidation history. |
Runtime |
| Evidence-gated skills | Candidate procedures, explicit trial requirements and retirement after failed or changed evidence. | Skills and trials |
| Source-backed profiles | Typed fields report supported values, unknowns or conflicts and revalidate their inputs. | Profiles |
| Silent-staleness checks | Explicit source policies, last-confirmed evidence, bounded probes and action-bound dependency checks. | Freshness |
| A controlled transition | Read-only access to your previous store, gradual local preference, reconciliation and routing rollback. | Gradual migration |
| Full import and recovery | Eleven export profiles, preview, atomic application, replay protection, guarded undo and whole-database backups. | Import · Recovery |
| Host-controlled processing | Durable bounded jobs, source-backed project models, outcome traces, entity relations and staged changes. | Runtime |
flowchart LR
Host[Your agent or application] --> Interfaces[TypeScript · MCP · CLI · HTTP / Python]
Interfaces --> Runtime[Capture · Context · Trials · Action checks]
Runtime --> Store[(Local SQLite memory)]
Store --- Evidence[Sources · History · Dependencies · Outcomes]
Runtime -. explicit configuration .-> Models[Optional model providers]
Runtime -. read-only adapter .-> Previous[Previous memory system]The host chooses identities, trust assertions, providers and execution budgets. Construction starts no worker or model download. MemoryAgent can prepare context before a turn and capture supplied visible input/output afterward; background work runs only when the host starts it. Host loop.
The local database holds memories, vectors and runtime state. Optional local CPU providers run cached inference in separate processes after explicit provisioning. Their dependency requirements, model identities and licenses are documented in the local model guide. The existing backend integration remains available through createMnemosyne; it does not automatically synchronize with the local engine. Version 1 migration notes.
After building, add a server entry to your MCP client. Replace the example path and choose an existing parent directory for the database.
{
"command": "node",
"args": [
"/absolute/path/mnemosyne/dist/cli/index.js", "mcp",
"--db", "/absolute/path/data/memory.sqlite",
"--workspace", "my-project", "--agent", "assistant"
]
}Use --read-only to omit mutation tools. Forgetting requires an explicit --allow-destructive launch. Models cannot choose another workspace, promote their own trust, or report successful trials through MCP. For an authenticated service, Python access and a live inspector, see HTTP and Python. Native provider tool protocols are documented in the adapter guide.
import { createLocalMemory } from 'mnemosy-ai/local';
import {
MemoryRuntime,
RECOMMENDED_SKILL_PROMOTION_POLICY,
} from 'mnemosy-ai/runtime';
const memory = createLocalMemory({
path: './skills-memory.sqlite', workspaceId: 'my-project', agentId: 'assistant',
});
const runtime = new MemoryRuntime(memory, {
skillPromotionPolicy: RECOMMENDED_SKILL_PROMOTION_POLICY,
});
// Use runtime to create candidates and record controller trials.
memory.close(); // Close after your host finishes using the runtime.The recommended policy requires successful trials across two distinct tasks and two verifier identities. Candidates stay outside advisory context until their stored requirements are satisfied; a weaker configuration cannot lower an existing candidate's requirements. The compatibility default remains one task and one verifier. Identities and trial outcomes are controller assertions, so your host must provide real tests and independent evidence. Trial contract.
The optional mnemosy-ai/bridge wraps your explicitly supplied legacy search adapter. It copies used records with stable origins, compares paired retrieval results, and moves from shadow to assist to preferred routing as observed coverage meets configured thresholds. Missing legacy matches remain available, and routing can return to the previous system.
The bridge keeps querying the original store for reconciliation and never writes or deletes there. Progress measures observed queries, not complete-store migration or answer quality. Host credentials, source selection and eventual cutover stay under your control. Bridge contract.
For a full export migration, choose one of the eleven supported profiles, preview the exact source bytes, then apply the reviewed plan atomically. Imports are private and untrusted by default; retry recognition, source inspection, guarded undo and erasure replay protection are included. Foreign embeddings and unsupported policy semantics are not silently converted. Full migration.
node --experimental-strip-types examples/gradual-migration.ts
node --experimental-strip-types examples/migration.ts
node --experimental-strip-types examples/maintenance.tsThese examples use isolated synthetic data. They do not connect to your existing accounts or memory stores.
The paired LongMemEval S retrieval run includes all 500 questions, with positive evidence metrics on 470 annotated answerable questions. Both retrieval conditions use 20 chunks and the same 8,192-byte context budget.
| Complete annotated-session coverage | Earlier overlap scorer | Current BM25 default |
|---|---|---|
| Before context packing | 386 / 470 (82.13%) | 425 / 470 (90.43%) |
| After context packing | 367 / 470 (78.09%) | 382 / 470 (81.28%) |
The 30 abstention questions remain in attempt counts without a positive retrieval score. All 500 full-history controls exceeded the context budget and are reported as overflows. The run uses same-day timestamp compatibility, including 1,475 sessions later than the stated question instant. A session hit can come from any of its chunks; it does not prove that the answer-bearing sentence reached the model. No embedding, ge
No open issues yet, or sync has not completed.