How tuanduy35399/agent_rag_langchain works
This is a Streamlit document-Q&A application using retrieval-augmented generation. Users upload files, which are parsed and chunked into a PostgreSQL vector store; questions invoke a DeepAgent that searches for relevant chunks, saves them as Markdown in its virtual filesystem, delegates chunk analysis, and synthesizes an answer. The repository also has a PDF-based indexing path. The excerpts show the principal calls and configuration; unsampled portions of the UI and framework internals are not mapped.
Main entry points: agent.py DeepAgent · main.py Streamlit Q&A · indexing.py PDF indexer · tools.py Documentation search
Components 14
Document ingestion
- Upload parsing
main.py - Chunk splitting
main.py - PDF reader
file_reader.py - PDF indexer
indexing.py
Retrieval and storage
- Vector store
indexing.py - Documentation search
tools.py - Agent file backend
tools.py
Agent answering
- DeepAgent
agent.py - Workflow prompts
prompts.py - Chunk analyst
agent.py - Chat model
User interface
- Streamlit Q&A
main.py - Answer display
main.py
Other components
- Document user
Connections 16
- Document user → Streamlit Q&A: uploads and asks
main.py - Streamlit Q&A → Upload parsing: parses uploads
main.py - Upload parsing → Chunk splitting: produces documents
main.py - Chunk splitting → Vector store: indexes chunks
main.py - Streamlit Q&A → PDF indexer: uses indexing resources
main.py - PDF indexer → PDF reader: reads PDFs
indexing.py - PDF indexer → Vector store: stores chunks
indexing.py - Streamlit Q&A → DeepAgent: invokes agent
main.py - DeepAgent → Documentation search: registers search tool
agent.py - Documentation search → Vector store: similarity searches
tools.py - Documentation search → Agent file backend: uploads Markdown chunks
tools.py - DeepAgent → Workflow prompts: loads prompts
agent.py - DeepAgent → Chunk analyst: registers subagent
agent.py - Chunk analyst → Agent file backend: reads retrieved files
agent.py - DeepAgent → Chat model: configures chat model
agent.py - Streamlit Q&A → Answer display: displays response
main.py