Agent Wranglers

Search playbook

Rules for search in apps, sites and AI features. Keyword, vector and hybrid search, indexes kept in step, access filters, language handling and tests.

  • Required 3
  • Recommended 14
  • Optional 2

A search playbook for the search box in an app or a website, and for the search step behind AI answers. It covers the database's own full-text index, separate search engines such as OpenSearch, and vector search, alone or together.

It starts with choosing the engine and building the index. Then it covers keeping each index a lean, current copy, and filtering every hit by who may see it. The last chapters cover language, from word endings to compound words, and tests that show when a change makes results worse.

A search index is a copy of your data that answers anyone who types. So the rules that keep it in step and filtered by access matter as much as the ranking.

AI answers that cite their sources follow the Retrieval chapter of the AI features playbook. Being found by outside search engines is in the SEO playbook, and sorting text by locale is in the localization playbook.

Chapters

  1. Engines and indexes

    Search inside the database first, add meaning with vectors when tests show a gain, record the embedding model, and split long documents by their structure.

    • Recommended 4
    • Optional 1
  2. Index contents and sync

    Keep each index a lean copy of its source, update it through a queue, remove erased records everywhere, and rebuild it without taking search down.

    • Required 1
    • Recommended 3
  3. Access and limits

    Filter every hit by who may see it inside the query, cap the size of each search, and keep personal data out of search logs.

    • Required 2
    • Recommended 1
  4. Language and matching

    Set the language of every field and split compound words. Match plain questions, and store the words people use for each item.

    • Recommended 3
    • Optional 1
  5. Relevance

    Test results with a fixed, labelled query set, say when nothing fits instead of padding, and watch searches that find nothing or get no click.

    • Recommended 3

All 19 rules on one page

This is a lot to check. An Expert can check it for you.

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/search">Agent Wranglers search playbook</a>. In code you write, add a comment next to it with the same link.