How cristian-lillo-dev/dbrag_elec works
This repository implements a retrieval-augmented question-answering service for Chilean RIC electrical regulations, plus PDF ingestion and database-inspection utilities. The main workflow is a user question sent to the API, retrieved regulatory context, and a generated answer with sources. A separate ingestion workflow loads PDFs, chunks and enriches them, and updates a persistent vector store and JSON manifest. The excerpts show these workflows in main.py and ingest.py; connections not shown directly are omitted or marked unverified.
Main entry points: ingest.py Ingestion runner · main.py RIC API · consulta.py Question CLI · estado_db.py Ingest registry
Components 16
PDF ingestion
- Ingestion runner
ingest.py - PDF loading
ingest.py - Chunk preparation
ingest.py - Local embeddings
ingest.py - Chroma store
ingest.py - Ingest manifest
ingest.py
Question answering
- RIC API
main.py - Context retrieval
main.py - Answer generation
main.py
Database utilities
- Ingest registry
estado_db.py - Ingest status CLI
estado_db.py - SQLite inspection CLI
ver_sqlite.py
Other components
- Questioner
- Question CLI
consulta.py - Groq model API
- SQLite database
Connections 14
- Questioner → Question CLI: asks via
consulta.py - Question CLI → RIC API: posts question
consulta.py - RIC API → Context retrieval: invokes search
main.py - Context retrieval → Chroma store: searches
- RIC API → Answer generation: provides context
main.py - Answer generation → Groq model API: requests answer
main.py - Ingestion runner → PDF loading: loads PDFs
ingest.py - Ingestion runner → Chunk preparation: prepares chunks
ingest.py - Ingestion runner → Local embeddings: configures embeddings
ingest.py - Ingestion runner → Chroma store: updates vectors
ingest.py - Ingestion runner → Ingest manifest: writes registry
ingest.py - RIC API → Ingest registry: reads registry
main.py - Ingest status CLI → Ingest registry: reads registry
estado_db.py - SQLite inspection CLI → SQLite database: inspects database
ver_sqlite.py