Skip to main content

Updated 3 min read5 views

Stop Reading 500-Page PDFs: Why AI Agents Need Document Maps (DMAP) Instead of RAG

Fixed-size RAG chunks can split a pin table. DMAP indexes a datasheet without a model call and tells an agent which pages to open. See a real STM32F103 map.

Felix S. Pavel

Founder & Lead Architect

The Unseen Bottleneck in Technical AI Workflows

Building AI agents that work with engineering documentation, such as long microcontroller datasheets, component specifications and standards, raises one architectural question: how do you give the agent the context it needs without blowing your API budget or inviting guesses?

Developers often default to Retrieval-Augmented Generation (RAG) with vector embeddings over fixed-size chunks. RAG works reasonably well on narrative text, like blog posts or help center articles. On dense technical PDFs it can break down, for structural reasons.

Why Traditional RAG Struggles on Technical Datasheets

Hardware datasheets are not novels. They are dense structured data: pin tables spanning several pages, ball-grid maps, timing diagrams and absolute maximum rating tables. Fixed-size RAG has three weak points there:

  • Split evidence: a chunk boundary can cut a 144-pin table in half, separating pin numbers from their alternate functions.
  • Similarity misses: embeddings find text that sounds similar, but an engineering question needs one specific table. A query for “LQFP-64 pin assignments” can retrieve package prose instead of the pin table.
  • Context cost: sending a whole long PDF into a model's context costs tokens on every prompt, slows the answer, and gives the model more text to lose a detail in. That is the trap described in why PDF datasheets are broken for AI agents.

The Solution: Shift from Reading to Routing with DMAP

DMAP (Document Map) is a deterministic index of one PDF, built for AI agents, RAG systems and engineering tools.

Instead of making a model read the whole PDF or search arbitrary chunks, DMAP indexes the document without a single model call. It reads the PDF's text layer, table of contents and headings, and measures each page's geometry, then writes a machine-readable JSON map. The map says where each topic lives and what each page physically looks like. It does not contain extracted values.

A Real Map: ST's STM32F103C8 Datasheet

Here is part of the map DMAP builds for ST's 114-page STM32F103C8 datasheet. The whole agent map is about 31 KB of JSON, small enough to load into a model's context in one piece:

document_map.json, abridged

{
  "schema_version": "document_map_agent_v1",
  "document": {
    "sha256": "1e54ce18e6c34c5b…",
    "filename": "stm32f103c8.pdf",
    "total_pages": 114,
    "has_text_layer": true
  },
  "module_targets": [
    { "module_id": "absolute_max",
      "primary_pages": [37, 59],
      "candidate_pages": [36, 37, 38, 39, 58, 59, 60, 61],
      "confidence": "high",
      "sources": ["toc:Absolute maximum ratings", "…",
                  "keyword:caption:Table 33. ESD absolute maximum ratings"] },
    { "module_id": "operating_conditions",
      "primary_pages": [38],
      "confidence": "high",
      "sources": ["toc:Operating conditions", "…",
                  "keyword:caption:Table 9. General operating conditions"] },
    { "module_id": "pinout",
      "primary_pages": [26, 28],
      "confidence": "medium",
      "sources": ["toc:Pinouts and pin description",
                  "toc:Medium-density STM32F103xx pin definitions", "…"] }
  ]
}

All three targets land. Section 5.2, Absolute maximum ratings, is on page 37, and the ESD ratings in Table 33 are on page 59. Table 9, General operating conditions, is on page 38. For the pinout, page 26 holds the LQFP48 pinout figure and page 28 starts the pin table, Table 5. Page numbers are physical PDF pages, and the sha256 ties them to the exact file that was indexed.

The map is a route, not an answer, and it grades itself. It rates the pinout target only medium confidence, and the pin table runs on to page 33, past the two primary pages. Those pages are among its 29 candidate pages. That is why each target carries a confidence and a candidate list, not one page.

How an Agent Uses the Map

  1. The agent gets a question, for example “What is the absolute maximum supply voltage of the STM32F103C8?”
  2. It checks the map's sha256 against its copy of the PDF.
  3. It opens the target's primary pages first (here, 37 and 59).
  4. If the answer is not there, it widens to the candidate pages, and it treats a low or medium confidence as a reason to look harder.

Key Benefits for Engineers and AI Developers

Fewer tokens

Read the map, then only the pages it names, instead of the whole PDF on every prompt.

Pages tied to one file

Every page number refers to the exact PDF the SHA-256 names, so a reviewer can check the same page the agent read.

Getting Started with DMAP

DatasheetVend builds a document map for each uploaded document, and the extraction still runs if mapping fails. The API serves it at GET /api/v1/jobs/{id}/document-map. The DMAP page shows a full example.

Map your datasheet before your agent reads it.

A new account gets five free passes. Each pass runs up to two modules, pinout and footprint included, on a PDF up to 25 MB.

Sources

  1. STMicroelectronics, STM32F103x8/xB datasheet DS5319 Rev 20: section 5.2 on page 37, Table 9 on page 38, Table 33 on page 59, Figure 8 on page 26, Table 5 on pages 28 to 33
  2. DatasheetVend DMAP overview
  3. DatasheetVend API reference (GET /api/v1/jobs/{id}/document-map)

Was this useful?

A like tells other engineers it is worth their time.

Keep reading

All articles

Cookies. Strictly necessary cookies keep you signed in and remember this choice. Optional analytics (Google, Microsoft, PostHog) show us how the site is used. Cookie details