Documentation RAG
Use documentation retrieval when you need instructions for a specific version of a third-party library. For example: "How do I use Stripe's SetupIntent on the version in the lockfile?"
Fit: libraries whose source you can't (or shouldn't) read. Skip when the source is in
node_modules — index that instead.
Solo Dev — Context7
Context7 retrieves documentation from a hosted service and includes source URLs. You can request a specific version without indexing anything locally.
claude mcp add context7 -s user -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
Add these instructions to AGENTS.md:
When you need to know what a third-party library expects — call signatures,
configuration options, migration notes between versions — use the Context7
MCP `query-docs` tool with the library ID from `resolve-library-id` and,
when it matters, a specific version. Pin the version to the one in this project's lockfile.
Do not paraphrase the docs from memory; quote the retrieved passage and
verify the `Source:` line points at the ref you asked for — pinned queries
can occasionally leak snippets from another ref.
Verify the Source: line on every retrieved passage. Probes in this repo's research found
cases where a syntactically valid version pin returned snippets sourced from master or another
tag. When the Source URL doesn't match the ref you asked for, the pin didn't hold.
Org — RAGFlow
RAGFlow is self-hosted and uses the Apache 2.0 license. It indexes your organization’s documentation, including internal libraries, custom specifications, and vendored SDKs. Its DeepDoc parser handles document layouts in PDFs, Office files, and scanned manuals.
docker compose -f docker/docker-compose.yml up -d
ollama pull nomic-embed-text
For a shared setup, deploy RAGFlow on your team’s infrastructure and configure it to index the documentation for your internal libraries.
Dive deeper
- Context7 (Solo Dev):
research/context7/— scored capability matrix, per-cell reasoning · pinned lab - RAGFlow (Org):
research/ragflow/