Agentic RAG for Manufacturing
Three-agent RAG pipeline (Router → Retriever → Generator) for manufacturing equipment manuals and safety SOPs, running offline via Milvus Lite and Ollama with mandatory page-level source citations.
PythonFastAPIMilvusOllamaLangChain
Problem Statement
Manufacturing environments rely on vast libraries of equipment manuals, safety SOPs, and maintenance logs. Engineers waste hours searching through PDFs for a single specification or procedure. Traditional keyword search fails because queries like "What's the LOTO procedure for the hydraulic press?" require semantic understanding.
Architecture
The system uses a three-agent agentic pipeline:
- Router Agent — Classifies intent as retrieval, direct answer, or multi-part query
- Retriever Agent — Searches ingested documents using semantic similarity via Milvus Lite
- Generator Agent — Creates responses with mandatory source citations including page numbers
Key Design Decisions
- On-Premise First: Runs completely offline with Ollama + Milvus Lite → no cloud dependency for air-gapped factory floors
- Multi-Format Ingestion: Handles PDF, DOCX, Excel, PowerPoint, and plain text
- Smart Query Decomposition: Breaks complex questions into sub-queries for higher accuracy
- Audit-Ready Citations: Every answer references the source document and page number
Tech Stack
| Layer | Technology |
|---|---|
| LLM | Ollama (local) or Azure OpenAI |
| Vector DB | Milvus Lite |
| Backend | FastAPI |
| Orchestration | LangChain |
Results
The system achieves high retrieval accuracy on manufacturing-specific terminology (LOTO, PPE, equipment IDs) and provides traceable answers suitable for compliance audits.