Skip to main content

Local-first AI memory for Claude Code — capture, distill, and retrieve project knowledge automatically.

Project description

CherryDocs

CherryDocs is a local-first memory layer for AI coding chats.

The intended flow is simple:

  1. connect your AI client to CherryDocs via MCP
  2. start with onboard() — get project context in one call
  3. work normally in the repo
  4. ask answer() when continuity matters

What It Does

CherryDocs helps an AI answer questions like:

  • Why is this code here?
  • What did we already try?
  • What failed before?
  • How do I continue this work without rereading everything?

The core product shape is:

  • onboard() for the smallest useful startup view
  • passive capture of work traces via Claude Code hooks
  • local Ollama distillation of sessions into durable project memory
  • answer() for retrieval when a new chat needs context

Current Architecture

  • Durable memory store: local JSON at ~/.cherrydocs/promoted/{project_id}.json
  • Transport: MCP via stdio (FastMCP) — 4 tools
  • Distillation: local Ollama (qwen2.5:7b-instruct by default)
  • Capture: Claude Code hooks + MCP log tools

CherryDocs is project-scoped first and branch-aware second.

MCP Tools

Tool Purpose
onboard Session start — loads top memories + recent sessions
log_activity Record a decision, fix, or insight to the capture buffer
save_checkpoint Structured handoff — blind AI must be able to continue
answer Query promoted memory for project questions

Setup

pip install cherry-docs
cherry install   # installs Claude Code hooks

Then add to your .mcp.json:

{
  "mcpServers": {
    "cherry-docs": {
      "command": "cherry-docs-mcp"
    }
  }
}

Minimal AI Rule

Use CherryDocs.
- On start: call `onboard()`.
- Work normally.
- Use `answer()` when history could change the decision.
- Use `log_activity()` when something important would otherwise be lost.

The canonical source for generated agent rules is docs/agent_protocol.toml.

Workflow

In a new session:

  1. Claude calls onboard() — gets top memories + recent session state
  2. Work happens normally; hooks capture tool use and code changes
  3. On git commit, auto-distillation fires via Ollama
  4. Ask answer("Why did we change this?") in any future session

What Works Today

  • Local file-backed promoted memory (no cloud, no graph DB)
  • MCP stdio server with 4 tools
  • Claude Code hook-based passive capture
  • Ollama distillation pipeline (per-session + commit-triggered)
  • cherry eval — heuristic + LLM judge for memory quality
  • cherry why <file> — show memories anchored to commits touching a file

Development

pip install -e .
python -m pytest tests/ -q
python scripts/check_size_limits.py

For PR hardening:

bash scripts/local_pr_gate.sh fast

Documentation

Would another AI actually want to keep this on because it helps achieve the goal?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cherry_docs-0.2.0.tar.gz (78.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cherry_docs-0.2.0-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file cherry_docs-0.2.0.tar.gz.

File metadata

  • Download URL: cherry_docs-0.2.0.tar.gz
  • Upload date:
  • Size: 78.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for cherry_docs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d87f11555dcc0e862b4346f9bfc94a53e27c2d7b5860757b56ed00c3435ec59
MD5 13c4d80ff91297b6a6e8fa464ce566cb
BLAKE2b-256 217cf57ea02bab7d406a689792d848143e7f72223f008c9638e9f683e2b2789e

See more details on using hashes here.

File details

Details for the file cherry_docs-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cherry_docs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for cherry_docs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45544d40942ce9693047452375d4d24519ff58d24d4300e5d9785b227037b199
MD5 5491184a31630fad213ce2ad56e756f2
BLAKE2b-256 52dbb867b240fe8fdbed5ae469ef4acaee6289633bc5664c9d03fd31473cc9d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page