How gowtham95bi/airag works
This is a small Q&A assistant capstone: a Streamlit client sends questions to a FastAPI service, which delegates answer generation to an async pipeline. The pipeline loads CSV questions for batch runs, retries model calls, summarizes executions, and writes JSON and SQLite results; saved runs can be queried separately. The README also documents switching between a fake model and a real API. The learning examples are intentionally excluded. Edges reflect the sampled call sites and README; unsampled wiring is not inferred.
Main entry points: pipeline.py Async Pipeline · app.py Streamlit UI · main.py HTTP API · store.py SQLite Persistence
Components 15
User Interface
- Streamlit UI
ui/app.py
API Service
- HTTP API
api/main.py
Answer Pipeline
- Async Pipeline
src/pipeline/pipeline.py - Batch and Retry
src/pipeline/pipeline.py - Model Adapter
src/pipeline/pipeline.py - Fake Model
src/pipeline/fake_llm.py - Runtime Settings
src/pipeline/settings.py - JSON Logging
src/pipeline/logging_config.py - Question CSV
data/questions.csv
Run Records
- Run Summary
src/pipeline/settings.py - JSON Results
- SQLite Persistence
src/pipeline/store.py - Run Query
src/pipeline/query_results.py
Other components
- Questioner
- OpenAI API
Connections 14
- Questioner → Streamlit UI: asks
ui/app.py - Streamlit UI → HTTP API: posts question
ui/app.py - HTTP API → Async Pipeline: calls
api/main.py - Async Pipeline → Question CSV: loads
src/pipeline/pipeline.py - Async Pipeline → Batch and Retry: runs
src/pipeline/pipeline.py - Batch and Retry → Model Adapter: retries calls
src/pipeline/pipeline.py - Async Pipeline → Runtime Settings: reads config
src/pipeline/pipeline.py - Async Pipeline → JSON Logging: logs events
src/pipeline/pipeline.py - Model Adapter → Fake Model: uses when enabled
src/pipeline/pipeline.py - Model Adapter → OpenAI API: calls when enabled
- Async Pipeline → Run Summary: aggregates
src/pipeline/pipeline.py - Async Pipeline → JSON Results: writes results
src/pipeline/pipeline.py - Async Pipeline → SQLite Persistence: persists run and answers
src/pipeline/pipeline.py - Run Query → SQLite Persistence: queries saved records
src/pipeline/query_results.py