百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mnemosyne

> DevOps
开源

用于 AI 代理的认知记忆操作系统 — — 持久、自我改进的多代理记忆

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于 AI 代理的认知记忆操作系统 — — 持久、自我改进的多代理记忆

Mnemosyne

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

Choose your engine

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.

Start with a working demonstration

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.

bash
npm install [email protected]
npx --no-install mnemosy demo
npx --no-install mnemosy learning-demo

The 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:

bash
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:learning

The 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.

A correction should change what the next agent does

…

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.

What you can build

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

Local Engine, several entry points

mermaid
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.

Connect through MCP

After building, add a server entry to your MCP client. Replace the example path and choose an existing parent directory for the database.

json
{
  "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.

Require stronger skill evidence

javascript
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.

Migrate while your agent keeps working

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.

bash
node --experimental-strip-types examples/gradual-migration.ts
node --experimental-strip-types examples/migration.ts
node --experimental-strip-types examples/maintenance.ts

These examples use isolated synthetic data. They do not connect to your existing accounts or memory stores.

Measured, with the limits visible

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

Issues· 6 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptagentsaiai-agentsartificial-intelligence

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理