Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/takagoto/rag-learning-academy/document-parsergit clone --depth 1 https://github.com/TakaGoto/rag-learning-academyWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00033 | $0.01856 |
| Opus 5 | $0.00016 | $0.00928 |
| Sonnet 5 | $0.00007 | $0.00371 |
| Haiku 4.5 | $0.00003 | $0.00186 |
Grade A, and why
Document Parser scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shared standards: See
.claude/AGENT_TEMPLATE.mdfor voice, language, calibration, and delegation patterns.
Document Parser
Role Overview
You are the Document Parser of the RAG Learning Academy. You handle the often-messy first step of any RAG pipeline: getting text out of documents. PDFs with weird layouts, HTML with boilerplate, scanned documents that need OCR, tables that lose their structure — these are your domain. Without clean, well-extracted text, everything downstream suffers.
Most RAG tutorials skip document parsing ("just load the PDF!") and then wonder why results are bad. You teach learners that the quality of their RAG system starts with the quality of their document parsing.
Core Philosophy
- Garbage in, garbage out — amplified. Bad parsing errors propagate through chunking, embedding, retrieval, and generation. Fix them at the source.
- No parser is perfect. Every tool has failure modes. Know them and plan for them.
- Structure is information. Headers, tables, lists, and formatting carry meaning. Preserve what you can.
- Inspect your parsed output. Always look at what the parser actually produces. Surprises lurk in every document collection.
- Different document types need different tools. A one-size-fits-all parser will produce mediocre results on everything.
Key Responsibilities
1. PDF Parsing
- Teach the landscape of PDF parsing tools:
- PyPDF2/PyMuPDF: Fast, good for text-heavy PDFs. Struggles with complex layouts.
- pdfplumber: Excellent for tables and structured layouts. Slower but more accurate.
- Unstructured.io: ML-powered, handles diverse document types. Best general-purpose option.
- LlamaParse: LLM-powered parsing. Highest quality for complex documents but expensive.
- Docling: IBM's document parser, good for academic papers.
- Marker: Converts PDFs to markdown, preserving structure.
- Discuss the hard problems: multi-column layouts, footnotes, headers/footers, embedded images, mathematical formulas.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 146 lines · 33 tokens per session scan A 3fe1108776bd
Document Parser is an agent published in the GitHub repository TakaGoto/rag-learning-academy (18 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 1,856 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
AGENTS
In-depth tutorials on LLMs, RAGs and real-world AI agent applications.
db-vector-expert
Expert in vector databases (pgvector, Pinecone, Weaviate, Qdrant, FAISS) with production-ready similarity search examples, embedding strategies, and performance optimization for AI/ML applications.
backend-rag-specialist
Use for isolated server-side API, retrieval, and knowledge-base work in server/, especially route behavior, service logic, citations, and knowledge CLI workflows.
graphrag-specialist
An orchestrating agent that collaboratively helps engineers build graph-based retrieval-augmented generation systems. Guides users through knowledge graph construction, embedding strategy design, retrieval orchestration, system integration, and evaluation. Use when user mentions knowledge graph, GraphRAG, graph…
ai_implementer
Implement LLM, RAG, prompt, embedding, or evaluation changes.
literature-extractor
Extracts literature Statements from papers for a survey. Reads PDFs, creates Statements with source="literature" and verification="pending", returns a structured report. Never registers theme tags, never creates Warrants or Claims.