zhiji-memory
Provides brain-inspired long-term memory for MCP clients, enabling persistent user understanding across sessions with Chinese-optimized hybrid retrieval and evolving user profiles.
README
知己 (Zhiji) Memory — MCP Server
Chinese-first, brain-inspired long-term memory as an MCP server. Give any MCP client — Claude Desktop / Claude Code / Cursor / Cline / Cherry Studio / Coze — the ability to remember and understand your user across sessions.
中文用户:完整接入手册见
MCP-USAGE.md,或在线版 https://ai-know.me/mcp。
v0.4.0 · 9 tools / 2 resources / 1 prompt · stdio + Streamable HTTP · MCP protocol 2025-11-25
This repo is a thin bridge: it translates MCP tool calls into REST calls to the Zhiji backend (hosted at ai-know.me). The bridge stores nothing; all memory lives in the Zhiji service you connect to.
Why not just another vector-memory MCP?
Mem0 / Zep / LangMem expose add / search / delete over a vector store. 知己 exposes brain-inspired primitives:
- 11-stage hybrid retrieval — trigram full-text +
bge-large-zhsemantic + time-decay + access-reinforcement + dedup ranking. - 7-layer / 36-dimension evolving user profile — values, decision logic, behavior style, self-cognition, interoceptive & dynamic state.
- Workspace assembly — one call returns profile + relevant memories + confirmed facts + behavioral inferences, budget-trimmed for the client context window.
- Prospective reminders, multimodal ingest (audio / OCR / doc), and a self-evolving reward loop driven by user feedback.
All Chinese-optimized (trigram tokenizer + bge-large-zh); English is supported too. Memory is stored in the Zhiji backend you connect to — self-host it, or use the hosted ai-know.me service; either way it's your Zhiji instance, not a generic memory-SaaS middleman.
The 9 tools
| Tool | What it does |
|---|---|
zhiji_workspace_assemble |
Flagship — one-shot "everything needed to understand this user" for a query |
zhiji_memory_search |
11-stage hybrid recall (FTS + semantic + time) |
zhiji_memory_ingest |
Write a conversation to long-term memory (fields must be author/text) |
zhiji_ingest_file |
Multimodal ingest — audio / image / PDF / Word / Excel / video → memory |
zhiji_profile_get |
7-layer / 36-dim user profile summary |
zhiji_facts_get |
Distilled atomic facts with confidence & conflict status |
zhiji_prospective_due |
Due/upcoming intentions (todos, promises, plans) |
zhiji_feedback |
Thumbs up/down → self-evolution reward + per-memory Q-value |
zhiji_status |
Health & memory scale (call first to verify connectivity) |
Experimental capabilities (sleep consolidation / dream replay / emergence) are not exposed until their groundedness passes ablation.
Quick start
You need an agent Key (mb- prefix). Get one at https://ai-know.me/memory?tab=api (register + create a Key bound to your account).
Option A — remote, no install (recommended)
Point any Streamable-HTTP MCP client at the hosted endpoint — you don't need this repo at all:
claude mcp add zhiji-memory --transport http \
--url https://ai-know.me/mcp \
--header "Authorization: Bearer mb-yourKey"
Or in a URL-style client config (Cursor / Cherry Studio / LobeChat):
{
"mcpServers": {
"zhiji-memory": {
"url": "https://ai-know.me/mcp",
"headers": { "Authorization": "Bearer mb-yourKey" }
}
}
}
Option B — run this bridge locally (stdio)
Use this repo when you want the bridge as a local stdio process (e.g. a desktop client launches it for you), talking to the hosted Zhiji backend:
npm install # only @modelcontextprotocol/sdk + zod
Then in your client config:
{
"mcpServers": {
"zhiji-memory": {
"command": "node",
"args": ["/absolute/path/to/zhiji-mcp/zhiji-mcp-server.mjs"],
"env": {
"MB_BASE_URL": "https://ai-know.me",
"MB_API_KEY": "mb-yourKey"
}
}
}
}
Verify
# visual debugger — should list 9 tools / 2 resources / 1 prompt
npx @modelcontextprotocol/inspector node zhiji-mcp-server.mjs
Full client matrix (LangChain, OpenAI Agents SDK, Coze…) is in MCP-USAGE.md.
Architecture — a stateless thin bridge
MCP client ──stdio / HTTP(JSON-RPC)──► zhiji-mcp-*.mjs ──REST──► Zhiji backend (ai-know.me)
The MCP layer stores nothing; it translates MCP tool calls into REST calls to the Zhiji backend. Shared core zhiji-mcp-core.mjs backs both entry points:
| File | Role |
|---|---|
zhiji-mcp-core.mjs |
Tool/resource/prompt definitions (single source of truth) |
zhiji-mcp-server.mjs |
stdio entry (npm start) |
zhiji-mcp-http.mjs |
Streamable HTTP entry (npm run http) |
Isolation & auth
- All data is hard-isolated by
userEmail. The bridge treatsuserEmailas a namespace, not a credential. - The hosted public endpoint requires an agent Key — requests without
Bearer mb-…get 401; the backend binds each Key to its userEmail and rejects cross-user access. - Never hand a key-less, userEmail-swappable bridge to end users — front it with your own backend that injects the correct userEmail. See
MCP-USAGE.md §8.
Environment
| Var | Default | Notes |
|---|---|---|
MB_BASE_URL |
http://localhost:3001 |
Zhiji backend address; for the hosted service use https://ai-know.me |
MB_USER_EMAIL |
— | default user namespace (single-user local use) |
MB_API_KEY |
— | mb- agent Key; forwarded as Bearer |
MB_TIMEOUT_MS |
60000 |
slow workspace routes can take ~15s |
Status
| Version | Highlights |
|---|---|
| v0.4 | zhiji_ingest_file (9 tools) + public-release hardening (TLS, MCP_REQUIRE_KEY, JWT-only key issuance, cross-user isolation hard-test) |
| v0.5 (planned) | inference-list tool, resource subscriptions, fine-grained key permissions |
Docs
MCP-USAGE.md— full guide (install, all clients, per-tool reference, troubleshooting, FAQ)demo-guide.md— demo video recording guide- Online: https://ai-know.me/mcp
License
MIT © 2026 知己 AI (ai-know.me)
知己 AI · MCP integration — Chinese-first brain-inspired memory. The bridge is open; the memory intelligence lives in the Zhiji backend.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。