← All posts

Small tools, big documents: MCP retrievers for 1,000-page files

Scientific documents run to a thousand pages, with tables inside tables, formulas and figures. Dumping chunks into a vector store loses the structure that makes them answerable.

Parse for structure first

Azure Document Intelligence plus custom XML handling gives you sections, tables and figures as real objects. Keep the section tree — it is the most useful index you have.

Expose small tools, not one big search

Instead of a single search call, give agents two MCP tools:

  • find_documents(query) — which files matter?
  • get_section(doc_id, query) — which section answers this?

Small tools are easier for agents to choose between, easier to test, and easy to reuse across products.

Scale the boring way

Retrieval runs as Celery workers behind a message queue on Amazon EKS. Workers scale on queue depth, which is what let the layer serve 10,000+ concurrent users. Every call is traced in Langfuse, so a bad answer can be followed back to the exact section that was retrieved.

Keep reading

Subagents, hooks and skills: the three levers of a Claude Code harness

How I split work across subagents, enforce behaviour with hooks, and package know-how as skills — the setup behind agents that automate 50,000+ hours a year.

From PDFs in S3 to searchable data: an ingestion pipeline that reruns safely

How I structure Airflow + Amazon Textract pipelines so a failed night never means duplicate or missing records.