How cvxtz/document_ai_agents works
The repository provides document parsing and image-based question-answering, a parse-to-index-to-retrieve RAG workflow, a separate answer-verification workflow, and an optional tool-calling research agent. The README documents the parsing and RAG stages; source confirms their state-graph operations and the additional agents. The graph follows documented pipeline handoff and sampled calls; no UI workflow is inferred from the dependency list.
Main entry points: document_parsing_agent.py Render pages · document_rag_agent.py Retrieve and answer · tools.py Search and fetch tools · document_multi_tool_agent.py Tool-calling agent
Components 28
Document Parsing
- Render pages
document_ai_agents/document_parsing_agent.py - PDF utilities
document_ai_agents/document_utils.py - Image conversion
document_ai_agents/image_utils.py - Find layout items
document_ai_agents/document_parsing_agent.py - Summarized chunks
Retrieval QA
- Index documents
document_ai_agents/document_rag_agent.py - Chroma vector store
document_ai_agents/document_rag_agent.py - Retrieve and answer
document_ai_agents/document_rag_agent.py - Contextual answer
Document Verification
- Page images or text
- Answer with context
document_ai_agents/document_qa_agent.py - Reformulate assertion
document_ai_agents/document_qa_agent.py - Verify entailment
document_ai_agents/document_qa_agent.py - Answer and verification
Research Tools
- Tool-calling agent
document_ai_agents/document_multi_tool_agent.py - Dispatch tool calls
document_ai_agents/document_multi_tool_agent.py - Search and fetch tools
document_ai_agents/tools.py
Other components
- Document provider
- Questioner
- PDF document
- Gemini
- Gemini
- Gemini
- Research questioner
- Gemini
- Wikipedia
- DuckDuckGo
- Web pages
Connections 29
- Document provider → PDF document: provides
- PDF document → Render pages: parse
- Render pages → PDF utilities: render pages
- Render pages → Image conversion: encode pages
- Render pages → Find layout items: dispatch pages
- Find layout items → Gemini: analyze pages
- Find layout items → Summarized chunks: emit summaries
- Summarized chunks → Index documents: index input
- Questioner → Retrieve and answer: asks question
- Index documents → Chroma vector store: store embeddings
- Retrieve and answer → Chroma vector store: retrieve chunks
- Retrieve and answer → Gemini: generate answer
- Retrieve and answer → Contextual answer: returns answer
- Questioner → Page images or text: asks about pages
- Page images or text → Answer with context: provide context
- Answer with context → Gemini: generate answer
- Answer with context → Reformulate assertion: pass answer
- Reformulate assertion → Gemini: reformulate
- Reformulate assertion → Verify entailment: pass assertion
- Verify entailment → Gemini: check entailment
- Verify entailment → Answer and verification: returns result
- Research questioner → Tool-calling agent: asks question
- Tool-calling agent → Gemini: request response
- Tool-calling agent → Dispatch tool calls: dispatch calls
- Dispatch tool calls → Search and fetch tools: invoke tools
- Search and fetch tools → Wikipedia: search pages
- Search and fetch tools → DuckDuckGo: search web
- Search and fetch tools → Web pages: fetch content
- Dispatch tool calls → Tool-calling agent: return tool results