Skip to main content

Compress local documentation context for coding agents.

Project description

docmancer

Compress documentation context so coding agents spend tokens on code.

PyPI version License: MIT Python 3.11 | 3.12 | 3.13

Docmancer fetches documentation, normalizes it into inspectable sections, indexes those sections with SQLite FTS5, and returns compact context packs with source attribution. The goal is agentic runway: your agent should burn tokens on implementation, tests, and debugging, not on rereading entire documentation sites.

Product shape: the open source CLI on PyPI is the main distribution. You can pull versioned, pre-indexed packs from the public registry at registry.docmancer.dev, or add docs from URLs and local paths and index them yourself. Either way, sections land in a local SQLite database on your machine. There is no hosted “query API”: retrieval runs in the CLI, so your agent loop stays local-first.

In a typical agentic coding session, raw docs pages can consume 30 to 40 percent of the context window. Docmancer compresses that overhead by 60 to 90 percent, so the agent stays sharp longer, runs more iterations before context degradation, and produces more output per session.

CLI demo

Quickstart

pipx install docmancer --python python3.13

docmancer setup
docmancer pull react
docmancer query "How do I use hooks?"

setup creates ~/.docmancer/docmancer.yaml, initializes ~/.docmancer/docmancer.db, and installs detected agent skills. Use setup --all for non-interactive installation across all supported agents.

What It Does

  • Pull pre-indexed packs from the public registry, or add docs from any URL or local path.
  • Uses SQLite FTS5 by default. No Qdrant server, no embedding model download, no vector database startup.
  • Stores normalized sections in SQLite and writes extracted markdown/json files under .docmancer/extracted/ for inspection.
  • Supports documentation URLs, GitHub README and docs markdown, local directories, and markdown/text files.
  • Returns compact context packs with estimated docs-token savings and agentic runway.

Registry

The docmancer registry is a hosted catalog of pre-indexed, version-aware documentation packs (built by crawl workers from package-registry metadata and published docs URLs). Think of it as a place to install trusted docs packs the same way you install packages: search, pull a version, and query locally without re-crawling the whole site on your laptop.

docmancer search langchain
docmancer pull langchain
docmancer pull react@18.2        # optional version pin
docmancer packs                  # list installed packs

Packs use a three-tier trust model (values in APIs and manifests use snake case, for example maintainer_verified):

  • Official — provenance traced to package registry metadata (PyPI, npm, etc.)
  • Maintainer verified — maintainer has claimed ownership through the registry
  • Community — user-submitted (for example via publish); requires --community to pull and should pass audit

Project manifest

Declare your project's documentation stack in docmancer.yaml:

packs:
  react: "18.2"
  nextjs: "14.1"
  langchain: "0.2"

Then run docmancer pull with no arguments to install everything. Share the manifest with your team so everyone has the same docs context.

Commands

Command What it does
docmancer setup Create config/database and install detected agent skills
docmancer setup --all Non-interactively install all supported agent integrations
docmancer add <url-or-path> Fetch or read documentation and index normalized sections
docmancer pull [pack[@version]] Pull a pack from the registry (or all packs from manifest)
docmancer search <query> Search the public registry for available packs
docmancer publish <url> Submit a docs URL to the registry for indexing
docmancer packs List locally installed registry packs
docmancer packs sync Sync installed packs with manifest (additive by default)
docmancer audit <pack> Scan a pack for suspicious patterns
docmancer auth login Authenticate with the registry (device code flow)
docmancer auth status Show authentication and subscription tier
docmancer update Re-fetch and re-index all existing docs sources
docmancer query <text> Return a compact markdown context pack
docmancer query <text> --format json Return the same context pack as JSON
docmancer query <text> --expand Include adjacent sections around matches
docmancer query <text> --expand page Include the full matching page, subject to the token budget
docmancer list List indexed docsets or sources
docmancer inspect Show SQLite index stats and extract locations
docmancer remove <source> Remove a source, docset root, or installed pack
docmancer doctor Check config, SQLite FTS5, index stats, registry, and agent skill installs
docmancer init Create a project-local docmancer.yaml
docmancer install <agent> Advanced/manual skill installation for a single agent

Retrieval Shape

By default, query uses a 2400 token budget and returns markdown. It includes a summary like:

Context pack: ~900 tokens vs ~4800 raw docs tokens (81.2% less docs overhead, 5.33x agentic runway)

The savings are estimates, but the direction is explicit: compress docs overhead so the remaining token budget goes into useful agent work.

Workflow

The recommended workflow combines registry packs with custom docs:

# 1. Pull pre-indexed packs for your stack
docmancer pull react
docmancer pull nextjs

# 2. Add project-specific or internal docs
docmancer add https://internal-docs.company.com
docmancer add ./docs

# 3. Query — results come from both packs and local docs
docmancer query "How do server components work?"

Registry packs and locally indexed docs live in the same SQLite index. Queries search both seamlessly.

Keeping Docs Up To Date

Run docmancer update to refresh all locally-added sources. Docmancer re-fetches each URL or re-reads each local path and updates the index in place.

For registry packs, run docmancer packs sync to update installed packs to their latest versions.

Project-Local Config

Global config is stored under ~/.docmancer/ by default. To use a project-local index:

docmancer init
docmancer add ./docs

The generated docmancer.yaml points to .docmancer/docmancer.db and .docmancer/extracted inside the project. If no project config exists, docmancer falls back to the global config.

Add a packs: section to declare your project's documentation stack:

index:
  db_path: .docmancer/docmancer.db
  extracted_dir: .docmancer/extracted/

packs:
  react: "18.2"
  nextjs: "14.1"

Supported Agents

setup detects common agent installations. Manual installation remains available:

docmancer install claude-code
docmancer install claude-desktop
docmancer install codex
docmancer install cursor
docmancer install cline
docmancer install gemini
docmancer install opencode

Claude Desktop receives a zip package that can be uploaded through Claude Desktop's Skills UI.

Evals

docmancer eval is available as an optional quality layer for benchmarking compression quality. It compares raw docs context against docmancer context packs and measures whether token reduction degrades answer quality.

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.3.1.tar.gz (1.5 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.3.1-py3-none-any.whl (95.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docmancer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ef48924086df3685b1f754987fc24249a6ced0f1fac38a90384682bf8ca8576e
MD5 d55880a1a532e18e17f1ca2954051409
BLAKE2b-256 0e8430cdc21153687ef7495cec57c64144300cbe751ba3fc09660df1627ed1ac

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for docmancer-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 249b74e98be566991140f481bac2866833871b36ca42bc116f451e874e31b06d
MD5 7d76695da88d6772b45deea185e45763
BLAKE2b-256 c804dc219b109b803864457b5e88042e93978ac7ea7b4c3947133b6626c064d3

See more details on using hashes here.

Provenance

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