# Implementation Guide

Search Engineering · Implementation Guide

Interactive edition: https://mutapa.dev/search-engineering/build

Build a retrieval-augmented system in plain Python, from corpus preparation and BM25 through generation, evaluation, permissioned retrieval, policy context, and connector contracts.

1. [Setup and Corpus](https://mutapa.dev/search-engineering/build/setup-and-corpus.md): Prepare a clean corpus and a reproducible Python environment for every chapter that follows.
2. [The Baseline: BM25](https://mutapa.dev/search-engineering/build/the-baseline-bm25.md): Build an inspectable keyword baseline before adding semantic retrieval.
3. [Add Embeddings](https://mutapa.dev/search-engineering/build/add-embeddings.md): Turn the corpus into a verified vector artifact with a hosted or local embedding model.
4. [Vector Retrieval (FAISS kNN)](https://mutapa.dev/search-engineering/build/vector-retrieval-faiss-knn.md): Search the embedding space with FAISS and compare semantic results with BM25.
5. [Hybrid Retrieval with RRF](https://mutapa.dev/search-engineering/build/hybrid-retrieval-with-rrf.md): Fuse keyword and vector rankings while preserving evidence from both retrievers.
6. [Generation](https://mutapa.dev/search-engineering/build/generation.md): Generate grounded answers from retrieved evidence and reject invalid provenance.
7. [Evaluation](https://mutapa.dev/search-engineering/build/evaluation.md): Measure retrieval coverage, ranking quality, and grounded-generation behavior with validated judgments.
8. [Where to Go Next](https://mutapa.dev/search-engineering/build/where-to-go-next.md): Choose the next change from measured failures, route model work by difficulty, and run an observable bounded search-revision loop.
9. [Build Permissioned Retrieval](https://mutapa.dev/search-engineering/build/build-permissioned-retrieval.md): Authorize records before ranking, scope derived artifacts and caches, and measure filtered-vector recall against an exact eligible baseline.
10. [Carry Policy Context](https://mutapa.dev/search-engineering/build/carry-policy-context.md): Separate trace correlation from verified authority, validate every protected receiver, and reauthorize saved state when a trajectory resumes.
11. [Build Connector Contracts](https://mutapa.dev/search-engineering/build/build-connector-contracts.md): Classify connectors by role, return typed outcomes, budget retries, and reconcile ambiguous effects before replay.
