
Piia Engram
io.github.Patdolitse由 GitHub 帳號 Patdolitse 發布v4.27.0更新於 Nov 1, 2026
Local-first AI identity for MCP coding tools. Lessons, decisions, and context you control.
發布方自己的服務:Engram
概覽
本地優先的 AI 身分層,讓多個程式開發助理從你自己擁有的檔案共享偏好、經驗、決策與專案脈絡。
- 可以做什麼
- 在對話開始時載入並召回身分、近期活動與相關知識,可控制 token 預算
- 儲存與檢索經驗教訓、決策和操作手冊,並查看單一項目的修訂歷史
- 提出身分、偏好與品質標準變更以供本機審閱,並匯出 Markdown 身分卡
- 儲存與讀取專案快照,並在對話結束時保存重點
- 啟用完整工具面後可執行治理、管理與整合類工具
- 適用情境
- 適合在多個支援 MCP 的程式開發工具之間切換、希望用一份可檢查的本機層統一偏好、品質標準與過去決策的人。也適合想審閱並核准助理記錄了自己哪些內容的使用者。
- 執行需求
- 以 Python 套件形式透過 stdio 在本機執行(pip install piia-engram,或用 uvx 免預先安裝);安裝精靈會寫入 MCP 用戶端設定。資料存放在自選的本機目錄,例如 ~/.engram。選用環境變數:ENGRAM_TOOLS(預設核心工具面,設為 all 啟用全部)、PYTHONIOENCODING(Windows 主控台強制 UTF-8)。不需雲端帳號,未宣告驗證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Piia Engram,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Piia Engram
Local-first AI work identity you can see, edit, and override — portable across your MCP coding tools.
Tell AI once who you are, how you work, and what "good" means. Claude Code, Codex, Cursor, Windsurf, and other MCP-compatible tools can start from the same AI work identity layer — local files you own, no cloud account, no hidden memory you cannot inspect.
Install · See It in Action · Supported Tools · MCP Tools · FAQ
[PyPI] [Downloads] [Python 3.10+] [MCP Compatible] [License: AGPL v3] [CI] [Guard strategic files]
Listed in: [Official MCP Registry] [awesome-mcp-servers] [Glama]
Also listed in: awesome-agents · Awesome-MCP-ZH · mcpservers.org · Cursor Directory · ModelScope · PulseMCP
TL;DR: piia-engram is a local-first personal AI identity layer. It helps multiple coding agents start from the same understanding of you: your preferences, quality bar, lessons learned, decisions, and project context. It is not an agent memory database; it is the user-owned layer above your tools.
Why not just use native memory? Claude Code, Codex, Cursor, and Windsurf are adding their own memories and rules. Those are useful, but they are scoped to one tool or workspace. piia-engram gives you one portable identity layer above them: local files you own, AI-proposed knowledge you review, and context that can follow you across tools.
Trust model in four lines:
- No cloud account: install with
pip, keep the core store on your machine. - Local files: identity and knowledge live under
~/.engram/as JSON/Markdown. - User approval: AI writes locally; high-risk items (credentials, shell commands, MCP config, permission rules) wait for your review, while low/medium writes are auto-absorbed but fully auditable and reversible. Set
ENGRAM_APPROVAL=strictto gate every write. "Verified" means accepted by you or by that policy, not re-checked against your current code. - Session continuity: Resume output can also include earlier session records (checkpoints and snapshots) that are not reviewed and do not authorize actions. Approval and review claims apply to identity and long-term knowledge under the configured policy.
- Documented boundaries: see Trust model, Privacy, and Security.
Want proof? See the live cross-tool continuity proof — a memory written by Claude Code, read back by Codex through one local store — or the one-command reproducible code demo.
See It in Action
And you never have to take that on faith — Memory Lens (engram preview --html) shows exactly what any AI caller would receive, and what governance withheld, before anything is sent:
Above: a real report from a demo store — 4 items exposed; an unreviewed staging note and a lesson containing a credential are withheld, with the secret shown as [REDACTED].
Install
The wizard auto-detects your AI tools — Claude Code, Cursor, Codex, Claude Desktop — lists the exact config files it will touch, and writes the MCP connection after a one-keystroke confirm (every write is backed up first; decline and nothing changes). It previews your identity card, then you restart your configured tool; the first conversation can load your approved identity and long-term knowledge through startup or search tools. (full walkthrough ↓)
Let your AI agent install it
Ask your coding agent to install Engram and inspect the plan before applying:
Setup asks no questions. Use --clients cursor,codex to limit clients and
--lang zh|en for output language (default en). Without --apply, plan mode
writes nothing to the Engram store, home directory or client configs. Python
itself may use the system temporary directory. Apply configures MCP connections
with backups, preserves existing tool modes, and never imports memories, writes
identity/knowledge, or approves proposals. Restart configured clients; exit code
1 means a manual step remains. See llms.txt for agent instructions and
the CLI and JSON contract for details.
Supported Tools
Evidence levels follow the agent client validation runbook: L0 = discovery, L1 = protocol access, L2 = read/search behavior, L3 = A/B behavior gain, L4 = cross-client continuity, L5 = reproducible public evidence.
By the numbers
These are current repository facts from docs/public-facts.json. Public registries and package badges update only during release/publish.
Your AI forgets you every time you switch tools or start a new chat. piia-engram fixes the handoff.
Every time you open a new chat window, switch from Claude Code to Codex, update your AI tool, or move into a different project, you're back to zero:
- your communication preferences — gone
- your code standards and quality bar — forgotten
- which mistakes you've already learned from — lost
- why you made that architecture decision last month — erased
This happens because AI memory today is locked inside each platform. It belongs to the tool, not to you. The tool updates, resets, or gets replaced — and your context disappears with it.
piia-engram gives you a personal identity layer that lives on your machine, independent of any AI tool. You tell it once who you are, how you work, and what you've learned. MCP-compatible tools can read the same approved identity and long-term knowledge. New chat, new tool, new version — your identity stays portable.
piia-engram is not an agent memory database. Tools like Mem0, Zep, and Letta store task context and session history for AI agents. piia-engram stores who you are as a person — your identity, preferences, hard-won lessons, and key decisions. It's a different layer: not what happened in a task, but who is behind every task.
Why piia-engram?
Who Uses piia-engram
piia-engram is built for developers who use multiple AI coding tools and are tired of re-explaining themselves.
If you switch between Claude Code, Codex, and Cursor — your code standards, architecture decisions, and hard-won lessons reset every time. piia-engram makes every tool start from the same understanding of who you are.
If you open 10+ AI chat windows a week — each one starts from zero. piia-engram lets each conversation start from the same approved identity and knowledge context.
If you've lost preferences after a tool update — your identity lives on your machine, not inside any platform. Updates, resets, and migrations don't touch your memory.
Other use cases
Investment analysts Decisions get made but reasoning gets lost. piia-engram stores the full reasoning chain so six months later, "why did I pass on that?" has a real answer — and your analytical framework travels with you across every new analysis.
System architects Architecture decisions need context: what you chose, what you ruled out, and why. piia-engram keeps living Architecture Decision Records that travel with you across companies and projects, queryable by any AI tool.
Backend developers API quirks, integration gotchas, performance trade-offs — tacit knowledge that normally lives in your head and resets when you change jobs. piia-engram turns it into a searchable library that persists across everything.
Frontend and design Design philosophy rarely gets documented in a way AI tools can use. piia-engram stores your real standards, UX lessons from real users, and the reasoning behind component decisions — so every project starts where your last one ended.
Vibe coders You build with AI and move fast. The problem: every new session your AI starts from scratch — different style choices, inconsistent patterns, re-explaining the same preferences. piia-engram makes every tool consistent from session one: your stack, your patterns, your voice, already there.
What piia-engram Stores
All data lives under ~/.engram/ as plain JSON and Markdown files you can open, edit, back up, or migrate yourself.
- Identity: who you are, how you communicate, what languages you prefer
- Quality standards: your code review bar, test coverage expectations, what you refuse to ship
- Preferences: coding style, AI behavior, how you like explanations
- Trust boundaries: which fields to keep private, what tools can access
- Project snapshots: context for ongoing work, captured and reloadable
- Lessons learned: mistakes, surprises, things that worked and didn't
- Key decisions: what you chose, what you ruled out, and why
- Domain knowledge: reusable insights across projects and tools
What piia-engram Does (Beyond Storage)
Most memory tools are passive — you put things in, they give them back. piia-engram is also active.
Knowledge inheritance across projects
Describe a new project in plain text. get_knowledge_inheritance returns a curated starter pack of the most relevant lessons and decisions from everything you have ever worked on. Your tenth project benefits from all nine before it — one tool call away.
Passive knowledge capture
Paste a session summary into extract_session_insights and piia-engram extracts and stores the lessons and decisions. No manual note-taking. Knowledge accumulates through normal AI conversations.
Works with tools that do not support MCP
ChatGPT, Gemini, Kimi — get_identity_card exports a ready-to-paste Markdown identity card. Your context travels even to tools that cannot connect directly.
Automatic playbook extraction
Finish a multi-step workflow — release to PyPI, deploy to Cloudflare, publish to MCP Registry — and piia-engram detects it at session end. It generates a structured draft playbook (steps, pitfalls, trigger keywords) and saves it to a staging area. Next time you do the same task, the AI can retrieve the confirmed playbook as a passive reference, walk through the steps with you, and record the outcome. No manual recording required — Engram starts the draft, you confirm, the host AI stays accountable. See Playbook Auto-Extraction below.
Local tools registry
AI tools constantly search for local programs, runtimes, and CLIs. register_tool records what's installed and where; find_tool retrieves it instantly. No more which python every session — the environment map persists across tools and conversations.
Knowledge health and discovery
get_knowledge_overview surfaces stale lessons (not reviewed in 30+ days), computes a 0–100 health score across four dimensions (freshness, quality, coverage, cleanliness), and flags gaps worth revisiting. explore_knowledge scans your knowledge base for near-duplicates (and walks related/similar items) with actionable merge commands. manage_relation connects related lessons and decisions into a navigable knowledge graph.
Hybrid search (optional, off by default)
The default keyword search stays unchanged. Opt in to hybrid retrieval — FTS5 full-text plus a semantic vector layer — for cross-lingual recall, e.g. an English query finding a Chinese note: pip install "piia-engram[vector]" and set ENGRAM_SEARCH=hybrid, or let engram setup enable it with one keystroke. The index is a rebuildable SQLite file; your JSON store remains the single source of truth. See docs/hybrid-search.md.
Quick Start
New to piia-engram? See the fuller first-value quickstart for the install -> first memory -> fresh-session recall path using only the default 19 core tools, or the complete User Guide covering install -> first value -> cross-tool continuity -> governance -> privacy -> FAQ. Host-specific setup cards are available for Claude Code, Codex, and Cursor. For proposal-only safe-context, replay, freshness/conflict, and evidence drafts, see Context governance.
The setup wizard will:
- Detect your Python environment
- Let you choose the Engram data folder (
~/.engram, another drive, or a custom path) - Detect your AI tools, list the exact config files it will touch, and write the MCP connection after a one-keystroke confirm (backed up first; decline leaves them untouched)
- Walk you through seed knowledge (role, tech stack, language)
- Offer to import rules and memories from your other AI tools —
CLAUDE.md,.cursorrules, memory files (default no; lists them first, then the review queue, approve withengram review) - Show a short daily usage ping notice; neither setup mode asks about telemetry or changes your choices
- Preview your AI identity card — immediate proof of value
After setup writes the MCP connection (you confirm at the prompt first), restart your AI tool. Many clients can call get_user_context at startup; when a host does not do that proactively, an explicit search_knowledge or get_resume_brief call is still the expected L2 path.
For non-interactive or CI runs, skip the confirmation prompt and write directly:
Either way, every external config write is backed up under the selected Engram data folder, and declining the prompt leaves every external config untouched.
For point-and-click local review, open piia-engram-review (double-click its installed Windows launcher). Review complete proposals and choose approve, reject or later, with optional body-free prompts while the window is running. Python with Tk support is required; MCP approval permissions stay unchanged. See the local review window guide.
Check health anytime:
engram continuity is metadata-only: it reports saved-session counts, contributing tools, resume-brief readiness, and aggregate context-load / wrap-up signals without printing memory bodies, raw telemetry events, session IDs, or local paths.
For a machine-readable synthetic loop proof, run:
engram continuity reports readiness metadata. The demo JSON proves an isolated write -> resume -> search -> provenance loop using synthetic data only.
Replay experience mode
Automated offline and online evaluation callers can use IsolatedStore.admit(..., event_key="source:event:record:v1") in either isolated mode to distinguish events with identical text and retry the same event safely. Recall returns a ledger-backed receipt with a snapshot identifier, ordered IDs, content hashes and effective filters; verify_recall_receipt reports later changes without bodies. Replay callers may also supply effective_at and now to retire/restore at historical times. An Owner veto hides a card at every time.
Pin the isolated store API with from piia_engram.isolated_store import require_contract; require_contract("1") before opening a store. Contract v1 supports admit(..., supersedes=item_id) to admit a replacement and deactivate its predecessor in one completion receipt, with crash-safe retries in both modes. Family, subject and the exact opaque source_decision_point must match. An active version blocks restoration of another version; rollback appends a new version. Recall also returns and seals a deterministic result_sha256 over effective cuts, exclusion counts and ordered content references. Incompatible changes require a new contract version, with continued support or contract_version_unsupported; existing ledgers remain readable.
Offline replays and evaluations that re-feed historical material in chronological order can initialize an isolated store with "mode": "replay_experience" in its launcher configuration. The root mode is immutable. Admission requires timezone-aware admitted_before and now parameters; recall also requires now. Historical admission uses the supplied time while receipts keep real timestamps, and automatic same-family exclusion is disabled. Evidence still stops at the decision point's as_of. Replay admission keeps nonidentical normalized summaries verified even when template similarity is high; exact duplicates and existing tombstone, retired and archived twin rules still apply. Without event keys, production duplicate handling is unchanged; all capacity limits still apply. Replay roots may pin hard_cap up to 10,000 (for example, 1,400); production roots retain the 1,000 default. Native backups and returned entries carry store_mode: replay_experience, and ordinary roots refuse replay roots and marked imports.
The separation prevents accidental mixing, such as using the wrong configuration, attaching another root, or importing an unmarked export. New initialization receipts are bound to the directory identity, and context text retains its replay marker. This is not a tamper-proof boundary against someone who can edit both roots and their ledgers. Existing production roots created before replay mode retain direct attachment without launcher configuration.
For broader release evidence, run the synthetic MCIC benchmark:
MCIC v1 contains 10 purpose-labeled continuity scenarios covering explicit recall, implicit personalization signals, false-premise guard signals, public action boundaries, version-chain HEAD selection, negative control, and provenance. Its claim is narrow: Engram makes the right signal available to the next client; live model compliance still needs separate A/B testing.
Trust & Evidence
piia-engram treats trust claims as release artifacts, not marketing copy:
Verify it yourself (5 minutes)
Don't take the table above on faith — run the checks on your own machine:
- Check your setup —
engram doctorreports detected tools, store health, and the active capability mode. - See what AI sees —
engram preview --as automationrenders the exact context a caller would receive (read-only, nothing sent). - Control the surface — set
ENGRAM_TOOLS=core(or compose groups) and re-runengram doctorto confirm it reports the expected core surface. See capability modes. - Audit your data — follow the data sovereignty audit runbook to confirm identity and knowledge data stays under your Engram root, with external writes explicit and audited.
- Check the claims — each trust claim in trust evidence maps to a deterministic check or inspection path you can run locally.
Configure for Your AI Tool
The snippets use the server name engram, the name engram setup writes. An
entry named piia-engram (from earlier instructions) is still recognised, and
setup moves it to engram after backing up the file instead of adding a second
server.
Claude Code
Setup registers Engram through the claude command into Claude Code's user
config (~/.claude.json, or $CLAUDE_CONFIG_DIR/.claude.json); it never edits
that file itself. If claude is not on your PATH, setup prints the exact
command to run. The values passed with -e appear on the claude process
command line while it runs. Engram also recognises an entry named piia-engram
from earlier instructions. Setup versions before this fix wrote to
~/.claude/.mcp.json, which Claude Code does not read: run engram setup
again to register in the right place (it offers to remove the old entry).
Cursor
Add to ~/.cursor/mcp.json:
Compatible fallback if console scripts are not on PATH:
Codex (OpenAI)
Add to ~/.codex/config.toml (the file engram setup writes for Codex):
Plugin manifest note (Codex CLI 0.130.0+): piia-engram ships a
.claude-plugin/plugin.jsonwhose schema is also recognized by Codex CLI. Native one-command plugin install via Codex's marketplace flow isn't supported yet (Codex expects a multi-plugin marketplace manifest at the repo root, which would conflict with the single-plugin manifest used by other tools). For now, configure Codex via the~/.codex/config.tomlsnippet above — it's the supported path and works on every Codex version.
Claude Desktop
Add to claude_desktop_config.json (Windows: %APPDATA%\Claude\; macOS: ~/Library/Application Support/Claude/):
Windsurf / Copilot / Cline / Other MCP clients
Any tool that supports MCP over stdio works. Use this config:
For tools without MCP support (ChatGPT, Gemini, Kimi): run get_identity_card in any MCP tool and paste the exported Markdown card into your chat.
Domestic AI IDEs — Trae / CodeBuddy / Tongyi Lingma / Comate / Qoder
engram setup detects Trae (~/.trae/mcp.json) and Tencent CodeBuddy (~/.codebuddy/mcp.json) without changing those files by default. To let Engram write those standard mcpServers files for you, run engram setup --apply-external-config; the previous file is backed up under your selected Engram data folder first.
Tongyi Lingma (通义灵码), Baidu Comate (文心快码), and Qoder manage MCP servers through their in-app MCP panel (or a project-level config), so the wizard can't write them for you. Open the tool's MCP settings and paste:
Zero-install alternative (no prior pip install needed) — set "command": "uvx" and "args": ["--from", "piia-engram", "piia-engram-mcp"]. They all speak the same standard MCP-over-stdio protocol.
Verify your setup
After setup, run engram doctor to verify everything is connected:
For machine-readable compatibility checks, run engram capabilities --json.
It reports stable capability codes and contract versions without reading user
memory or project content; MCP doctor(output_format="json") includes the same
fingerprint.
Upgrading
After upgrading, piia-engram automatically migrates any stale MCP configs the next time its server starts (stdio mode). If your AI tool still shows an "MCP disconnected" error after restarting, run:
Then restart the affected AI tool. The doctor command checks Claude Code, Cursor, Codex, Windsurf, Claude Desktop, and community-supported MCP config locations, removes outdated server entries, and prints a metadata-only config integrity summary.
Remote Deployment
Run piia-engram on your own server and connect from anywhere.
Server Setup
Client Config (Claude Code)
Client Config (Cursor)
Security notes:
- Always use HTTPS in production, behind nginx or caddy with TLS.
- The auth token protects your identity data. Keep it secret.
- Default bind is
127.0.0.1for localhost only. Use0.0.0.0only behind a reverse proxy. - Set
ENGRAM_CORS_ORIGINSto restrict cross-origin access (e.g.https://your-domain.com). - Data stays on your server and never touches third-party clouds.
MCP Tools
piia-engram ships 59 MCP tools. By default, only the 19 Tier-1 Core tools are loaded to keep the AI's context clean. Core means "used in most sessions", not "read-only": some core tools write local memory or owner-gated export files, and the governance layer still gates those side effects. Each tool also carries standard MCP hints (read-only, destructive, idempotent, open-world) for the client; they are advice, not access control, which stays with strict mode and governance. For the short operator view, see the MCP cheatsheet. To unlock all 59 tools, add ENGRAM_TOOLS=all to your MCP config:
You can also expose composable capability modes such as knowledge management, governance, admin, or integrations; see the capability modes guide.
Importing from other AI tools: Engram never reads other AI tools' memory or rule files on its own: not at server start, not on cold start, not at session end. Run engram import-memories to bring them in; it lists what it found first (--dry-run stops there), then adds them to the review queue after you confirm, and writes a receipt to import_receipts/ in the store. ENGRAM_MCP_STARTUP_SYNC is still accepted but no longer does anything; ENGRAM_RECONCILE=0 turns reading other AI tools' files off entirely. ENGRAM_EPHEMERAL=1 skips the startup config check in container/ephemeral clients.
MCP startup never imports other tools' memories or changes knowledge or identity content. Startup and read tools may still write session checkpoints, usage records, audit records and access metadata; they are not zero-write operations.
Tier-1 Core (19 tools — daily workflow)
Tier-2 Advanced (40 tools — knowledge management, review, governance, import/export)
Advanced tools include optional local integrations, owner/admin surfaces, and maintenance helpers. Tools that export files, import whole stores, generate review pages, or mutate caller trust are owner/admin/export surfaces even when they are broadly useful product capabilities. Related operations are consolidated into single tools with a mode/action selector (v4.0).
Click to expand full tool list
Legacy Playbook scope migration (classify / apply / rollback / review queue) moved out of the MCP surface into the owner-only local CLI: engram playbook scope classify|apply|rollback|queue|resolve (previews by default; writes require --apply --yes).
Playbook Auto-Extraction
piia-engram can detect multi-step workflows you complete during a session and automatically draft structured playbooks — no manual recording required.
How It Works
- Detection — When you call
wrap_up_sessionorsave_agent_context, piia-engram scans for procedural workflow signals: checkpoint steps, action verbs, and trigger keywords. - Draft generation — If a workflow is detected, a playbook draft is created with steps, pitfalls, trigger keywords, and preconditions. Sensitive information (API keys, tokens, absolute paths) is automatically redacted before storage.
- Staging — The draft is saved to a staging area, never auto-promoted to verified. You review and confirm before it becomes a trusted playbook.
- Schema contract — Stored playbooks are normalized into a versioned contract: trigger keywords, preconditions, pitfalls, structured steps, and optional
required_toolsdeclarations. Thin drafts remain reviewable, but carry machine-readable quality warnings. - Tool resolution — Playbooks declare tool needs by name or purpose, while local paths stay in the tools registry.
playbook_execution(actionprepare) returnsresolved_tools,tools_ready, andmissing_toolsat runtime so the host AI can see which local tools are available without storing resolved paths in the Playbook. - Reuse and outcome — Next time an AI tool encounters a similar task,
search_knowledgematches the trigger keywords and returns the playbook as a passive reference. The host AI walks through the steps with you andplaybook_execution(actionstatus) reports an outcome rollup (pending,partial,succeeded, orfailed) instead of treating skipped steps as silent success.
Design Philosophy: Engram Starts, You Confirm, AI Applies
Playbook auto-extraction is not fully automatic. piia-engram detects the workflow and generates a rough draft — but the draft stays in staging until you explicitly confirm it. Once confirmed, AI tools can use the playbook as a governed, passive reference and record step outcomes; Engram does not silently execute the workflow for them. This keeps humans in the loop for quality control while eliminating the manual work of writing operational procedures.
Confidence Levels
Sensitive Info Redaction
Before any draft is stored, piia-engram automatically redacts:
- API keys and tokens (
Bearer,sk-,ghp_, etc.) - Absolute file paths (Windows and Unix)
- Email addresses
- Environment variable secrets
Kill Switch
Users can disable or re-enable playbook auto-extraction at any time:
- Disable: Tell your AI "关闭 playbook" / "stop playbook" / "disable playbook auto-extraction"
- Enable: Tell your AI "开启 playbook" / "start playbook" / "enable playbook auto-extraction"
The AI can propose a playbook_auto_extract change with update_identity(field="preferences", ...); it takes effect only after you approve it locally with engram review. Default is enabled.
Manual Playbook Creation
You can always create playbooks manually with add_playbook, regardless of the auto-extraction setting. The kill switch only affects automatic detection during wrap_up_session.
Data Layout
Own & export your data
Everything lives in local JSON you own — inspect, edit, back up, or delete it directly. Three explicit export paths, each with a different boundary:
Exports are owner-gated when ENGRAM_GOVERNANCE=1 (see
docs/governance.md). There is no cloud copy and no hidden memory:
what you export is exactly what is on your disk.
Storage limits. Reviewed memories are never moved out because the store is
full; unreviewed ones wait in a review queue for at least 7 days, and anything
moved out goes to an append-only overflow archive you can restore from
(engram retention plan shows the counts, engram retention restore <id>
brings an entry back).
Local data sovereignty. Backup and restore cover only the Engram directory
— engram backup-plan prints a metadata-only list of what to copy before an
upgrade (it reads no stored knowledge bodies and never reaches outside the
Engram root). For JSON backups, import_engram(..., dry_run=True) or
engram import <backup.json> returns a metadata-only merge plan with
add/skip/conflict counts before any write; applying it is local only:
engram import <backup.json> --apply --yes (over MCP, import_engram only previews). Same-summary lessons and same-question decisions with divergent
semantic fields are previewed as version-chain candidates; they are materialized
only when the owner explicitly runs
engram import <backup.json> --apply --yes --materialize-version-chain. Engram
never backs up, modifies, or deletes files in your project folders.
See docs/runbooks/setup-upgrade-safety.md.
Comparison
📊 For the full side-by-side, including when to choose a competitor over piia-engram, see docs/comparison.md.
Built With
piia-engram is a human-directed, AI-assisted open-source project.
FAQ
What MCP server lets me share memory between Claude Code and Cursor?
piia-engram. Install with pip install piia-engram && engram setup, and both tools read the same identity, preferences, and lessons from ~/.engram/. No cloud, no sync service — they both read local JSON files through MCP.
What is piia-engram? piia-engram is a local-first AI work identity layer for MCP-compatible coding tools. It stores your identity, preferences, code standards, lessons learned, and key decisions as local JSON files on your machine. Configured tools (Claude Code, Codex, Cursor, Windsurf, Claude Desktop) can read the same user-owned context, so new chats and tool switches can start from the same governed memory and identity base.
How is piia-engram different from the official MCP memory server?
The official @modelcontextprotocol/server-memory stores a generic knowledge graph of entities and relations. piia-engram is specialized for developer identity: it has structured fields for your profile, code standards, quality bar, lessons learned, and key decisions — plus 59 tools for knowledge lifecycle management (search, review, merge, inherit across projects). If you need general-purpose entity memory, use the official server. If you want MCP-compatible coding tools to start from the same approved understanding of your preferences and past mistakes, use piia-engram.
How is piia-engram different from agent memory tools like Mem0, Zep, or Letta? Those tools store task context and session history for AI agents — what happened during a workflow. piia-engram stores who you are as a person — your identity, preferences, hard-won lessons, and key decisions. It's a different layer: identity persists across tools, sessions, and projects, while task memory is scoped to a single agent run. Your data is local JSON files you own and can edit directly.
Why not just use AGENTS.md / CLAUDE.md / .cursorrules? Those config files are great for repo-specific rules (build steps, coding conventions). piia-engram is for you — your preferences, lessons, and decisions that can follow you across repos and configured MCP-compatible tools. They complement each other: use AGENTS.md for the project, piia-engram for the person. See the full comparison in docs/comparison.md.
Can I use piia-engram with multiple AI tools at once?
Yes. That's the primary use case. piia-engram uses local file storage (~/.engram/) with atomic writes and file locking. Claude Code, Cursor, Codex, and any other MCP client can connect simultaneously. A lesson recorded in Claude Code is immediately available in Cursor.
Which AI tools does piia-engram support?
Any MCP-compatible tool: Claude Code, OpenAI Codex, Cursor, Claude Desktop, Windsurf, GitHub Copilot, Cline, Roo Code, Amazon Q, Augment, Zed, and more. For tools without MCP support (ChatGPT, Gemini, Kimi), export a Markdown identity card with get_identity_card and paste it in.
Where is my data stored?
All data lives in ~/.engram/ on your local machine as plain JSON and Markdown files. No cloud, no account, no subscription. You can open, edit, back up, or migrate the files yourself. Optional AES-256-GCM encryption is available via pip install piia-engram[secure].
How do I install piia-engram?
The setup wizard detects your AI tools without changing their config files by default. To auto-configure MCP entries with backups, run engram setup --apply-external-config, then restart your AI tool. The AI will call get_user_context at the start of each session.
After upgrading, my AI tool shows "MCP server disconnected". How do I fix it?
Run engram doctor --fix in a terminal, then restart your AI tool. This command scans all known MCP config files, removes outdated server entries, and repairs broken paths in one step.
Does piia-engram send data to the cloud?
Your memories never leave your machine. Engram sends one anonymous usage ping a day by default (random install ID, version, OS, Python version, AI client name, date). No content, prompts or file paths are sent; IP addresses are not stored. Turn it off with engram telemetry off, ENGRAM_TELEMETRY=0 or DO_NOT_TRACK=1 (it is off in CI and in containers); engram telemetry preview shows the exact payload. Setup shows an informational notice without asking about telemetry. Detailed statistics stay off unless explicitly enabled with engram telemetry on; remote sending (engram telemetry remote on) and weekly feedback (engram telemetry feedback on) require separate opt-ins. Setup preserves existing choices. See PRIVACY.md.
How many MCP tools does piia-engram provide? Two tiers, designed so most users only see 19 tools:
Most users never need to enable Advanced tools — Core covers everyday use.
Is piia-engram free? Yes. The open-source core is free software under AGPL-3.0. Personal/local use has no subscription, cloud tier, or vendor lock-in. If you plan closed-source embedding, hosted redistribution, or enterprise packaging, review the AGPL obligations first; piia-engram does not currently ship a separate commercial license.
Limitations
piia-engram is functional and actively used, but some things it intentionally does not do yet:
What this means in practice:
- Don't store passwords, API keys, or client PII in piia-engram
- Any process with read access to
~/.engram/can read your data restricted_fieldsreduces what piia-engram emits in cold-start context, but it is not encryption or a true ACL
This is not a warning to avoid piia-engram — it's an honest description of what it is: a local memory layer for personal AI context. For personal use, it works well today.
Security Configuration
Field-level encryption (optional)
Encrypt sensitive profile fields (email, phone, location, etc.) at rest:
Encrypted fields are stored as enc:v2:... in JSON files; legacy enc:v1:... values still decrypt. Unencrypted stores work normally with plaintext (backward compatible).
When store encryption is enabled on the intended root, hook queue bodies and their queue publication intermediates are also protected. This is root-local opt-in: a salt or required queue policy prevents plaintext fallback if only the secret is missing. Every writer must use the intended root; copies must preserve the policy and original salt, with the secret propagated to each host. Incomplete restores that omit both local signals can select plaintext. Quiesce writers during enablement or use the shared policy gate described in the hook queue scope and recovery guide. Downstream archives, digests, quick-context, project snapshots and some knowledge metadata remain plaintext; this is not whole-store or end-to-end encryption.
Audit logging (on by default)
A local audit log records all read/write operations to ~/.engram/audit.log in JSON-lines format. It is a local file only — never sent anywhere. Query it with the get_audit_log tool or grep.
To opt out:
Agent governance (advanced, optional)
Enable per-caller trust levels and disclosure receipts:
Governance is off by default. When enabled, known local coding agents are
filtered to public/work knowledge, unknown callers fail closed to public-only,
and owner-only exports/imports/grant changes require private-self. See
docs/governance.md for the exact trust levels, gates,
honest boundaries, and ledger commands.
Recommended rollout: keep the global default compatible, but enable governance
in each MCP client env when you use Engram across multiple AI tools, automation,
or any remote-facing bridge. engram status and engram doctor report whether
this layer is on. Caller identity is still supplied by MCP environment
variables, not cryptographic authentication, so governance is a practical local
policy boundary rather than a hardened sandbox.
CLI Commands
Contributing
Contributions, issues, and feedback are welcome.
See CONTRIBUTING.md.
License
AGPL-3.0. piia-engram is free software. Your AI work identity and memory belong to you.
來源:README.md,提交 a1c0c4c
工具
0版本歷史
11- v4.27.0最新Nov 1, 2026
- v4.26.0Oct 21, 2026
- v4.25.0Oct 20, 2026
- v4.24.0Oct 10, 2026
- v4.23.0Oct 10, 2026
- v4.22.0Oct 8, 2026
- v4.21.2Sep 26, 2026
- v4.21.1Sep 26, 2026
- v4.21.0Sep 24, 2026
- v4.20.2Sep 23, 2026
- v4.20.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Engram 整合

Engram
tools.engram官方發布者
Engram 為 AI 助理提供跨工具、工作階段、程式碼儲存庫與團隊成員共享的持久記憶層。

Engram
由 GitHub 帳號 TushaeBXN 發布
面向AI的本機私密長期記憶:逐字儲存、可搜尋、可更正。無需LLM或API金鑰。AI 翻譯

Engram: AI memory you can edit in Obsidian
由 GitHub 帳號 engram-app 發布
託管式 MCP 記憶伺服器,讓 Claude、ChatGPT 等 MCP 用戶端共用可讀寫的筆記,並可在 Obsidian 或網頁應用程式中編輯。

Engram
由 GitHub 帳號 devinmlowe 發布
Engram 是面向編碼代理的本地優先認知記憶伺服器:擷取對話、提取結構化知識,並提供混合檢索、知識圖譜與記憶管理。

Engram
由 GitHub 帳號 tstockham96 發布
Engram 為 AI 助理提供本機 SQLite 記憶庫,支援語意檢索、知識圖譜與由 LLM 驅動的記憶整併。