Skip to main content

Compress local documentation context for coding agents.

Project description

Your agents' memory, unified, writable, and yours.

PyPI version License: MIT Python 3.11 | 3.12 | 3.13

Install | First run | Work with memory | Wiki

Local docs ingest and query demo

Claude Code, Codex, Cursor, Gemini, OpenCode, Cline, Windsurf, and other coding agents already write memory, instructions, and rules across your machine. Docmancer turns that scattered context into small, source-attributed memory atoms that can be recalled, inspected, forgotten, or shared independently.

The default path is local and keyless. SQLite FTS5 handles lexical search, the packaged potion-base-8M model creates embeddings without a download, and sqlite-vec stores dense vectors in the same local index. The same engine can also index documentation from local files, docs sites, and GitHub.

Install

pipx install docmancer    # Python 3.11, 3.12, or 3.13

If pipx picks an unsupported interpreter, pin one: pipx install docmancer --python python3.13.

First run

Set up the local index, then ask a question:

docmancer setup
docmancer memory sync
docmancer memory query "what deployment decisions have we recorded?"

setup creates ~/.docmancer/, discovers memory and instructions from supported agents and repositories, builds the SQLite index, and installs skill files for detected agents. Run docmancer memory sync whenever the source memory changes.

Work with memory

Add a project decision, query it, and inspect its provenance:

docmancer memory add "Production deploys run on Railway" --type decision --scope project --project "$PWD"
docmancer memory query "where do production deploys run?" --project "$PWD"
docmancer memory list --scope project --project "$PWD"
docmancer memory show 68309626f1ac  # use a Memory ID printed by memory list

Equivalent memories are not added twice within the same scope. memory show displays one extracted atom and its source, not the entire source file.

To forget a memory, preview the action using its Memory ID before confirming it:

docmancer memory forget 68309626f1ac --dry-run
docmancer memory forget 68309626f1ac --yes

For a Docmancer-owned record, forgetting deletes the Markdown body and leaves a content-free tombstone. For harvested memory, it suppresses the atom without editing another agent's source file.

Promote a reviewed memory into the current repository when the team should share it:

docmancer memory promote 68309626f1ac --team --project "$PWD"
git status --short .docmancer/memory/

Team memory lives as editable Markdown under .docmancer/memory/. Docmancer never stages or commits it, so new files appear in git status before they appear in git diff.

Inspect and maintain the index

These commands cover routine maintenance without changing source memory:

Command Purpose
docmancer memory sources Show harvested files, scopes, sizes, and atom counts.
docmancer memory sources --preview Re-harvest live sources without writing the index.
docmancer memory audit Find stale index state, likely secrets, duplicates, and poor-quality sources.
docmancer memory status Show index location and summary counts.
docmancer memory clear Delete the rebuildable index while preserving durable records and tombstones.

For retrieval regression testing, run the checked-in sanitised corpus with docmancer memory eval --dataset tests/fixtures/memory-eval-sanitized-real.jsonl --gate. Query and hook recall share a benchmark-calibrated 0.05 relevance floor; use --min-score when deliberately testing another threshold.

Automatic recall with hooks

Recall hooks query the existing local index at session start and before matching prompts, then inject only relevant source-backed atoms. Weak matches stay silent, and a per-session cache avoids repeating the same atom every turn.

docmancer install claude-code --hooks
docmancer install codex --hooks

Hooks are local, bounded, and fail open so they never block an agent turn. They do not call OpenRouter or another provider. The internal budget defaults to 1,000 ms and can be changed with DOCMANCER_HOOK_TIMEOUT_MS. Remove a hook by replacing install with remove in the commands above.

Capture is a separate opt-in. It redacts first, reads only a bounded transcript tail when needed, and stores extracted atoms rather than raw transcripts:

docmancer install claude-code --capture-hooks
docmancer install codex --capture-hooks

Preview a payload without writing by running docmancer memory capture --agent codex --input hook-payload.json --json. Remove capture hooks by replacing install with remove.

Local MCP

The packaged docmancer-mcp stdio server exposes memory search, add, list, show, forget, and promote alongside docs search. Forget and promote return previews until the caller explicitly confirms them. Run docmancer mcp install codex, replacing codex with claude-code or claude-desktop for those clients. The MCP extra is required.

Documentation search

Index local documentation or a public docs site, then query the separate docs index:

docmancer ingest ./docs
docmancer add https://docs.pytest.org
docmancer query "How do I parametrize a fixture?"

Local ingestion supports Markdown, PDF, DOCX, RTF, and HTML. URL ingestion supports GitBook, Mintlify, generic documentation sites, and GitHub.

Optional consolidation

Consolidation is optional maintenance, not the main memory-transfer path. docmancer memory consolidate sends selected, privacy-redacted memory atoms to OpenRouter and returns a review-only draft: deduplicated, grouped into compact sections, with conflicts surfaced as warnings instead of silently resolved.

export OPENROUTER_API_KEY=...
docmancer memory consolidate \
  --provider openrouter \
  --model openai/gpt-4.1-nano \
  --query "deployment and infra decisions" \
  --output master-memory-draft.md \
  --yes

Apply selected atoms to an agent's always-loaded file only when you want a compact stable summary:

docmancer memory apply --agent codex --dry-run
docmancer memory apply --agent codex

apply is local and keyless. It writes inside a delimited managed block, creates a timestamped backup, and leaves surrounding content untouched. --remove removes the managed block. Provider-backed consolidation prints a notice before sending redacted text and uses a finite 180-second timeout by default. See Configuration for provider and timeout options.

How retrieval works

Memory and docs queries combine SQLite FTS5 lexical search with dense vectors from the packaged static model, then fuse the rankings with Reciprocal Rank Fusion. The optional heavy backend adds Qdrant, FastEmbed, and SPLADE. Retrieval budgets keep injected context small enough to leave room for the agent's work.

Where your data lives and how to remove it

Docmancer keeps durable records separate from its rebuildable index:

  • ~/.docmancer/memory.db and its co-located sqlite-vec file are the rebuildable search index.
  • ~/.docmancer/memories/*.md contains personal, project, manual, and captured records as Markdown with YAML frontmatter.
  • <repo>/.docmancer/memory/*.md contains free, MIT-licensed team memory intended for Git review.
  • ~/.docmancer/memory-tombstones.json contains content-free suppression identifiers and hashes.
  • Extraction and hook dedupe caches live under ~/.docmancer/; neither is a transcript archive.
  • OpenRouter receives privacy-redacted selected memory only when you explicitly run optional consolidation. Local sync, CRUD, MCP, hooks, capture, and evaluation do not call it.

There is no telemetry or phone-home. Every docs section is also written to ~/.docmancer/extracted/ as Markdown and JSON. Use docmancer inspect for docs-index statistics and docmancer query --explain to see which retrieval signals placed each result.

Where to next

The wiki is the authoritative reference for everything else. Pick a page based on what you need:

Page When to read it
Commands Complete CLI and maintenance reference
Configuration All YAML keys, env vars, and the API-key reference
Architecture How the memory harness, ingest, and hybrid retrieval work
Supported Sources What file formats and URL providers are covered
Install Targets Where each agent's skill file lands
Troubleshooting Common errors and fixes

Wiki home | Changelog | PyPI

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

docmancer-0.6.17.tar.gz (30.0 MB view details)

Uploaded Source

Built Distribution

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

docmancer-0.6.17-py3-none-any.whl (28.6 MB view details)

Uploaded Python 3

File details

Details for the file docmancer-0.6.17.tar.gz.

File metadata

  • Download URL: docmancer-0.6.17.tar.gz
  • Upload date:
  • Size: 30.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docmancer-0.6.17.tar.gz
Algorithm Hash digest
SHA256 7b07a0bc7c5035ab50ab7a664186da221e149f8240c2e248188595d206469982
MD5 99e211f8b4a76b558c8d11cf57c26ed6
BLAKE2b-256 16e474e50a3a2346a71386715241333bb7bfe92a06a503f58ed594e550e472c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.6.17.tar.gz:

Publisher: publish.yml on docmancer/docmancer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docmancer-0.6.17-py3-none-any.whl.

File metadata

  • Download URL: docmancer-0.6.17-py3-none-any.whl
  • Upload date:
  • Size: 28.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docmancer-0.6.17-py3-none-any.whl
Algorithm Hash digest
SHA256 c3cb75ce2515d4adabc143ec162df9476a9783c115d6b9478b2e5f050bf0b35c
MD5 a7a95e01889fd567080e6ed1e1022db1
BLAKE2b-256 876d601f8b784aadd5bdb56a778ec1160c78b384a44e4aaefee04cb766490eb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.6.17-py3-none-any.whl:

Publisher: publish.yml on docmancer/docmancer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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