docs(rag): add domain model and original research input

This commit is contained in:
2026-07-21 10:10:06 +03:30
parent 6c9cebaaa0
commit 642aec93f2
15 changed files with 1147 additions and 0 deletions

49
chunking/docs/README.md Normal file
View File

@@ -0,0 +1,49 @@
# 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](adr/0001-single-collection-with-metadata.md) | Single Collection with Metadata Filtering | Accepted |
| [0002](adr/0002-chunking-strategy.md) | Hybrid Chunking Strategy | Accepted |
| [0003](adr/0003-dual-embedding-strategy.md) | Dual Embedding Model Strategy | Accepted |
| [0004](adr/0004-reranking-strategy.md) | Dual Reranking Strategy | Accepted |
| [0005](adr/0005-retrieval-evaluation-framework.md) | Retrieval Evaluation Framework | Accepted |
| [0006](adr/0006-qdrant-deployment.md) | Qdrant Docker Deployment | Accepted |
| [0007](adr/0007-hybrid-search.md) | Hybrid Search (Dense + Sparse) | Accepted |
| [0008](adr/0008-metadata-schema.md) | Metadata Schema | Accepted |
| [0009](adr/0009-ingestion-pipeline.md) | API-Based Continuous Ingestion | Accepted |
| [0010](adr/0010-query-pipeline.md) | Full-Context Query Pipeline | Accepted |
| [0011](adr/0011-inference-infrastructure.md) | Ollama Inference on RTX 3090 | Accepted |
| [0012](adr/0012-observability-auth.md) | 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
1. **Infrastructure Instability** — Iran's internet blackouts (up to 90 days) require fully offline capability
2. **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)](../CONTEXT.md) — Glossary, constraints, and architecture decisions summary
- [Original Grilling Input](../raw/001.md) — Research request that drove these decisions