Skip to content

Commit c4db7c1

Browse files
committed
[agent builder] Add note about esql limitations, example parameterized query
1 parent 472d85c commit c4db7c1

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed
117 KB
Loading

solutions/search/agent-builder/limitations-known-issues.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Error: Invalid function call syntax
4242
Error executing agent: No tool calls found in the response.
4343
```
4444

45+
### {{esql}} limitations
46+
47+
{{esql}} tools are subject to the current limitations of the {{esql}} language itself. For example, [named parameters](elasticsearch://reference/query-languages/esql/esql-syntax#esql-function-named-params.md) (`?parameter_name`) do not currently work with the `LIKE` and `RLIKE` operators ([issue #131356](https://github.com/elastic/elasticsearch/issues/131356)).
48+
49+
For a complete list of {{esql}} limitations, refer to the the [{{esql}} limitations documentation](elasticsearch://reference/query-languages/esql/limitations.md).
50+
4551
### Misinterpreted SQL syntax as ES|QL
4652

4753
The `.execute_esql` tool is designed only for [{{esql}}](elasticsearch://reference/query-languages/esql.md) syntax, not other query languages.

solutions/search/agent-builder/tools/esql-tools.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,34 @@ Parameters can be configured as:
5252

5353
In your {{esql}} query, reference parameters using the `?parameter_name` syntax. The agent will automatically interpolate parameter values when executing the query.
5454

55+
### Example
56+
57+
Here's an example {{esql}} tool that searches for books using full-text search. `?search_terms` is a named parameter that the agent will provide when executing the query.
58+
59+
```esql
60+
FROM books
61+
| WHERE MATCH(title, ?search_terms)
62+
| KEEP title, author, year
63+
| LIMIT 10
64+
```
65+
66+
You can ask the LLM to infer the parameters for the query or add them manually.
67+
68+
:::{image} ../images/create-esql-tool-query.png
69+
:alt: Creating an ES|QL tool with a parameterized query
70+
:::
5571

5672
## Best practices
5773

58-
- **Include LIMIT clauses**: Prevent returning excessive results by setting reasonable limits
74+
- **Include [`LIMIT`](elasticsearch://reference/query-languages/esql/commands/limit.md) clauses**: Prevent returning excessive results by setting reasonable limits
5975
- **Use meaningful parameter names**: Choose names that clearly indicate what the parameter represents (e.g., `start_date` instead of `date1`)
76+
- **Define parameter types**: Ensure parameters have the correct type to avoid runtime errors
6077
- **Provide clear descriptions**: Help agents understand when and how to use each parameter
6178

79+
## Limitations
80+
81+
{{esql}} tools are subject to the current limitations of the {{esql}} language itself. For more information, refer to [{{esql}} tool limitations](../limitations-known-issues.md#esql-limitations).
82+
6283
## {{esql}} documentation
6384

6485
To learn more about the language, refer to the [{{esql}} docs](elasticsearch://reference/query-languages/esql.md).

0 commit comments

Comments
 (0)