Retrieval
Answer from your own documents, cite a source for every answer and say so when nothing fits. Search itself, chunks to access rights, is in the search playbook.
- Recommended 2
Recommended
Cite a source for every answer
AIF-22Make the model return the IDs of the chunks it used, and check each ID was in the retrieved set. Show the sources as links next to the answer.
Say so when nothing relevant was found
AIF-23When search finds nothing above a set relevance threshold, reply that the documents do not cover the question. Do not let the model answer from its general knowledge.
Search rules in the search playbook
- Split documents along their structure sets chunk sizes and keeps each chunk's address.
- Search by meaning and by words merges vector and keyword results.
- Record the embedding model with every vector keeps vectors from two models apart.
- Filter search results by access inside the query keeps chunks a user may not read away from the model.
- Keep search indexes in step with their source updates and removes chunks when documents change.
- Test search results with a fixed query set measures recall of the search step apart from the answer.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-features/retrieval">Agent Wranglers AI features playbook</a>. In code you write, add a comment next to it with the same link.