Zifu Memory
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Zifu Memory Remember that the Q3 planning meeting is on July 15."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
紫府 · Zifu Memory
Verifiable, replayable, scope-aware memory service for AI agents — via MCP.
Most agent memory systems are editable notebooks: an LLM pipeline rewrites memories (add / update / delete) and the previous state is gone. Zifu Memory is an auditable chronicle: an append-only event stream with fingerprinted snapshots, replay to any point in time, contract-governed facts, and scope-based access control.
Three pillars
Persistent — append-only event stream as the source of truth; nothing is silently rewritten.
Replayable — rebuild the full state at any timestamp from snapshots plus the event stream; every fact carries a source pointer and fingerprint.
Cross-session, cross-node — scoped memory (session / user / agent / org) with session handoff and resume packs; sync-ready for federated nodes.
Related MCP server: strata
Install
pip install zifu-memoryWire into your MCP client
{
"mcpServers": {
"zifu": { "command": "zifu-mcp", "args": [] }
}
}Data directory: set ZIFU_HOME (defaults to ~/.zifu).
Tools (17)
Tool | What it does |
| Append a memory (passes the fail-closed gate: credentials / OTPs / phone / ID numbers are rejected) and return a source pointer |
| Keyword lookup (entity-level digest) |
| Semantic search (pluggable embedder; zero-dependency char-bigram core by default) |
| Keyword + semantic merged search |
| Time-window event stream reader |
| Current state |
| Rebuild state at any timestamp (verifiable) |
| Pack a cold backup |
| Tiered retention report (7d fine / 90d hourly / older: ledger + fingerprints) |
| Contract 1+2: register a fact with a source pointer; duplicate IDs are deterministic errors |
| Contract 2: revise a fact, history preserved |
| Retire a fact (mark only, never delete) |
| List the fact ledger |
| Contract 3: deterministic context packing under a hard budget |
| Contract 5: consistent view (state + active facts at a timestamp) |
| End-of-session handoff summary (session-boundary free) |
| New-session resume pack (handoffs first, then facts, then recent events) |
The five contracts
Source pointer first — every registered fact must point to a resolvable event (file + timestamp + fingerprint).
Duplicate IDs are errors — revising goes through
replace, history kept.Hard injection budget — context assembly is deterministic and reproducible.
Idempotent replay — replaying the ledger any number of times yields the same state.
Consistent views — fork a consistent snapshot of state + facts at any time.
Scope model (fail-closed)
session < user < agent < orgWriters tag memories with a scope; readers declare their identity. Without an
identity you only see org-level memories. Legacy data defaults to org.
Design notes
Zero-dependency core (standard library only); the MCP shell needs
mcp>=1.0,<2.The semantic layer is a pluggable slot: the default char-bigram TF-IDF core works offline; swap in a real embedding model without changing the retrieval logic.
Forgetting is tiered, not deleted: fine-grained snapshots for 7 days, hourly snapshots for 90 days, event ledger + fingerprints forever.
License
Apache-2.0
Available Tools
17 toolszifu_assertA
契约1+2:带来源指针登记事实(指针来自 zifu_write 的返回)。同 ID 重复登记是确定性错误;改口走 zifu_replace。
Inputs: entity (required), fact_id (required), pointer (required), statement (required). Returns: result
zifu_eventsA
按时间窗顺序读事件流(正本)。reader 自报身份按分级读取;缺省只读 org 级。
Inputs: reader, since_ts, until_ts. Returns: result
zifu_exportB
打包冷备(供后续推魔搭私有仓)。
Inputs: no named parameters. Returns: result
zifu_factsA
列事实账本(status: active/replaced/retired,缺省全部)。
Inputs: status. Returns: result
zifu_handoffB
会话收尾:写交接摘要(会话边界无关,供后续会话接续)。scope 不能是 session 级。
Inputs: summary (required), session_id (required), scope, entity, +2 more. Returns: result
zifu_hybridB
混合检索:关键词命中 + 文义 top-k 合并去重。reader 自报身份按分级读取。
Inputs: query (required), top_k, reader. Returns: result
zifu_injectC
契约3:硬预算装配上下文(字符预算,确定性结果,可复算)。query 提供时按文义相关性排序。
Inputs: query, budget. Returns: result
zifu_replaceB
契约2:改口走 replace,旧事实标记 replaced 并留痕,历史不删。
Inputs: entity (required), old_id (required), reason (required), new_statement (required). Returns: result
zifu_replayA
从最近快照+事件流重建指定时刻状态(可核验)。at_ts 缺省为当前时刻。
Inputs: at_ts. Returns: result
zifu_resumeA
新会话开场:拉接续包——可见交接摘要优先+active 事实+近期可见事件,硬预算内确定性装配。 reader 自报身份(session_id/agent_id/user_id);无身份只给 org 级(fail-closed)。
Inputs: reader (required), budget, recent_limit. Returns: result
zifu_retentionB
分层保留报告(7天细粒度/90天整点/更久只留事件册与指纹)。
Inputs: no named parameters. Returns: result
zifu_retireB
事实退役:只标记不删除(账本只追加)。
Inputs: reason (required), fact_id (required). Returns: result
zifu_searchB
按关键词精确检索记忆(实体级汇总)。reader 自报身份按分级读取;缺省只读 org 级。
Inputs: keyword (required), reader. Returns: result
zifu_semanticB
文义检索:按意思找记忆(字符二元文义匹配,可插拔向量芯)。reader 自报身份按分级读取。
Inputs: query (required), top_k, reader. Returns: result
zifu_stateC
当前记忆状态。
Inputs: no named parameters. Returns: result
zifu_viewC
契约5:一致视图——该时刻状态重建 + 当时仍有效的事实。
Inputs: at_ts. Returns: result
zifu_writeA
写入一条经验记忆。source: internal=体系内部动作(正本完整) / external=外部观测(采样带证据)。 scope 分级: org=人人可读(缺省) / agent=仅该agent / user=仅该user名下 / session=仅该会话。 写入前过紫府闸。返回事件与来源指针(契约1:来源指针先行)。
Inputs: kind (required), entity (required), payload (required), scope, +4 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
The retrieval trio (zifu_search / zifu_semantic / zifu_hybrid) is clearly delineated, and the fact-ledger ops (assert/replace/retire) are well separated. However zifu_write vs zifu_assert overlap (raw experience vs pointer-bearing fact), and zifu_state ("current memory state") is vague next to zifu_facts, zifu_events and zifu_view, making misselection plausible.
All 17 tools share the zifu_ prefix and snake_case, which is highly predictable. The only deviation is grammatical: some names are verbs (write, search, assert, replace, retire, inject, replay) while others are nouns (facts, events, state, retention, handoff) or adjectives (semantic, hybrid).
17 tools is on the heavy side but each maps to a concrete lifecycle stage of a memory system (ingest, three retrieval modes, ledger mutation, context assembly, session handoff/resume, maintenance). Nothing looks redundant enough to cut outright, though the three retrieval variants could arguably be collapsed into one parameterized tool.
Coverage is broad: ingest, retrieval, fact correction via replace/retire, budgeted context assembly (inject/resume), point-in-time reconstruction (view/replay), export and retention. The notable gap is that experience memories written by zifu_write have no update or correction path — only facts can be replaced — and there is no explicit delete/purge (deliberate append-only, but agents may hit that dead end).
Maintenance
Related MCP Connectors
Verified memory for AI agents. Signed assertions, billing attestation, session continuity.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Governed local-first memory and continuity for AI agents — signed receipts, optional hosted lane.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.14-
- AlicenseNot gradedqualityCmaintenanceEnables agents to read and write a durable, append-only memory with verified provenance, supporting search, record capture, and context preparation across sessions and machines.1MIT
- AlicenseAqualityCmaintenanceGives AI agents private, persistent, semantically searchable long-term memory with RAG, governed multi-agent scopes, and real-time memory-change subscriptions.2427MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to maintain persistent memory across sessions with verifiable source receipts, supporting explicit remember, recall, inspect, correct, and forget operations.58Apache 2.0