How cloudmantrabysom/enterprise-rag-assistant works
This is an enterprise conversational RAG assistant with an API and operator UI. Users submit questions, which pass input validation and enter a LangGraph workflow: adaptive routing selects document retrieval or web search; retrieved documents are graded, answers are generated and checked, and the final response is returned with sources. A separate ingestion path builds the FAISS index from PDFs. The README also documents RAGAS evaluation and LangSmith observability. Edges follow shown calls or documented behavior; unsampled evaluation details are not inferred.
Main entry points: graph.py RAG orchestrator · factory.py Model factory · main.py FastAPI endpoints · loader.py PDF ingestion
Components 22
User Interfaces
- FastAPI endpoints
src/main.py - Operator UI
app/streamlit_app.py
RAG Workflow
- Input/output checks
src/guardrails/validators.py - RAG orchestrator
src/rag/graph.py - Workflow state
src/rag/state.py - Query router
src/rag/router.py - Document retrieval
src/rag/nodes.py - Web search
src/rag/nodes.py - Document grading
src/rag/nodes.py - Answer generation
src/rag/nodes.py - Answer quality grading
src/rag/graders.py
Knowledge and Models
- PDF ingestion
src/ingestion/loader.py - FAISS index
src/ingestion/loader.py - Model factory
src/llm/factory.py - Runtime settings
src/config.py
Quality and Observability
- RAGAS evaluation
evaluation/run_ragas_eval.py - Tracing and usage
src/observability/tracing.py
Other components
- Questioner
- Azure OpenAI
- OpenAI fallback
- Tavily search
- LangSmith
Connections 33
- Questioner → FastAPI endpoints: asks via API
src/main.py - Questioner → Operator UI: asks in UI
app/streamlit_app.py - FastAPI endpoints → Input/output checks: validates input
src/main.py - FastAPI endpoints → RAG orchestrator: invokes
src/main.py - FastAPI endpoints → Input/output checks: validates output
src/main.py - FastAPI endpoints → PDF ingestion: starts ingestion
src/main.py - FastAPI endpoints → Tracing and usage: initializes tracing
src/main.py - Operator UI → Input/output checks: validates input
app/streamlit_app.py - Operator UI → RAG orchestrator: invokes
app/streamlit_app.py - Operator UI → Tracing and usage: initializes tracing
app/streamlit_app.py - RAG orchestrator → Workflow state: uses state
src/rag/graph.py - RAG orchestrator → Query router: routes query
src/rag/graph.py - RAG orchestrator → Document retrieval: dispatches retrieval
src/rag/graph.py - RAG orchestrator → Web search: dispatches search
src/rag/graph.py - RAG orchestrator → Document grading: dispatches grading
src/rag/graph.py - RAG orchestrator → Answer generation: dispatches generation
src/rag/graph.py - RAG orchestrator → Answer quality grading: grades answer
src/rag/graph.py - Query router → Model factory: gets model
src/rag/router.py - Document retrieval → FAISS index: retrieves chunks
src/ingestion/loader.py - Web search → Tavily search: searches web
src/rag/nodes.py - Document grading → Answer quality grading: uses grader builders
src/rag/nodes.py - Answer generation → Model factory: gets model
src/rag/nodes.py - Answer quality grading → Model factory: gets model
src/rag/graders.py - PDF ingestion → FAISS index: builds and loads
src/ingestion/loader.py - PDF ingestion → Model factory: gets embeddings
src/ingestion/loader.py - Document retrieval → PDF ingestion: gets retriever
src/rag/nodes.py - Model factory → Runtime settings: reads settings
src/llm/factory.py - PDF ingestion → Runtime settings: reads paths and tuning
src/ingestion/loader.py - Model factory → Azure OpenAI: uses configured provider
src/llm/factory.py - Model factory → OpenAI fallback: falls back to
src/llm/factory.py - Tracing and usage → Runtime settings: reads settings
src/observability/tracing.py - Tracing and usage → LangSmith: enables tracing
src/observability/tracing.py - RAGAS evaluation → RAG orchestrator: evaluates answers
evaluation/run_ragas_eval.py