
Spomory
io.github.lyf-wxy由 GitHub 帳號 lyf-wxy 發布v0.3.1更新於 Oct 24, 2026
Explainable graph-retrieval memory engine with an RL-trained management policy.
概覽
Spomory 是一個 MCP 記憶伺服器,讓助理跨工作階段保存事實並在日後回想,可本機執行或使用託管服務。
- 可以做什麼
- 新增與檢索記憶:保存使用者告知的內容,並依問題檢索相關事實,附上提及時間。管理記憶:刪除最相符的一筆記憶、清空整個記憶圖譜,或將全部內容匯出為 JSON。檢視某個主題周邊的記憶圖譜,了解實體與關係。透過獨立的匯入指令,從既有的 Claude Code、Codex 或 Cursor 工作階段歷史初始化圖譜。
- 適用情境
- 適合希望偏好、專案細節或個人事實能在多次對話與多個 MCP 用戶端之間延續、不必每次重複的情境。也適合想要自架本機記憶庫,或使用可跨裝置同步的託管服務的使用者。
- 執行需求
- 本機方式需要 Python 3.11+,也可透過 uvx 執行;另提供帶 OAuth 的遠端端點。抽取需要相容 OpenAI 的 LLM,透過 LLM_API_KEY 設定,可選 LLM_BASE_URL 與 LLM_MODEL。託管方式需要帳號,並在 x-api-key 標頭提供 API 金鑰。本機資料預設存放在 ~/.memory-core/。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Spomory,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.lyf-wxy%2Fspomory/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"spomory": {
"type": "http",
"url": "https://api.yliuai.com/mcp"
}
}
}README
Spomory
English | 中文
Spomory gives AI clients a memory that persists across sessions — and is shared between all of them. Tell one of them something once (a project detail, a preference, a fact about yourself) and any of them can recall it later, without you repeating yourself. It's an MCP server, so it works with any MCP-compatible client: Claude Desktop, Cursor, Codex CLI, and Doubao (豆包) have each been verified end-to-end with a real client session (see "What it can do" below); ModelScope, Coze, and 阿里云百炼 (Alibaba Cloud Bailian) are also known-compatible, connecting the same way any remote MCP client does (Streamable HTTP, or SSE for 百炼 specifically, which doesn't support Streamable HTTP yet).
It runs as an MCP server, either
locally on your own machine (free, nothing leaves your computer) or as a
hosted cloud service (free signup, memory follows you across devices) —
every client above supports both. The rest of this README walks through
the local path (that's what "Get started" below covers); the fastest way
into the cloud path is the web app at
spomory.yliuai.com/get-started/remote.
Exact local/cloud configuration for each individual client lives in
docs/mcp_quickstart.en.md (organized one
section per client — Claude Desktop/Cursor/Codex CLI/Doubao — each
covering both connection methods).
Curious what it actually does before installing anything? There's a no-signup demo at spomory.yliuai.com — paste in some text and see it turned into the structured facts that would then follow you across Claude, Cursor, Codex CLI, and every other client you connect, persisting across sessions instead of resetting each time.
Get started
Requires Python 3.11+.
1. Install. Or skip this step entirely — step 3's config can point
straight at uvx, which fetches and runs it on demand, nothing to
pre-install:
2. Give it an LLM. Spomory uses an LLM to turn what you tell it into structured facts. Any OpenAI-compatible API works — OpenAI, DeepSeek, Qwen, etc.:
3. Connect it to your client. Claude Desktop, Cursor, and Codex CLI
each need a few lines added to a config file, pointing at the
spomory-mcp command. The exact steps, a config file example for each
client, and a real gotcha we hit (macOS blocking a venv that lives under
~/Documents) are in
docs/mcp_quickstart.en.md.
Clients without a config file — Doubao (豆包), Coze, ModelScope — connect instead through a point-and-click "custom connector" form (URL + headers, or command + args + env for a local process); see the Doubao section in the same doc (each client — Claude Desktop, Cursor, Codex CLI, Doubao — now has its own section there, with STDIO/HTTP/OAuth grouped underneath it).
The one thing that trips people up: the config needs the absolute path to
spomory-mcp(runwhich spomory-mcpto find it) — the client doesn't necessarily launch it with your shell'sPATHset. This whole gotcha (and step 1) disappears ifcommandisuvxinstead — see the quickstart guide for the exact JSON.
That's it. Data lives locally in ~/.memory-core/ by default (override
with MEMORY_CORE_DATA_DIR). A Dockerfile is also
included, for MCP directories/hosts that deploy from a container image
instead.
Two more things worth doing right after connecting: copy
skill/spomory/SKILL.md into your client's
skills directory so it actually calls these tools on its own instead of
sitting there unused; and if you're already using Claude Code, Codex, or
Cursor, run spomory-import-sessions --client claude-code (or
codex/cursor) to seed the graph from real session history instead of
starting from nothing. Both covered in the quickstart guide.
Want the LLM calls local too, instead of a cloud API? Point LLM_BASE_URL
at any local OpenAI-compatible server — vLLM, Ollama, llama.cpp, or MLX
all work — and set EMBEDDING_PROVIDER=openai_compatible to route
embedding the same way instead of the local sentence-transformers
model, dropping the torch dependency entirely. Details and per-engine
examples in
docs/mcp_quickstart.en.md.
What it can do
Once connected, six tools become available inside the client:
All six are verified working end-to-end against real Claude Desktop,
Cursor, Codex CLI, and Doubao sessions, both local and remote — see
docs/mcp_quickstart.en.md for what
"verified" means for each client.
How it works, for the curious
You don't need any of this to use Spomory — it's here for people who want to know what's actually happening underneath.
- Pluggable LLM / embedding providers: defaults to any OpenAI-compatible
API (including Chinese-market LLM providers) + local
sentence-transformers(defaultbge-m3, bilingual Chinese/English). - Dual-layer incremental knowledge graph: entities and relations are
modeled as independent layers; new data is only extracted and merged in,
never a full rebuild. Exact-match filler input ("thanks", "好的", "ok", ...)
is skipped before it ever reaches the extraction LLM call, since it can't
contain an extractable fact — relevant cost protection on any
unauthenticated endpoint. Defaults to a local
LocalGraphStore(networkx + SQLite); aPostgresGraphStorecloud implementation also exists, and both share the same behavioral contract test suite. - HippoRAG 2-style retrieval: the query is matched directly against triples rather than only against entity nodes; the matched seed nodes are diffused via personalized PageRank for multi-hop association, then assembled into a natural-language context (with source timestamps, so "when did I mention X" is answerable). Ranking on top of that decays a relation's relevance the longer it's gone without being retrieved, and boosts it back up (log-dampened, so it can't dominate PPR rank) the more times the same fact has been restated — a passive signal alongside the active ADD/UPDATE/DELETE/NOOP decisions below.
- Memory management: an ADD/UPDATE/DELETE/NOOP action space, with a
rule-based default policy (
RuleBasedPolicy) and a full GRPO training pipeline (memory_manager/train_grpo.py, actually run and verified on a real GPU). - Memory passport export + true delete: a JSON-LD style export format, physical deletion, and an audit log.
- Multimodal image verification: image captioning → reuses the text extraction pipeline → CLIP cross-checks candidate triples. Honestly positioned as "verification," not "native cross-modal extraction."
- Cloud skeleton: FastAPI user auth/API keys/quotas, a Stripe webhook billing scaffold (skeleton-level only, not production-deployed).
Measured results
Real runs against DeepSeek on 84 QA pairs from LoCoMo-10 (conv-26, first 150 turns) — not cherry-picked, and not competitive with the bigger players' published numbers yet:
A prior run (before a fix that folds dates into extracted predicates so
"when" questions are answerable) scored lower on accuracy but higher on
recall (62.0%) — the fix traded some retrieval recall for a real
+14.3-point accuracy gain, and we went and found out exactly why instead
of just reporting the accuracy number: the date-folding instruction
sometimes misfires on content-free small talk ("Thanks!" → "thanked on
2023-07-03"), and those extra low-value triples crowd out relevant ones
out of the fixed top-10 retrieval window. Full numbers, per-category
breakdown, and the side-by-side extraction comparison that found this are
in docs/benchmark_smoke_test.md.
LongMemEval (xiaowu0162/longmemeval-cleaned oracle variant, first 10
of 500 questions):
The limitations here matter as much as the numbers:
- Only 10 questions, not the full 500 — each question ingests ~27 turns on average (~27 real extraction calls plus one generation and one judge call), and this environment's LLM API calls go through a proxy with real latency; the full dataset would take tens of hours. This is a real run, not a mock, but it's a small sample and shouldn't be read as generalizing to the full dataset.
- All 10 happen to be
temporal-reasoningtype — the dataset also has amulti-sessiontype;load_longmemeval(limit=10)takes the first 10 entries in file order with no stratified sampling, so this sample isn't representative of the dataset as a whole. - Recall@10 = 100% is largely an artifact of the oracle variant's design, not a strong retrieval claim — the oracle variant pre-filters each question's haystack down to only the relevant sessions (no distractor sessions), which is considerably easier than a real deployment's memory store (hundreds/thousands of unrelated turns). This isn't the same task as the full (non-oracle) LongMemEval benchmark and shouldn't be compared directly against numbers other products report on that harder variant.
- Strict-match accuracy (30%) is far below LLM-judged accuracy (80%), consistent with the same pattern seen in the LoCoMo results — substring matching systematically undercounts answers that are correct but worded differently.
Raw data:
benchmarks/results/longmemeval_oracle_subset.json;
the run script is
benchmarks/run_longmemeval_subset.py.
For contributors: building from source
Everything below is for people who want to hack on the internals, run the test suite, or reach dependency groups beyond what running the MCP server needs (GPU training, the cloud API skeleton, multimodal verification). If you just want to use Spomory, you don't need any of this — see "Get started" above.
Project layout
Set up a dev environment
Prerequisites: Python 3.11+, uv
(no uv? python -m venv + pip install -e works as a substitute for the
uv commands below).
The embedding group downloads the default model BAAI/bge-m3 from
HuggingFace on first use (~2.2GB) — make sure huggingface.co is reachable
(if you're behind the Great Firewall, export HF_ENDPOINT=https://hf-mirror.com
routes through a mirror). You can also swap in a smaller model via
export EMBEDDING_MODEL=<any sentence-transformers model name>.
Run a minimal example (no MCP, plain Python calls)
With dev + llm + embedding installed and the three env vars from
"Get started" set, this script exercises the full "write a memory →
retrieve it" pipeline directly (the same logic behind
mcp_server/server.py's add_memory/search_memory tools, just calling
the library directly instead of going through the MCP protocol layer):
Here's real output from a live run against DeepSeek with the exact input shown above (not fabricated, not cleaned up — this is what actually came back):
Exact wording and entity/relation counts depend on the LLM's own
extraction and will vary between runs, but as long as the env vars are
set correctly, non-empty output means the pipeline works end to end.
retrieval/ranker.py detects whether a relation's text is CJK or not and
renders it accordingly (no spaces + a Chinese timestamp label for CJK,
spaced words + an English timestamp label otherwise), so English input no
longer comes out as one run-on word like earlier versions of this demo
did.
Testing
Most of the "slow" tests aren't mocked — they're real calls (real LLM API,
real local embedding model, real CLIP model) and need the corresponding
env vars (LLM_API_KEY, etc.) or an already-downloaded model cache.
Documentation index
Every doc above now has both a Chinese and an English version.
Known limitations
- Multimodal verification for voice input (ASR + audio embedding) isn't implemented yet.
- The GRPO training dataset (140 real samples) and the number of training
steps are still small;
memory_manager_eval.mdhonestly documents how that limits training effectiveness. - The cloud API/billing is skeleton-level only and hasn't been connected to a real production environment.
License
See LICENSE.
來源:README.md,提交 efd8399
工具
0版本歷史
8- v0.3.1最新Oct 12, 2026
- v0.3.0Oct 2, 2026
- v0.2.1Sep 22, 2026
- v0.2.0Sep 21, 2026
- v0.1.3Sep 19, 2026
- v0.1.2Sep 18, 2026
- v0.1.1Sep 17, 2026
- v0.1.0Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分