Overview
Pipeline
| Stage | Choice | Why |
|---|---|---|
| Chunking | 300 words, 30% overlap, 50-word minimum | Enough context per chunk; the overlap keeps rules that span a boundary intact |
| Embeddings | all-MiniLM-L6-v2 (384-dim) | Small and fast (~50 ms per query) with strong semantic matching |
| Vector store | FAISS flat index, L2-normalised (cosine) | Exact search; the whole index is under 1 MB |
| Retrieval | Top-5 chunks, similarity ≥ 0.25 | Rejects weak matches instead of guessing |
| Generation | GPT-4o-mini, temperature 0.3 | Low temperature keeps answers factual and close to the source |
Engineering decisions
- Refuse rather than hallucinate: if no chunk clears the 0.25 similarity threshold, the assistant says the handbook doesn't cover the question instead of improvising.
- Measure it: every prompt and retrieval is logged, and a technical report records the configuration, retrieval scores and example results so the choices can be checked and tuned.
Tech stack
Python
OpenAI
Hugging Face
