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 | Hooks and audit | Work with memory | Wiki

Docmancer file-first terminal explorer browsing memory, instructions, documentation, and masked security findings

Claude Code, Codex, Cursor, Gemini, OpenCode, Cline, Windsurf, and other coding agents already write memory, instructions, and rules across your machine. Docmancer indexes those complete source files for browsing and extracts small, source-attributed memory atoms for recall and passage-level curation.

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 open the interactive explorer:

docmancer setup
docmancer

setup creates ~/.docmancer/, discovers memory and instructions from supported agents and repositories, builds the SQLite index, and installs skill files for detected agents. Bare docmancer is the recommended human interface. It opens a local terminal explorer with Memory, Instructions & Rules, Docs, and Security tabs. The tab counts describe complete indexed source files, while memory atoms remain the retrieval unit underneath search, recall, and passage-level actions.

Make cross-agent memory automatic

Hooks are the shortest path to Docmancer's cross-agent memory loop. They query the shared local index when Claude Code or Codex starts and before relevant prompts, then inject only the source-backed memories that match the current work. A decision written by one supported agent can therefore reappear when another agent needs it, without copying whole memory files into every prompt.

Install recall hooks for the agents you use, then run the local security audit:

docmancer install claude-code --hooks
docmancer install codex --hooks
docmancer memory audit

Hooks are local, bounded, and fail open, so they never block an agent turn. Weak matches stay silent, and a per-session cache avoids repeating the same memory. 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.

The audit scans the original local memory, instruction, and rule sources for likely secrets while only displaying masked values. The TUI runs it automatically and keeps the latest results in the Security tab. Use docmancer memory audit --json when you need the complete machine-readable report.

The deterministic CLI remains available for coding agents, scripts, CI, and advanced workflows:

docmancer memory sync
docmancer memory query "what deployment decisions have we recorded?"
docmancer tui  # explicit alias for the interactive explorer

When developing from this repository, run scripts/tui_local_smoke.sh for an isolated hands-on demo. It creates more than 60 temporary source files across multiple harnesses, includes instruction files and one source larger than 500 KB, launches the TUI against a temporary index, and removes that temporary data when the TUI exits.

The TUI browses the complete indexed snapshot, sorted by most recently updated and paginated at 50 files per page. Each row shows the filename, harness, scope, age, size, and atom count. Scope, harness, updated-time, and project filters are applied before pagination, and the project selector includes matching project or team sources plus global sources.

Memory, instruction, and rule files are manageable in place from the inspector. Use N to create a Docmancer record or a file beside the selected external source, E to edit the live file, and D to delete it after confirmation. Direct edits verify that the source has not changed since the editor opened, then rebuild the local index. Search matches retain separate F and P actions for suppressing one passage or promoting it into team memory. Docmancer-owned records continue to use revision-aware editing and content-free deletion tombstones.

Selecting a memory or instruction file shows its complete privacy-cleaned indexed text in the right pane without opening a popup. Press Enter or V for the full-screen viewer. Selecting a documentation source shows an expandable tree of indexed pages and sections; choose a page to read its complete indexed content or a section to inspect that passage. Plain-text search remains passage-powered, but results are grouped by source file and jump to the best matching line range; [ and ] move between matches. Use /memory <query> to search agent-memory files and /instructions <query> or /rules <query> to search instruction and rule files. Passage exclusion and promotion are available from search results. After a search or narrow filter produces no matches, press Enter in the empty search box or run /reset to restore the full file list and broad filters.

Type / to see every available command. The wide layout reserves 20 percent for filters, 30 percent for the file list, and 50 percent for inspection, then collapses cleanly on compact terminals. Codex rollout summaries are shown with human-readable titles, compact timestamps, and shortened home paths while retaining their exact source path for Open original.

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"
MEMORY_ID="paste-a-memory-id-from-the-list-output"
docmancer memory show "$MEMORY_ID"

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 "$MEMORY_ID" --dry-run
docmancer memory forget "$MEMORY_ID" --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 "$MEMORY_ID" --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. Review a repository import or export with:

docmancer memory team import --from-git "$PWD"
docmancer memory team export --to-git "$PWD" --dry-run

The export command never stages or commits files.

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.

Optional capture

Capture is separate from recall hooks. 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. When a product site publishes a short llms-full.txt that links to its real documentation on a same-company docs subdomain or a known hosted-docs site, add indexes both roots. Page discovery remains bounded by --max-pages.

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.

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.7.2.tar.gz (31.4 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.7.2-py3-none-any.whl (28.7 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docmancer-0.7.2.tar.gz
Algorithm Hash digest
SHA256 c0a05be2a824bf18f4476cea9075d9b301f95bdb070e6d8ed8c8b1a0780ae170
MD5 4c1bd7f01dd507b0478e54fe3893bcdb
BLAKE2b-256 e8d05d861f50f1d8f9f0922745e21429d9641100d3d5e18cbe91d04c62bef35d

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.7.2.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.7.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for docmancer-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d70498a53ded86b7acc5d322ffebeaf4e31eb924e2fd58556073e3059a316194
MD5 9c7066b4ea468d2b5edd2d892de79a31
BLAKE2b-256 c62d73773d2aed07f89e4d8969f2b781e4244f36985b4fca19fb858e5d8dabf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.7.2-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