MCPDOC
Documentation Agent callable by any other agent
Created on 22nd June 2025
•
MCPDOC
Documentation Agent callable by any other agent
The problem MCPDOC solves
Problem
Documentation agents change more often than LLMs are updated, leading to hallucinations.
Web searches might retrieve outdated results too.
Therefore:
When working with a cutting-edge new library, your coding agent should interact directly with a documentation agent in plain text — without requiring the user to first set up RAG.
Solution
The llms.txt standard + direct markdown file links
→ Enables quick creation of a documentation agent powered by Agentic RAG
→ Works for any site providing a llms.txt file
Scalability:
An artificial llms.txt file can be created by scraping documentation.
This approach scales to any documentation.
Algorithm
Indexing
- Takes a
llms.txtURL (acts as an index) - Fetches all links, saves as
.md, preserving folder structure - Summarizes each file in parallel with
gpt-4o-mini - Concatenates all summaries into a
detailed_index.md - Agent is initialized with
detailed_index.mdin system prompt- tool to read full files
Retrieval
- User asks a question about the documentation
- Agent reads relevant files using the
detailed_index.mdas a guide
Future Versions
- Allow setting a custom system prompt for the agent
- Multi-agent system:
- Each expert handles a section of the documentation
- Benefit: load full subparts into each expert’s prompt, avoid reading files
- Index site as a knowledge graph using hyperlink structure
→ Enables more efficient traversal and retrieval
Economy of scale:
Doc owner creates and maintains a good documentation agent once
→ Benefits all readers
→ Owner is alerted when changes are needed
Why Agentic RAG > Cosine Similarity
- Cursor’s doc feature is not useful
- Let the agent reason about relevant context
- Traverse the site graphically:
- Start from a file
- Identify missing context
- Read linked/related files
→ No need for a separate knowledge graph
Progress made before hackathon
Draft + ideation
Technologies used
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.