How LLMs Read Docs (www.aiwiki.dev)

🤖 AI Summary
The note outlines a practical problem: LLM-based coding agents currently bloat their contexts by ingesting huge, messy documentation files (examples >380k tokens) during pretraining or retrieval, much of which is irrelevant, outdated, or even unusable (e.g., React components, large images, or scraped HTML). That wastes tokens and compute (Claude Code’s ~200k token context is cited), forces repeated web scraping across many agents, and produces unreliable results because pages may not exist or are poorly formatted. Provider-specific tools (MCPs) and ad-hoc scrapers add further fragmentation and inconsistency. The proposed solution is a single, structured “read” tool / unified docs graph that returns the exact snippet an agent needs (e.g., read(shadcn/directory/…/cards) yields a small, ready-to-use markdown block with tags, usage, and install commands). Technical implications: combine canonical documentation into a post-processed, chunked knowledge source with deterministic routes plus vectorized search fallbacks for unknown paths; validate existence and provide fallback scenarios; and standardize read schemas to avoid per-provider tool bloat. Though building this consolidated index is compute- and labor-intensive, much of the preprocessing (formatting, chunking, deduplication) can be automated with AI, reducing redundant scraping, cutting context size, improving reliability, and lowering LLM inference costs for coding agents.
Loading comments...
loading comments...