AI Agent Memory

io.github.xiangzi1126由 GitHub 账号 xiangzi1126 发布v0.1.1更新于 Oct 27, 2026

Agent-agnostic persistent memory MCP server. Local-first: memories travel with your project.

发布方自己的服务:Memory.fit

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地优先的持久记忆 MCP 服务器,把记忆存放在项目的 .aamm 目录中,并可在 Claude Code、Cursor、Qoder 等代理之间共享。

可以做什么
  • 按用户、项目、流程、代理四类记忆进行存储、召回、读取、筛选、更新、列出和删除,召回时融合向量、关键词与标题标签匹配。
  • 记录工作日志条目,并在需要时检索过往日志时间线。
  • 设置日志中显示的用户名,查看当前代理与项目上下文。
  • 通过命令行管理存储:初始化、查看状态、导出为 Markdown、从 Markdown 重建索引以及一致性检查。
适用场景
适合希望助手跨会话记住用户偏好、项目知识和调试经验,并让多个 MCP 客户端在同一项目上共用一份记忆存储的场景。更偏向本地、按项目划分的记忆,而非托管式记忆服务。
运行要求
以本地 Python 进程运行;需从 PyPI 安装 ai-agent-memory-mcp 包,并要求 Python 3.11 及以上。需要兼容 OpenAI 的嵌入服务,在 .aamm/config.yml 中配置 model、base_url、api_key_env 和 dim;API 密钥从该配置指定的环境变量读取,例如 VOLCENGINE_API_KEY、SILICONFLOW_API_KEY 或 OPENAI_API_KEY,放在项目根目录的 .env 中。需要能访问嵌入服务端点。
安装前请注意
记忆和日志会写入项目的 .aamm 目录,包括 Markdown 镜像和按天生成的日志文件,这些内容可能随项目被提交或分享。记忆内容、标题和标签会发送给所配置的第三方嵌入服务,可能产生费用。相关工具可以更新和删除已存记忆,日志会记录被提问和完成的内容。更换嵌入模型可能导致已有向量失效。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AI Agent Memory,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

AI Memory MCP Server

Agent-agnostic persistent memory as an MCP Server — local-first: memories travel with your project in .aamm/, shared across Claude Code / Qoder / Cursor.

[License: MIT] [Python 3.11+] [MCP] [PyPI]

中文 | 日本語

An agent-agnostic persistent memory layer exposed as an MCP Server. Any MCP client — Claude Code, Qoder, Cursor — can reuse it. Memories live in each project's .aamm/ directory and travel with the project; different agents working the same project share one memory store, with a source_agent stamp distinguishing writers.

Architecture

  • SQLite — structured source of truth (CRUD + FTS5 keyword search)
  • Chroma (embedded) — vector retrieval, persisted to .aamm/chroma/
  • Embedding — any OpenAI-compatible service (Volcengine / SiliconFlow / OpenAI / others); defaults to Volcengine doubao-embedding-vision
  • Markdown mirror — each memory is also written to .aamm/memories/<category>/<id>.md, human-readable and editable

The three layers are joined by id.

Memory categories

categoryuse
useruser preferences (tech background / dev habits / answer style)
projectproject knowledge (architecture / stack / layout / design decisions)
processwork process (solved issues / bugs / debugging / lessons)
agentagent collaboration (what was done / handoff notes)

Install

From PyPI:

powershell
pip install ai-agent-memory-mcp

From source:

powershell
cd ai_agent_memory_mcppip install .          # or: pip install -e .   (editable, for development)

Requires Python 3.11+.

Configure embedding (any OpenAI-compatible service)

The embedding layer is a generic OpenAI-compatible client — Volcengine / SiliconFlow / OpenAI / any compatible service works. On first run a default config is generated at .aamm/config.yml; edit as needed.

Fields (embedding section of .aamm/config.yml)

fieldmeaning
providerlabel (informational only)
modelembedding model name
base_urlOpenAI-compatible endpoint
api_key_envwhich env var holds the key
dimvector dim (must match the model)

Put the key in the project root .env, then edit the embedding section of config.yml.

Examples

Volcengine doubao-embedding-vision (default; Agent/Coding Plan keys must use the Plan endpoint /api/plan/v3 — standard /api/v3 returns 401)

yaml
embedding:  provider: volcengine  model: doubao-embedding-vision  base_url: https://ark.cn-beijing.volces.com/api/plan/v3  api_key_env: VOLCENGINE_API_KEY  dim: 2048

.env: VOLCENGINE_API_KEY=...

SiliconFlow bge-large-zh (Chinese-text optimized)

yaml
embedding:  provider: siliconflow  model: BAAI/bge-large-zh-v1.5  base_url: https://api.siliconflow.cn/v1  api_key_env: SILICONFLOW_API_KEY  dim: 1024

.env: SILICONFLOW_API_KEY=...

OpenAI

yaml
embedding:  provider: openai  model: text-embedding-3-small  base_url: https://api.openai.com/v1  api_key_env: OPENAI_API_KEY  dim: 1536

.env: OPENAI_API_KEY=...

Any other OpenAI-compatible service: just fill in base_url / model / api_key_env / dim.

After switching embedding model, old vectors may mismatch in dimension; clear .aamm/chroma/ and re-remember, or run python tests/rebuild_vectors.py.

Retrieval

recall uses three-way fused retrieval to maximize hit rate:

  • Vector (weight 0.6): Chroma cosine; embeddings are computed from title + tags + content, so title/tag signal enters the vector
  • Keyword (weight 0.25): SQLite FTS5 trigram
  • Title/tag match (weight 0.15): +0.15 if the query appears in the title, +0.075 if in a tag

Candidates are expanded to top_k*3, then fused down to top_k. If the query contains FTS5 special characters (., *, ", -, ...), the keyword branch falls back to LIKE substring matching instead of erroring.

Work journal

Besides searchable memories, aamm keeps a human-readable work journal. After completing a user request, the agent calls journal_entry() to log what was asked / what it did / any open question. Journals are for people reading a timeline; recall does not search them. Use search_journal() only as a fallback to recover "what happened in a past interaction".

Journals are written to .aamm/logs/:

  • journal.db — single SQLite store (the search source, spans all dates)
  • YYYY-MM-DD.md — one Markdown file per day, append-only timeline
.aamm/logs/├── journal.db        # search source (all dates)├── 2026-07-14.md     # per-day timeline└── 2026-07-15.md

MCP tools

Memory (8):

  • remember(title, content, category, tags?, scope?) — store (three-way sync, auto-embed)
  • recall(query, category?, top_k=5) — fused retrieval (vector + keyword + title match)
  • get_memory(id) — get one
  • search_memories(category?, tag?, agent?) — structured filter
  • update_memory(id, ...) — update (re-embed + refresh md)
  • forget(id) — delete (three-way sync)
  • list_memories(category?) — list
  • who_am_i() — current agent + project context

Journal (3):

  • journal_entry(question, answer_summary, key_points?, open_question?, session_id?) — log a timeline entry
  • search_journal(query, date_from?, date_to?, agent?, limit=10) — fallback search over journals
  • setup_profile(user_name) — set the user name (shown in journals)

Management CLI

powershell
python -m ai_agent_memory_mcp.cli init                  # initialize .aamm in the current projectpython -m ai_agent_memory_mcp.cli status                # store overview (categories / vectors / md / journal)python -m ai_agent_memory_mcp.cli export [--dir DIR]    # export all memories to Markdownpython -m ai_agent_memory_mcp.cli sync                  # rebuild SQLite + Chroma from Markdownpython -m ai_agent_memory_mcp.cli check                 # consistency check (db / md / chroma)python -m ai_agent_memory_mcp.cli journal [--limit N]   # show recent journal entries

Wire into Claude Code (user scope; shared code, per-project data)

From PyPI (no PYTHONPATH needed):

powershell
claude mcp add aamm -s user -- python -m ai_agent_memory_mcp --agent claude-code --project-from-cwd

From a source clone, add -e PYTHONPATH=<clone dir>\ai_agent_memory_mcp:

powershell
claude mcp add aamm -s user -e PYTHONPATH=<clone dir>\ai_agent_memory_mcp -- python -m ai_agent_memory_mcp --agent claude-code --project-from-cwd

Qoder / Cursor are the same — just change --agent.

Data layout

.aamm/├── memory.db                    # SQLite: structured memories + FTS5├── chroma/                      # Chroma vector store├── memories/<category>/<id>.md  # Markdown mirror (editable)├── logs/│   ├── journal.db               # work journal (search source)│   └── YYYY-MM-DD.md            # per-day journal timeline├── config.yml                   # embedding config└── profile.json                 # user name

License

MIT

来源:README.md,提交 467d1e9

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Memory 集成