
polymnemo
io.github.PCBZ由 GitHub 账号 PCBZ 发布v1.5.0更新于 Oct 30, 2026
Shared cross-LLM long-term memory over MCP: semantic recall, sessions, and media (pgvector).
概览
基于 MCP 的共享长期记忆:助手可存储事实、会话与媒体,并在任意 LLM 客户端间按语义召回。
- 可以做什么
- 存储、召回、列出、读取、更新和删除记忆,支持语义、精确关键词或融合排序模式
- 保存完整会话记录并原样重新载入,或跨会话召回
- 通过上传与下载链接附加文件、图片或视频,仅嵌入可搜索的描述
- 检查服务健康与组件配置,并将某个命名空间作为资源暴露以供自动注入
- 适用场景
- 适合希望多个助手或 IDE 共享同一份持久记忆(事实、历史会话、附件),并能按语义而非精确措辞找回内容的场景。
- 运行要求
- 远程 streamable HTTP 端点;需要 OAuth 登录或向维护者申请按用户分配的 API 密钥,并以 Authorization bearer 头传递。若自行部署,则需 Python 3.11+、带 pgvector 的 Postgres 数据库,并在服务端配置 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 polymnemo,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.PCBZ%2Fpolymnemo/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"polymnemo": {
"type": "http",
"url": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}README
polymnemo
[Python] [MCP] [Postgres] [Neon] [SQLAlchemy] [Pydantic] [Cloudflare R2] [Azure] [Cloud Run] [Terraform] [Docker] [pytest] [Ruff]
A shared long-term memory across any LLM, over MCP.
Point Claude Desktop, an MCP-capable IDE, or any MCP client at one polymnemo endpoint and they share the same memories — stored in your own Postgres. Store a fact with one assistant, recall it from another; save whole sessions and reload them; even attach files, images, or video. Embeddings run locally (no embedding API key), and the server makes no generative-LLM calls.
Status: active development. Semantic memory + pgvector store, session save/reload, and multimedia memories all work; deployable to Azure Container Apps (or Cloud Run) via Terraform. Wiki · Issues
Features
- 🔗 Cross-LLM shared — point any MCP client at one endpoint; they share the same memory.
- 🧠 Semantic recall — vector search over Postgres + pgvector by default, with exact-text and fused (RRF) modes when you need to find an ID or a name.
- 💬 Sessions — save a full transcript and reload it verbatim, or recall across it.
- 🖼️ Multimedia — attach files, images, or video; bytes go to object storage, only a searchable description is embedded.
- 🔒 Local & private — embeddings run locally (ONNX): no embedding API key, and no generative-LLM calls, ever.
- 👥 Namespaces — "born-shared" collections readable by everyone, vs. private-to-owner; writes are always owner-scoped.
- 🧩 Pluggable layers — store, embedder, auth, retriever, blob store, and rate limiter are all swappable
Protocols. - ☁️ Multi-cloud deploy — one Terraform stack to Azure Container Apps or Cloud Run, scale-to-zero.
- 🚦 Rate limiting — optional global token bucket.
How it works
A request carries a bearer key (which resolves to a user_id); the tool passes
the rate-limit gate, then delegates to a MemoryService that chunks + embeds
text and stores the vectors in pgvector — large files go to object storage via
presigned URLs, with only a searchable description embedded.
Every layer is a typing.Protocol, wired together by a composition root
(context.py), so you can swap an implementation
without touching the tools:
The ping tool returns the active layers, so you can see how a running server is
wired.
Quickstart
Requires Python 3.11+.
1. Install
2. Provision Postgres (pgvector)
The durable store is Postgres + pgvector; the easiest hosted option is Neon (use the pooled connection string). Apply the schema once:
3. Configure
Copy .env.example to .env and set the database URL and at least one API key:
Each key maps a bearer token to a user_id; writes are scoped to that user.
4. Run
Or with Docker:
5. Connect an MCP client
Any client that supports remote (HTTP) MCP servers with custom headers needs two things:
- Endpoint:
http://<host>:<port>/mcp - Header:
Authorization: Bearer <your-key>
For clients that read an mcpServers config:
Or verify with the inspector:
Concepts
- Users & keys — sign in with GitHub, or present a bearer token. Either way
the request resolves to a
user_id, and writes are owner-scoped (you can only edit or delete your own memories). - Headless clients — CI, cron jobs and server-side agents can't complete a
browser sign-in, so they use an API token instead. Sign in with GitHub at
<server>/tokensto create, list and revoke them; a new token is shown once and stored only as a SHA-256 hash. Deliberately not MCP tools — a secret must never travel an LLM channel. - Namespaces — memories live in namespaces. A shared namespace (default
shared) is readable by everyone ("born shared"); everything else is private to its owner. Sessions and media default to private namespaces. - Chunking — long content is split into chunks on write (one vector each), so
remembermay return several ids andrecallreturns the closest chunks. - Secret scanning — optional, and off unless you turn it on: set
POLYMNEMO_RSP_CONFIGto a scanner config (the image ships one at/app/plugins/rsp.toml). Unset, every write goes through a no-op guard and nothing is scanned. When on, the text of a memory is scanned before it is embedded or stored, so a refused write was never written rather than deleted afterwards. It coversremember,save_session,updateand a media memory's description. The contents of uploaded files are not scanned and are stored as you sent them: the bytes go straight to object storage under a presigned URL and never pass through this server. A file's description is scanned; the file is not.
Tools
polymnemo exposes MCP tools for storing, searching, and managing memories:
- Memory —
remember,recall,list_memories,get_memory,update,forget
recall takes a mode:
keyword is an exact substring match. rrf fuses the top 50 candidates from each
leg, so paging through it reaches at most about 100 results.
score is only comparable within one mode, and total is the size of the
namespace searched, not the number of matches.
- Sessions —
save_session,load_session - Media —
create_upload,confirm_upload,get_download_url
Plus a ping health check and a memory://{namespace} resource for
auto-injecting a collection. Media bytes go to object storage via presigned URLs
— never through the MCP channel — with only a searchable description embedded
(needs the blob extra).
Full arguments and return shapes live in the dedicated MCP tools reference (coming soon). See Concepts for how keys, namespaces, and chunking work.
Configuration
POLYMNEMO_* environment variables (or .env) — full list in
.env.example. The essentials:
Development
Postgres tests run when TEST_DATABASE_URL points at a pgvector Postgres. CI
(.github/workflows/ci.yml) runs lint + the suite with coverage and posts a
pass/fail/coverage table to each run's summary.
Deploy
polymnemo is stateless (all state in Neon + object storage), so it runs on
Azure Container Apps (primary) or Google Cloud Run with scale-to-zero.
Everything is Terraform in deploy/terraform/: shared
neon/ (Postgres) and r2/
(media bucket) roots own the durable state, and a compute root deploys a service
that reads both — so memories and media are shared across clouds.
The Azure path deploys from CI in one click: set the GitHub secrets
(scripts/setup-github-secrets.sh), bootstrap the state backend
(scripts/bootstrap-tfstate-azure.sh), then run the deploy (azure) workflow
(neon → schema → r2 → build → app). GCP is a manual failover. Full walkthrough
in docs/deploy.md.
License
MIT — see LICENSE.
来源:README.md,提交 ed6634f
工具
0版本历史
7- v1.5.0最新Oct 29, 2026
- v1.4.1Oct 24, 2026
- v1.4.0Oct 21, 2026
- v1.3.0Sep 21, 2026
- v1.2.7Sep 19, 2026
- v1.2.5Sep 17, 2026
- v1.0.0Sep 16, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分