Insurance RAG System Documentation
This directory contains architecture decision records (ADRs) for the Insurance RAG System migration from ChromaDB to Qdrant.
Quick Links
| ADR | Title | Status |
|---|---|---|
| 0001 | Single Collection with Metadata Filtering | Accepted |
| 0002 | Hybrid Chunking Strategy | Accepted |
| 0003 | Dual Embedding Model Strategy | Accepted |
| 0004 | Dual Reranking Strategy | Accepted |
| 0005 | Retrieval Evaluation Framework | Accepted |
| 0006 | Qdrant Docker Deployment | Accepted |
| 0007 | Hybrid Search (Dense + Sparse) | Accepted |
| 0008 | Metadata Schema | Accepted |
| 0009 | API-Based Continuous Ingestion | Accepted |
| 0010 | Full-Context Query Pipeline | Accepted |
| 0011 | Ollama Inference on RTX 3090 | Accepted |
| 0012 | Langfuse Observability + API Key Auth | Accepted |
Architecture Overview
Problem Context
The current system uses ~30 collections in ChromaDB, requiring query classification before retrieval. Misclassification leads to irrelevant results with no recovery path. Insurance domains are semantically similar, making classification non-trivial.
Key Constraints
- Infrastructure Instability — Iran's internet blackouts (up to 90 days) require fully offline capability
- Bilingual Content — Persian (Farsi) and English documents and queries
Core Decisions
| Decision Point | Choice | Rationale |
|---|---|---|
| Collection Strategy | Single collection + metadata filtering | Eliminates classification failure mode |
| Chunking | Hybrid: semantic for unstructured, row-by-row for tabular | Markdown-first pipeline |
| Embeddings | Dual: OpenAI (online) + Nomic (offline) | Resilience during blackouts |
| Reranking | Dual: Cohere (online) + BGE (offline) | Precision across domains |
| Vector DB | Qdrant Docker | Fully on-prem, excellent filtered search |
| Search | Hybrid: dense + sparse (BM25) | Exact term matching + semantic similarity |
| Inference | Ollama + Qwen 2.5 on RTX 3090 | Local bilingual LLM |
| Observability | Langfuse | Full tracing and access control |
Related Documents
- Domain Model (CONTEXT.md) — Glossary, constraints, and architecture decisions summary
- Original Grilling Input — Research request that drove these decisions