Industrial RAG Assistant
An assistant that answers technical questions from plant manuals, and cites its sources.
- Role
- End-to-end design and development
- Period
- Fall 2026
- Stack
- Python, FastAPI, PostgreSQL, pgvector, Gemini, Next.js, Docker
- right passage ranked first (3-document corpus)
- 12/12
- rankings fused: vectors, text, exact codes
- 3
- models to choose from: Gemini or Claude
- 2
Try it
Ask my background a question.
The assistant’s idea, applied to this site: your question retrieves the most relevant passages, and each answer cites its source.
01The problem
In a factory, the answer often already exists, but it is buried in manuals, maintenance procedures and datasheets. The assistant has to answer and show its sources.
02Architecture
- 01DocumentsManuals, procedures, datasheets
- 02IngestionFastAPI
- 03Hybrid searchPostgreSQL, pgvector
- 04Cited answerGemini, Next.js
03Decisions
- 1Define service boundaries, the data model and the v1 API contracts first: ingest, ask and health.
- 2Make every answer verifiable: the API checks the citations and discards an answer with no valid source.
- 3Combine vector search, French full-text and exact codes, because embeddings handle a reference like T88-PROBE-02 poorly.
- 4Decline to answer below a relevance threshold rather than make something up.
- 5Work without an API key: with no key, or when the provider is down, the app shows the most relevant passages unchanged, and says so.
- 6Treat passages as data: the model ignores instructions hidden inside documents.
- 7Run all services through Docker Compose.
04Where it stands
The full pipeline works: PDF ingestion, hybrid search, cited answers and automated evaluation in CI. On a small corpus of 3 documents, the right passage ranks first for 12 questions out of 12.