How mohamed-aziiz/rag_uha works
Assistant UHA answers French or English questions about university documents through a shared interface, with classical RAG and GraphRAG offered side by side. The documented preparation stage loads and chunks source documents; both retrieval architectures use those same chunks and embeddings, then generate cited answers using a shared prompt. GraphRAG additionally extracts entities and relations and supplies a graph summary. Evaluation compares retrieval and answer quality, costs, and latency. README documents the main flow; some implementation details are unsampled, so links for those branches are limited to documented relationships.
Main entry points: rag.py Classical RAG · graphrag.py GraphRAG pipeline · streamlit_app.py Streamlit interface · graph_index.py Graph index
Components 22
Document preparation
- Document loaders
src/rag_uha/loaders.py - Shared chunking
src/rag_uha/chunking.py
Retrieval architectures
- Classical RAG
src/rag_uha/pipelines/rag.py - Chroma vector index
src/rag_uha/indexing/vector_index.py - GraphRAG pipeline
src/rag_uha/pipelines/graphrag.py - Graph index
src/rag_uha/indexing/graph_index.py
Shared answer services
- Pipeline selector
src/rag_uha/pipelines/base.py - Settings
src/rag_uha/config.py - BGE-M3 embeddings
src/rag_uha/embeddings.py - LLM client
src/rag_uha/llm.py - Answer prompts
src/rag_uha/prompts.py - Answer result
src/rag_uha/types.py
Application and evaluation
- Streamlit interface
app/streamlit_app.py - Evaluation questions
src/rag_uha/eval/dataset.py - Evaluation runner
src/rag_uha/eval/runner.py - Retrieval metrics
src/rag_uha/eval/metrics.py - RAGAS judging
src/rag_uha/eval/ragas_eval.py - Evaluation reports
src/rag_uha/eval/report.py - Graph visualization
src/rag_uha/viz.py
Other components
- Questioner
- LLM API
- Embedding API
Connections 30
- Questioner → Streamlit interface: asks
README.md - Streamlit interface → Pipeline selector: selects
app/streamlit_app.py - Pipeline selector → Classical RAG: builds
src/rag_uha/pipelines/base.py - Pipeline selector → GraphRAG pipeline: builds
src/rag_uha/pipelines/base.py - Document loaders → Shared chunking: provides documents
README.md - Shared chunking → Chroma vector index: indexes chunks
README.md - Shared chunking → Graph index: indexes chunks
README.md - BGE-M3 embeddings → Chroma vector index: embeds chunks
README.md - BGE-M3 embeddings → Graph index: embeds entities
README.md - Graph index → LLM client: extracts graph
README.md - Classical RAG → Chroma vector index: searches
src/rag_uha/pipelines/rag.py - GraphRAG pipeline → Graph index: queries graph
src/rag_uha/pipelines/graphrag.py - Classical RAG → Answer prompts: formats context
src/rag_uha/pipelines/rag.py - GraphRAG pipeline → Answer prompts: formats context
src/rag_uha/pipelines/graphrag.py - Classical RAG → LLM client: generates answer
src/rag_uha/pipelines/rag.py - GraphRAG pipeline → LLM client: generates answer
src/rag_uha/pipelines/graphrag.py - LLM client → LLM API: calls
src/rag_uha/llm.py - BGE-M3 embeddings → Embedding API: requests vectors
src/rag_uha/embeddings.py - Classical RAG → Answer result: returns
src/rag_uha/pipelines/rag.py - GraphRAG pipeline → Answer result: returns
src/rag_uha/pipelines/graphrag.py - Streamlit interface → Graph visualization: renders graph
app/streamlit_app.py - Streamlit interface → Graph index: reads graph data
app/streamlit_app.py - Evaluation questions → Evaluation runner: supplies questions
src/rag_uha/eval/runner.py - Evaluation runner → Pipeline selector: runs questions
src/rag_uha/eval/runner.py - Evaluation runner → Retrieval metrics: scores retrieval
src/rag_uha/eval/metrics.py - Evaluation runner → RAGAS judging: judges answers
README.md - RAGAS judging → LLM client: uses judge model
src/rag_uha/eval/ragas_eval.py - Retrieval metrics → Evaluation reports: summarizes scores
src/rag_uha/eval/report.py - RAGAS judging → Evaluation reports: provides scores
src/rag_uha/eval/report.py - Answer result → Streamlit interface: displays results
README.md