|
| 1 | +--- |
| 2 | +navigation_title: "Index search tools" |
| 3 | +applies_to: |
| 4 | + stack: preview 9.2 |
| 5 | + serverless: |
| 6 | + elasticsearch: preview |
| 7 | +--- |
| 8 | + |
| 9 | +:::{warning} |
| 10 | +These pages are currently hidden from the docs TOC and have `noindexed` meta headers. |
| 11 | + |
| 12 | +**Go to the docs [landing page](/solutions/search/elastic-agent-builder.md).** |
| 13 | +::: |
| 14 | + |
| 15 | +# Index search tools |
| 16 | + |
| 17 | +Index search tools provide intelligent, natural language-driven search over specified {{es}} resources. Instead of defining explicit queries, you specify a pattern of [indices](/manage-data/data-store/index-basics.md), [aliases](/manage-data/data-store/aliases.md), or [data streams](/manage-data/data-store/data-streams.md), and the tool uses a combination of built-in capabilities to intelligently interpret and execute search requests. |
| 18 | + |
| 19 | +## When to use index search tools |
| 20 | + |
| 21 | +Use custom **Index search tools** when: |
| 22 | + |
| 23 | +* You want agents to handle diverse, exploratory queries |
| 24 | +* The search intent varies significantly across requests |
| 25 | +* Users need flexible, ad-hoc search functionality |
| 26 | +* You want to scope general search capabilities to specific indices |
| 27 | + |
| 28 | +## Key characteristics |
| 29 | + |
| 30 | +* Accept natural language queries from the agent |
| 31 | +* Automatically determine optimal search strategy (full-text, semantic) |
| 32 | +* Leverage built-in tools like index exploration, query generation, and semantic search |
| 33 | +* Ideal for flexible, user-driven exploratory searches |
| 34 | +* No need to pre-define query logic |
| 35 | + |
| 36 | +## Configuration |
| 37 | + |
| 38 | +Index search tools require only a single configuration parameter: |
| 39 | + |
| 40 | +* **`pattern`**: An index pattern string (e.g., `logs-*`, `my-index`, `.alerts-*`) specifying which indices, aliases, or data streams to search |
| 41 | + |
| 42 | +## How it works |
| 43 | + |
| 44 | +When an agent calls an index search tool: |
| 45 | + |
| 46 | +1. The agent provides a natural language query (e.g., "find recent errors related to authentication") |
| 47 | +2. The tool analyzes the query intent and available indices |
| 48 | +3. It automatically orchestrates built-in tools to: |
| 49 | + - Explore the index structure and mappings |
| 50 | + - Generate appropriate queries ({{esql}} or query DSL) |
| 51 | + - Execute semantic search if relevant |
| 52 | + - Rank and format results |
| 53 | +4. Returns results in a format the agent can interpret and present |
| 54 | + |
| 55 | + |
| 56 | +## Best practices |
| 57 | + |
| 58 | +- **Use specific patterns**: Scope tools to relevant index patterns rather than broad wildcards (e.g., `logs-myapp-*` instead of `logs-*`) |
| 59 | +- **Write descriptive tool names**: Help agents select the right tool for the query (e.g., "Search Security Alerts" vs. "Search Tool") |
| 60 | +- **Provide context in descriptions**: Explain what data the indices contain and what types of questions the tool can answer |
| 61 | +- **Create domain-specific tools**: Build separate tools for different data domains (logs, metrics, alerts) rather than one general-purpose tool |
| 62 | + |
| 63 | + |
| 64 | +## Common patterns |
| 65 | + |
| 66 | +* **Wildcard patterns**: `logs-*`, `metrics-*`, `events-*` |
| 67 | +* **Specific indices**: `products`, `users`, `orders` |
| 68 | +* **System indices**: `.alerts-security-*`, `.ml-anomalies-*` |
| 69 | +* **All resources**: `*` |
0 commit comments