Start with the search job
Decide whether the user wants a document, a passage, a product, or a recommended example. Search quality depends on the unit you retrieve. A whole 200-page manual is usually a poor result; a titled passage with a link is more useful.
The implementation path
- Clean and split the source material.
- Create embeddings with a named, versioned model.
- Store the vector beside the original text and metadata.
- Embed the query with the same model.
- Retrieve candidates and filter by permissions, date, and type.
- Show the result with enough surrounding context to verify it.
Hybrid search is often better
Semantic similarity handles different wording. Keyword or SQL filters handle exact IDs, product names, dates, and access rules. Combining them is usually safer than asking a vector score to do every job.
Measure the search
Build a small set of questions with known supporting passages. Track whether the right passage appears near the top, whether irrelevant results crowd it out, and whether users can act on the returned result.