Obsidian-compatible agent memory vault with MCP
Project description
novelmemo
面向 AI Agent 的长期记忆 MCP 服务:将记忆持久化为 Obsidian 兼容的 Markdown vault,供 Agent 读写、供 Obsidian 只读可视化记忆图谱。
快速开始
安装与运行(推荐 uvx)
uvx novelmemo init ~/my-vault
uvx novelmemo mcp --vault ~/my-vault
本地开发:
uv sync
uv run novelmemo init ./my-vault
uv run novelmemo mcp --vault ./my-vault
Cursor / MCP 配置示例
在 mcp.json 中添加:
{
"mcpServers": {
"novelmemo": {
"command": "uvx",
"args": ["novelmemo", "mcp", "--vault", "/path/to/my-vault"]
}
}
}
工作流约定
- MCP 是唯一写入方:记忆的创建、更新、删除以及
## Related memories自动链接段均由 MCP 维护。 - Obsidian 只读使用:在 Obsidian 中打开 vault 浏览图谱与正文,请勿手改记忆文件;
.memory/目录(sidecar 索引与配置)可加入 Obsidian ignore。 - 会话起始:在新 Agent 会话中调用
read_memory("system://boot")加载memory.yaml中配置的 boot 记忆;boot 视图末尾会附加最近修改的 5 条记忆。请在 Cursor Rules 或 Agent 系统提示中自行编写 boot 协议(本项目不内置 system prompt)。
CLI
| 命令 | 说明 |
|---|---|
novelmemo init <vault-path> |
将 starter vault 模板拷贝到目标目录 |
novelmemo mcp --vault <path> |
启动 MCP stdio 服务 |
业务配置位于 {vault}/.memory/memory.yaml(valid_domains、boot_uris、locale 等)。优先级:CLI > 环境变量 > memory.yaml > 默认值。
环境变量(v1):MEMORY_BOOT_URIS、MEMORY_VALID_DOMAINS、MEMORY_LOCALE。
MCP 工具(6 个)
| 工具 | 说明 |
|---|---|
read_memory(uri) |
读取记忆或 system 视图(boot / index / recent / glossary) |
create_memory(parent_uri, content, disclosure, title?) |
创建子记忆;disclosure 必填,title 可选(支持中文) |
update_memory(uri, ...) |
patch、append 或更新 disclosure |
delete_memory(uri) |
删除记忆并同步邻居 Related 段 |
manage_triggers(uri, add?, remove?) |
管理 frontmatter triggers |
search_memory(query, domain?, limit?) |
FTS + jieba 全文检索 |
目录结构
my-vault/
core/agent/_index.md → core://agent
core/my_user.md → core://my_user
writer/characters/爱丽丝.md → writer://characters/爱丽丝
.memory/
memory.yaml # 业务配置
index.db # sidecar FTS 索引(内部使用)
外部变更同步
当 vault 中的 .md 文件被 MCP 以外的途径修改(例如 git pull)时,后台 watcher 会自动 resync Related 段与 sidecar 全文索引。正常运行时仍以 MCP 写入为主路径。
许可
MIT License。自 Nocturne Memory 改编的组件见 NOTICE。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file novelmemo-0.1.0.tar.gz.
File metadata
- Download URL: novelmemo-0.1.0.tar.gz
- Upload date:
- Size: 150.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c051b20361e46336dd32bb7aafca571dc499b3014c35eaff7186b670f8189ca
|
|
| MD5 |
4d6d6234fb6e8beaa2744d4beae8551f
|
|
| BLAKE2b-256 |
de985ac44c9708b3967fc1b0be057c1eb6b2a46eb20fca0d42432f650d11a03b
|
Provenance
The following attestation bundles were made for novelmemo-0.1.0.tar.gz:
Publisher:
publish.yml on zyren123/novelMemo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
novelmemo-0.1.0.tar.gz -
Subject digest:
2c051b20361e46336dd32bb7aafca571dc499b3014c35eaff7186b670f8189ca - Sigstore transparency entry: 1978458496
- Sigstore integration time:
-
Permalink:
zyren123/novelMemo@85b7888492c3792831e3540a3964b81af19959d8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zyren123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85b7888492c3792831e3540a3964b81af19959d8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file novelmemo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: novelmemo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e6dbc92a0e42f79f6e235e486f7a0a32e0d329e9fbe691d09cedb2a25cfb5f7
|
|
| MD5 |
294132bda9174eb3fc81b9ffbc19bd81
|
|
| BLAKE2b-256 |
b9de9262a1e50150865a58331c483efea9734af038e3a35e83a61fbb26968e41
|
Provenance
The following attestation bundles were made for novelmemo-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on zyren123/novelMemo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
novelmemo-0.1.0-py3-none-any.whl -
Subject digest:
8e6dbc92a0e42f79f6e235e486f7a0a32e0d329e9fbe691d09cedb2a25cfb5f7 - Sigstore transparency entry: 1978458749
- Sigstore integration time:
-
Permalink:
zyren123/novelMemo@85b7888492c3792831e3540a3964b81af19959d8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zyren123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85b7888492c3792831e3540a3964b81af19959d8 -
Trigger Event:
workflow_dispatch
-
Statement type: