How mohamedyaakoubi/rbg-arsii-rag works
This is a bilingual French/English RAG search application for bakery-product technical sheets. Users submit a question through the Streamlit UI or CLI; search embeds query variants, retrieves and ranks fragments by cosine similarity, and returns up to three results. A separate ingestion workflow extracts and chunks PDFs, creates original and enriched embeddings, and stores them in PostgreSQL with pgvector. The README documents entity-aware chunking, bilingual dosage labels, translation, and multi-entity query handling. Those details are represented at their owning modules; unsampled internals are not expanded into unsupported call edges.
Main entry points: ingestion_data.py Ingestion and embedding enrichment · search_service.py Bilingual search and query decomposition · models.py Embedding persistence and cosine search · app.py Streamlit UI
Components 13
User interfaces
- Streamlit UI
app.py - Interactive CLI
main.py
Semantic retrieval
- Bilingual search and query decomposition
services/search_service.py - Sentence embeddings
services/embedding_service.py
PDF ingestion
- Ingestion and embedding enrichment
services/ingestion_data.py - PDF extraction and entity chunking
services/pdf_processor.py
Vector persistence
- Embedding persistence and cosine search
database/models.py - PostgreSQL connection
database/connection_pg.py - PostgreSQL with pgvector
- Runtime configuration
config/settings.py - Application logging
utils/logger.py
Other components
- Questioner
- Bakery PDF corpus
data_pdf
Connections 15
- Questioner → Streamlit UI: asks through
app.py - Questioner → Interactive CLI: asks through
main.py - Streamlit UI → Bilingual search and query decomposition: submits query
app.py - Streamlit UI → Ingestion and embedding enrichment: requests re-ingestion
app.py - Interactive CLI → Bilingual search and query decomposition: submits query
main.py - Interactive CLI → Ingestion and embedding enrichment: starts ingestion
main.py - Bilingual search and query decomposition → Sentence embeddings: embeds query variants
services/search_service.py - Bilingual search and query decomposition → Embedding persistence and cosine search: requests cosine search
services/search_service.py - Bakery PDF corpus → Ingestion and embedding enrichment: supplies PDFs
README.md - Ingestion and embedding enrichment → PDF extraction and entity chunking: processes PDFs
services/ingestion_data.py - Ingestion and embedding enrichment → Sentence embeddings: embeds chunks
services/ingestion_data.py - Ingestion and embedding enrichment → Embedding persistence and cosine search: creates and inserts embeddings
services/ingestion_data.py - Embedding persistence and cosine search → PostgreSQL connection: opens database connection
database/models.py - PostgreSQL connection → PostgreSQL with pgvector: connects to
database/connection_pg.py - Embedding persistence and cosine search → PostgreSQL with pgvector: stores and ranks vectors
database/models.py