How mahfuz-raihan/agentic-rag-system works
This is a session-isolated, multi-agent RAG assistant for document questions, tabular analysis, and general chat. Users upload files and ask a question in the Chainlit UI; attachments are parsed into per-session text indexes or dataframes, then the LangGraph workflow routes the question to a specialist. Document retrieval and data analysis produce answers for critic review, with rejected answers rewritten and retried up to the workflow limit. README-described capabilities are included; wiring is based on the sampled UI, ingestion, agent, and graph code.
Main entry points: graph.py Agent graph · llm.py LLM clients · app.py Chainlit UI · ingestion.py File ingestion
Components 15
User interface
- Chainlit UI
ui/app.py
Ingestion and session data
- File ingestion
core/ingestion.py - Session store
core/session_store.py
Workflow orchestration
- Agent graph
core/graph.py - Workflow state
core/state.py
Specialist agents
- Supervisor
agents/supervisor.py - Document retrieval
agents/text_rag.py - Answer generation
agents/text_rag.py - Data analyst
agents/data_analyst.py - Answer critic
agents/critic_transformer.py - Query rewriting
agents/critic_transformer.py - General chat
agents/general.py
Model service
- LLM clients
core/llm.py
Other components
- User
- Azure OpenAI
Connections 26
- User → Chainlit UI: sends query
- Chainlit UI → File ingestion: processes attachments
- File ingestion → Session store: stores session data
- File ingestion → LLM clients: requests embeddings
- LLM clients → Azure OpenAI: calls embeddings
- Chainlit UI → Agent graph: invokes workflow
- Agent graph → Supervisor: dispatches
- Agent graph → Document retrieval: dispatches
- Agent graph → Answer generation: dispatches
- Agent graph → Data analyst: dispatches
- Agent graph → Answer critic: dispatches
- Agent graph → Query rewriting: dispatches
- Agent graph → General chat: dispatches
- Document retrieval → Session store: reads index
- Data analyst → Session store: reads dataframe
- Supervisor → LLM clients: creates chat client
- Document retrieval → Answer generation: passes documents
- Answer generation → LLM clients: creates chat client
- Data analyst → LLM clients: creates chat client
- Answer critic → LLM clients: creates chat client
- Query rewriting → LLM clients: creates chat client
- General chat → LLM clients: creates chat client
- LLM clients → Azure OpenAI: calls chat model
- Agent graph → Query rewriting: retries rejected answer
- Chainlit UI → User: streams answer and charts
- Agent graph → Chainlit UI: returns workflow updates