npm-distributed sqlite-indexed no server

Your agent reads the docs for the version you actually installed.

docspack ships documentation as an ordinary npm dependency — pinned next to the code it describes, indexed on your machine, and answered by one command.

In plain terms: coding assistants routinely answer from the wrong version of a library's manual. docspack installs the right manual next to the code and keeps the two in step.

pnpm
$ pnpm add -D @acme/docspack
$ pnpm dlx docspack sync
agent shell — 85ms
# the agent asks a question, not for a library
$ npx docspack ask "verify a webhook signature"
## @acme/docspack@1.4.0 · webhooks
Verify the signature header on every event.
Compare with timingSafeEqual; reject on drift > 5m.
source
chunks/webhooks.md
version
1.4.0 — matches package-lock.json
cost
2,140 tokens, capped at 3,000

the gap

Three ways to answer one question

You have @acme/docspack@1.4.0 in your lockfile. The agent asks how to verify a webhook. Only one path is bound to the version you are running.

01 · training data
Recalled from weights
answers for 0.9.2

Frozen. The signature it remembers quietly stopped existing.

02 · fetch the docs site
Network round trip
answers for 2.1.0

Today's truth. Whatever the vendor publishes now — not what you installed.

03 · docspack
Local index, keyed to the lockfile
answers for 1.4.0

Correct by construction. The docs were installed with the code.

instead of

Why not the thing you already have

The alternatives are not less capable. They differ on one axis: which version of the truth reaches the model, and how much of it.

How docspack compares with a docs site, an MCP server that fetches, and an agent skill, across five properties.
docspack Docs site MCP server Agent skill
Matches your lockfile Always Latest only Latest only Authored once
Works offline Yes No No Yes
Resident in context Never Pasted pages Tool defs, always Whole skill, always
Cost of one answer ≤ 3,000 tokens Whole page Whole page + trip Whole document
Setup per project One line None Per client Per team

docspack

Matches your lockfile
Always
Works offline
Yes
Resident in context
Never
Cost of one answer
≤ 3,000 tokens
Setup per project
One line

Docs site

Matches your lockfile
Latest only
Works offline
No
Resident in context
Pasted pages
Cost of one answer
Whole page
Setup per project
None

MCP server

Matches your lockfile
Latest only
Works offline
No
Resident in context
Tool defs, always
Cost of one answer
Whole page + trip
Setup per project
Per client

Agent skill

Matches your lockfile
Authored once
Works offline
Yes
Resident in context
Whole skill, always
Cost of one answer
Whole document
Setup per project
Per team

A docs MCP server that fetches

Closest relative, and no reason it cannot exist — docspack mcp is exactly that. The difference is what sits behind it: a fetching server returns the same text to every project, pays the network on each call, and ranks whole pages because there is no local index.

An agent skill

A skill teaches an agent how to do something — your review checklist, your deploy runbook. It is authored once and loaded whole. Dependency docs change when you bump a version, and nobody wants to hand-edit them. Skills and docspack compose: the skill says “check the docs first”.

Vendoring docs into the repo

Copying Markdown into CLAUDE.md is the right instinct — it just does not survive upgrades. Nothing notices when it goes stale, and a flat folder has no index, so the agent reads the whole file to find one line.

A vector database

Better recall for vague questions, at the price of an embedding pipeline, a service, and a re-ingestion story on every change. Aimed at a corpus you do not have. Yours is small, textual, and already versioned by the package manager.

how it works

Three moves, no server

01

Vendors publish docs to npm

A docs package is an ordinary npm package: Markdown split into chunks, plus a manifest describing them. Its version tracks the library's.

// package.json
"devDependencies": {
  "@acme/docspack": "1.4.0"
}
02

docspack indexes them locally

One sync walks the docs packages this project depends on and writes their chunks into one SQLite database per machine. Keyed by name and version, so a release is read once no matter how many projects use it.

$ npx docspack sync
+ @acme/docspack@1.4.0  128 chunks  indexed
= @other/docspack@0.0.8   44 chunks  cached
03

Agents ask the index

Every agent already has a shell, so the setup is done: no server to spawn, no per-client configuration, nothing resident when nobody is asking. One line in AGENTS.md is the whole install.

# AGENTS.md
Run docspack ask "question" for docs on
this project's dependencies. It answers
from the installed versions.
85ms

Per query, roughly half of it Node starting. Invisible next to the seconds an agent spends thinking.

SQLite FTS5

Porter stemming, so authenticate finds a chunk that only says authentication.

Also MCP

docspack mcp serves the same index over the protocol, byte-identical answers, if you would rather have a tool.

what it costs in context

A query, not a library

Measured against one vendor's published documentation. The middle bar is what the index holds on disk; it never reaches the model.

Everything published, in one file
92,312
The same content as a docs package (on disk)
62,366
ask "validate a request body"
1,040
ask "how do I set a cookie"
833
ask "streaming responses"
888

About one percent of the documentation reaches the model, and a response is capped at 3,000 tokens no matter what was asked.

the specification

A docs package is just files

Any tool can read one. The manifest maps chunks to search terms, so indexing needs no model in the loop.

node_modules/@acme/docspack/
├─ package.json  holds the version
├─ llms.txt      table of contents
└─ .llms/
   ├─ manifest.json chunk routing table
   ├─ chunks/
   │  ├─ api-auth.md
   │  └─ webhooks.md
   └─ schemas/      optional openapi
{
  "name": "@acme/docspack",
  "version": "1.4.0",
  "chunks": [
    {
      "id": "api-auth",
      "tokens": 150,
      "tags": ["authentication", "bearer"]
    }
  ]
}

Generate one from what you already have

Split Markdown at headings, or walk an OpenAPI document. The only command that touches the network reads a project's public llms.txt.

$ npx docspack build --from ./docs
$ npx docspack build --openapi ./api.json
$ npx docspack build hono

feedback

The agent noticed the docs are wrong

An agent has the documentation, the installed library and a failing program in front of it at the same moment. That signal is worth capturing, and today it evaporates.

guarantees

What holds, every query

Offline by construction

sync, ask, search and list make no network requests. They read node_modules and a local SQLite file.

Version-scoped answers

The shared index may hold five versions of a library. A project only ever sees the one it installed.

Bounded responses

Three chunks and 3,000 tokens by default, counted from the manifest before content is returned.

Untrusted input, treated as such

Community packages are labelled, and a manifest path that escapes the package is refused rather than read.

questions

Before you install it

What is docspack?

docspack distributes a library's documentation as an ordinary npm package, so the docs install alongside the code and stay pinned to the same version. It indexes those packages into a local SQLite database and answers questions from it with one command, offline.

Do I need to run a server?

No. docspack is a CLI: the agent runs docspack ask in the shell it already has. There is nothing resident when nobody is asking. An MCP server ships too (docspack mcp) and serves the same index, for assistants that cannot run commands.

What if a library does not publish a docs package?

Build one yourself with docspack build --from ./docs, from an OpenAPI document, or from a project's public llms.txt. The result is a normal npm package you can publish or keep private.

How much context does an answer consume?

Three chunks and 3,000 tokens by default. The cap is counted from the manifest before any content is returned, so a query cannot overrun it. Measured against one vendor's published docs, roughly one percent of the corpus reaches the model.

Does docspack send anything anywhere?

No. sync, ask, search and list make no network requests at all, and docspack contains no code that transmits a feedback report. The only command that touches the network is docspack build, which reads a project's public llms.txt when you ask it to.