docstore
Extract structured fields from documents once, query forever
Install / Use
claude mcp add LumientAI -- npx -y github:LumientAI/docstoreIf the server publishes to npm under a different name, use that package instead ā check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of docstore
docstore scores 74/100 on our quality scale, 854th of 965 AI & Machine Learning skills we index.
Its MCP Server is 10 KB long, well organised into 37 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 3 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-19 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 73/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
docstore compared with similar skills
All 4 of these similar skills score higher than docstore; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| docstore (this skill)by LumientAI | 74 | 3 | 3mo ago | MCP Server |
| claude-memby thedotmack | 100 | 113.5k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.2k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.9k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
Frequently asked questions
- How do I install docstore?
- Run
claude mcp add LumientAI -- npx -y github:LumientAI/docstore. The install tabs above show the steps for each supported agent. - Which AI agents does docstore work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is docstore safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 73/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is docstore still maintained?
- The repository was last updated about 3 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubdocstore
dbt for unstructured data. Extract once, query forever.
Most tools re-read your documents every time you ask a question. docstore extracts the fields you care about once, caches them locally, and answers subsequent queries from the cache - no LLM calls, no re-reading, no waiting.
Run 1 (cold): 200 invoices ā 400 LLM calls ā ~$0.40
Run 2 (warm): 200 invoices ā 0 LLM calls ā $0.00
Query: "which invoices are unpaid?" ā 0 LLM calls ā <1s
Why this exists
LLMs made it easy to extract structured data from documents. What they did not provide is a layer that persists that extraction and invalidates it automatically when the source file changes. Every existing tool either:
- Re-reads raw documents on every query (expensive, slow)
- Requires a database or vector store (complex, overkill for most teams)
- Stores embeddings for semantic search (wrong abstraction for structured extraction)
docstore treats structured extraction as a cache over your unstructured data. Same insight as dbt applied to SQL - you define the transformation once, the system manages the state.
Benchmark
docstore ships with a reproducible public cache benchmark. It generates a
synthetic invoice corpus, writes ground_truth.jsonl, then measures:
cold_extract: empty cache, every document calls the LLM oncewarm_extract: same corpus and schema, every document is served from cachecached_query: filtered query against cached JSON ā zero LLM calls, near-instant
# Synthetic invoices (auto-generated)
uv run python scripts/benchmark.py /tmp/docstore-benchmark --count 30
uv run python scripts/benchmark.py /tmp/docstore-benchmark --count 30 --filter "paid=false"
# Any existing folder of documents
uv run python scripts/benchmark.py ./my-documents \
--no-generate --schema my_schema --ask --glob "*.pdf" --filter "status=active"
Use --provider and --model to run it against a specific vendor. The
benchmark is intended to show cache behavior, not provider quality.
A contract-specific corpus generator is also included for demo purposes:
# Generate 30 synthetic vendor contract PDFs
uv run --extra scripts python scripts/generate_pdf_contracts.py ./sample_contracts
# Then benchmark against them
uv run python scripts/benchmark.py ./sample_contracts \
--no-generate --schema contracts --ask --glob "contract_*.pdf" --filter "status=active"
Installation
pip install lumient-docstore
All four LLM providers (Anthropic, OpenAI, Groq, Gemini) work out of the box - pick one at runtime via --provider.
Or from source:
git clone https://github.com/LumientAI/docstore
cd docstore
pip install -e ".[dev]"
Quickstart
Python API
from pathlib import Path
from docstore import DocStore, ExtractionSchema, create_llm_client
from docstore.agents.orchestrator import run_directory
class InvoiceSchema(ExtractionSchema):
vendor: str
amount: float
currency: str
due_date: str
paid: bool
invoices_dir = Path("./invoices")
# Co-locate the cache with the corpus so the CLI and Python API
# share state (the CLI's path-taking commands default to this).
store = DocStore(root=invoices_dir / ".docstore")
descriptor = InvoiceSchema.to_descriptor()
client = create_llm_client() # defaults to Anthropic; pass provider="openai" etc. to override
results = run_directory(invoices_dir, descriptor, store, client)
# Query without any LLM calls
unpaid = store.query("InvoiceSchema", lambda r: r.data.get("paid") is False)
CLI
# Generate a synthetic invoice corpus for testing (30 .txt files)
python scripts/generate_txt_invoices.py ./sample_invoices --count 30
# Extract - describe fields interactively
docstore shell ./invoices/
# Extract with a named schema
docstore extract ./invoices/ --schema invoice_schema
# Use OpenAI, Groq, or Gemini instead of the default Anthropic provider
docstore extract ./invoices/ --schema invoice_schema --provider openai
docstore extract ./invoices/ --schema invoice_schema --provider groq
docstore extract ./invoices/ --schema invoice_schema --provider gemini
# Override the default model for any provider
docstore extract ./invoices/ --schema invoice_schema --provider gemini --model gemini-2.5-pro
# Query stored results (no LLM)
docstore query invoice_schema --filter "is_paid=false" --store ./invoices/.docstore
# Aggregate: count and sum per vendor (no LLM)
docstore query invoice_schema --group-by vendor --count --sum amount --store ./invoices/.docstore
# Ask in natural language - one LLM call compiles to a filter,
# results come from cache with no per-document re-reads
docstore ask "which unpaid invoices are over $5000?" --schema invoice_schema --store ./invoices/.docstore
# Diff a changed file
docstore diff ./invoices/acme_april.pdf --schema invoice_schema
# Remove cache entries whose source file no longer exists
docstore sync --store ./invoices/.docstore # dry run
docstore sync --store ./invoices/.docstore --yes # delete stale entries
# Wipe the cache (optional --schema X to scope)
docstore clean --store ./invoices/.docstore --yes
# Stats
docstore stats --store ./invoices/.docstore
MCP server (Claude Desktop)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"docstore": {
"command": "docstore-server",
"env": {
"DOCSTORE_DIR": "/path/to/your/.docstore",
"DOCSTORE_PROVIDER": "anthropic",
"ANTHROPIC_API_KEY": "your-key"
}
}
}
}
Claude can then call extract, query, diff, and stats directly.
Supported providers are anthropic (default), openai, groq, and gemini.
Set ANTHROPIC_API_KEY, OPENAI_API_KEY, GROQ_API_KEY, or GEMINI_API_KEY
for the provider you choose. Each provider has a default model, and you can
override it with --model on the CLI or DOCSTORE_MODEL for the MCP server.
How it works
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā docstore pipeline ā
ā ā
ā document.pdf ā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāā cache hit? āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā Parser ā āāāāāāāāāāāāāāŗ .docstore/{key}.json ā ā
ā āāāāāāāāāāā (no LLM) āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā ā
ā ā cache miss ā
ā ā¼ ā
ā āāāāāāāāāāāāā ā
ā ā Extractor ā 1 LLM call - extract fields against schema ā
ā āāāāāāāāāāāāā ā
ā ā ā
ā ā (opt-in via --validate) ā
ā ā¼ ā
ā āāāāāāāāāāāāā ā
ā ā Validator ā +1 LLM call - sanity-check extracted values ā
ā āāāāāāāāāāāāā ā
ā ā ā
ā ā¼ ā
ā .docstore/{file_hash}__{schema}__{version}.json ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
The validator is off by default - cold extraction is one LLM call per file. Pass --validate to add a plausibility check (doubles cost; see the CLI reference for trade-offs).
Cache key: sha256(file_bytes)[:16] + schema_name + sha256(json.dumps(fields, sort_keys=True))[:12]
The cache invalidates automatically when:
- The file content changes (file hash changes)
- The schema changes (schema version changes)
- A different schema is applied to the same file (different key)
Schema definition
Two ways to define a schema:
1. Python class (recommended for code)
from docstore import ExtractionSchema
class ContractSchema(ExtractionSchema):
parties: list
start_date: str
end_date: str
obligations: list
auto_renews: bool
2. Natural language via CLI (recommended for ad-hoc use)
docstore shell ./contracts/
# > vendor name, contract start date, expiry date, whether it auto-renews
The orchestrator normalises your description into a canonical schema and shows it to you before running.
Supported file types
PDF, DOCX, TXT, MD, CSV, HTML, JSON
PDF support covers documents with embedded/selectable text. Scanned or image-only PDFs need OCR, which docstore does not support yet.
Limitations vs Lumient
docstore is a single-document extraction cache. It does not:
- Compose records across documents (invoice + Stripe ā reconciliation status)
- Trigger automatically when files arrive
- Maintain a queryable entity layer with lineage
- Support multi-step workflow logic (validate, diff, generate)
- Provide governance and audit trails for regulated industries
For cross-document composition and maintained operational records, see Lumient.
Development
# uv (recommended)
uv sync --all-extras
uv run pytest
uv run ruff check .
# Or with pip
pip install -e ".[dev]"
pytest tests/
See AGENTS.md for architectural invariants and CONTRIBUTING.md for the PR process.
License
MIT
Related Skills
claude-mem
113.5kPersistent Context Across Sessions for Every Agent ā Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
109.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
Understand-Anything
90.9kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
