This protocol defines how any AI agent should use Zharwing Memory. It is project-neutral and agent-neutral. Do not put project names, machine-local paths, or vendor-specific task systems in this file.
Zharwing Memory is the durable context layer for AI-assisted work. Agents use it to find relevant project knowledge, preserve session history, write durable memory updates, and build context bundles before doing work.
Zharwing Memory is not automatically the project task tracker, issue tracker, CI
system, source control system, or deployment system. When a project has an
external task system, store only stable references to external task ids in
related_tasks metadata unless that project explicitly adopts Zharwing Memory for task
tracking.
- Resolve the active project from the current working directory or explicit project id.
- Read startup state before assuming whether to resume or start a session.
- Read the latest relevant previous session when the user or project prefers daily/session-per-work-round logs. Carry forward unfinished tasks, next steps, blockers, touched files, and decisions.
- Search project memory for the task, feature, error, or file names involved.
- Start a new project-scoped session for meaningful work by default. Resume only when the user explicitly asks to continue an existing session or the project policy says to reuse active sessions.
- Preview or generate a context bundle when prior context matters.
If memory tooling is unavailable, continue with the user's task using local project files and report that Zharwing Memory was unavailable.
Agents frequently exit without closing their session. memory.start_session
and the daemon-only administrative method memory.start_or_resume_session
therefore close any session still marked active from an earlier local day
before they create or resume anything, so yesterday's log is not reused as
today's session. MCP agents use memory.start_session; they do not receive
memory.start_or_resume_session as part of the eleven-tool daily-memory
surface. The auto-close records closed_reason, keeps updated at the last
real activity, and fills a missing TLDR deterministically. Closing a session
explicitly is still preferred: only an explicit close records the real
summary, next steps, and blockers.
- Save checkpoints after meaningful progress, decision points, or interruptions.
- Add touched files, blockers, and next steps when saving progress.
- Keep durable facts as docs, not only in the session body. Write routine memory directly when review mode is off.
- Use Memory Inbox proposals when review mode is enabled, or when an update is risky, uncertain, private-sensitive, or should not become canonical without a human pass.
- Link sessions and docs to workstreams when the task belongs to a known multi-day topic.
- Link external task ids in
related_tasksonly when the project provides them. - Search before creating new durable docs to avoid duplicates.
- When graph context looks noisy or missing useful hubs, inspect imported paths
and recommend a reviewed graph-rule change.
memory.propose_graph_updateis an administrative daemon RPC, not one of the eleven MCP tools. Use it only when the current client explicitly has administrative daemon access; otherwise direct the user to the UI. Do not silently rewrite project graph rules unless the user explicitly asks for direct settings changes.
- Treat end-of-day, "work is over", and explicit close-session requests as memory closeout triggers.
- Follow project-specific source-control, release, deployment, or task-tracker closeout policy only when that policy is provided outside this universal protocol.
- Close the session with a concrete summary.
- Include next steps, blockers, touched files, and external closeout artifacts when known.
- Write durable memory updates when the session established reusable facts, commands, decisions, gotchas, or architecture notes and review mode is off.
- Route updates to Memory Inbox only when review mode or update risk calls for it.
- Treat memory in the selected project as AI-visible by default, including sessions, file paths, and routine metadata.
- Do not ingest secrets, credentials, local credential caches,
.envfiles, raw private keys, tokens, or unrelated runtime logs. - Respect document visibility. Do not send
private,human-only, ornever-sendmaterial to external models. - Do not search unrelated projects unless the user explicitly asks for cross-project context and the project policy allows it.
- Prefer project-scoped search and context bundles by default.
- Preserve source provenance when importing existing docs or sessions.
Use the strongest available interface in this order:
- MCP
memory.*tools. - The
zharwing-memoryCLI. - The local daemon JSON-RPC API.
- Read-only local docs fallback when no memory tool is available.
Adapters should translate this protocol to the current environment without adding project-specific policy.
An MCP adapter is complete enough for routine coding work when it can resolve startup state, read latest/recent sessions, start sessions, search project memory, preview/load context, save checkpoints, and close sessions. Project administration, imports, backups, graph settings, and Trash are administrative operations handled by the UI or CLI.
Project-specific setup belongs in the project profile and project workspace, not in this protocol. A project profile may define linked repos, workstreams, import roots, graph rules, privacy policy, context policy, assistant policy, and optional external task-system references.