Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
355 changes: 272 additions & 83 deletions _ml-commons-plugin/agents-tools/tools/query-planning-tool.md

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions _query-dsl/specialized/agentic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@ nav_order: 2
**Introduced 3.2**
{: .label .label-purple }

Use the `agentic` query to ask questions in natural language and have OpenSearch automatically plan and execute the retrieval. The `agentic` query works in conjunction with a preconfigured agent that reads the question, plans the search, and returns relevant results. For more information about agentic search, see [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/).
Use the `agentic` query to ask questions in natural language and have OpenSearch automatically plan and execute the retrieval. The `agentic` query works in conjunction with a preconfigured agent that reads the question, plans the search, and returns relevant results. For more information about agentic search, see [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/).

**Prerequisite**<br>
Before using an `agentic` query, you must configure an agent with the [`QueryPlanningTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/query-planning-tool/) and create a search pipeline with an `agentic_query_translator` search request processor.
{: .note}
## Prerequisite

Before using an `agentic` query, you must fulfill the following prerequisites:

1. Configure an agent with the [`QueryPlanningTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/query-planning-tool/). The `QueryPlanningTool` is required for generating query domain-specific language (DSL) queries from natural language questions. Optionally, you can configure the agent with additional tools for enhanced functionality.
1. Create a search pipeline with an [`agentic_query_translator` search request processor]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/agentic-query-translator-processor/).

For detailed setup instructions, see [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/).

## Request body fields

The `agentic` query accepts the following fields.

Field | Data type | Required/Optional | Description
:--- | :--- | :--- | :---
`query_text` | String | Required | The natural language question or request.
`query_fields` | Array | Optional | A list of fields that the agent should consider when generating the search query. If not provided, the agent considers all available fields in the index mapping.
`query_text` | String | Required | The natural language question to be answered by the agent.
`query_fields` | Array | Optional | A list of index fields that the agent should consider when generating the search query. If omitted, the agent infers the applicable fields based on the index mappings and content.
`memory_id` | String | Optional | Applicable for `conversational` agents only. Provides a memory ID from a previous response to continue the conversation with prior context. See [Using conversational agents for agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/agent-converse/). |

## Example

Expand All @@ -48,10 +54,11 @@ When executed, the agentic search request performs the following steps:
3. The generated DSL query is executed as a search request in OpenSearch.
4. Returns the search results based on the generated query.

For a complete example, see [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/).
For a complete example, see [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/).

## Next steps

- Learn how to set up agentic search in [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/).
- Learn about configuring agents in [Agents]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agents/).
- Learn about the [QueryPlanningTool]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/query-planning-tool/).
- Learn how to configure agentic search in [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/).
- Learn about agent types in [Agent types]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/#agent-types).
- Learn about the [`QueryPlanningTool`]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/tools/query-planning-tool/).
- View the reference documentation for the [`agentic_query_translator` search request processor]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/agentic-query-translator-processor/).
16 changes: 9 additions & 7 deletions _search-plugins/search-pipelines/agentic-context-processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,26 @@ The `agentic_context` search response processor adds agent execution context inf
4. The context information is added to the search response extensions.
5. Type validation ensures that all context attributes are strings.

This processor works with both conversational and flow agents, but the available context information differs by agent type. Flow agents provide `dsl_query` (the generated DSL) only, while conversational agents provide `dsl_query`, `memory_id`, and `agent_steps_summary`. For more information, see [Agent types]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/#agent-types).

## Request body fields

The following table lists all available request fields.

Field | Data type | Description
:--- | :--- | :---
`agent_steps_summary` | Boolean | Whether to include the agent's execution steps summary in the response. Default is `false`. Optional.
`dsl_query` | Boolean | Whether to include the generated DSL query in the response. Default is `false`. Optional.
`agent_steps_summary` | Boolean | Whether to include the agent's execution step summary in the response. Available for conversational agents only. Optional. Default is `false`.
`dsl_query` | Boolean | Whether to include the generated DSL query in the response. Available for both conversational and flow agents. Optional. Default is `false`.

## Response fields

When enabled, the processor adds the following fields to the search response extensions.

Field | Description
:--- | :---
`agent_steps_summary` | A summary of the steps that the agent took to translate the natural language query (included when `agent_steps_summary` is `true`).
`memory_id` | The conversation memory ID for maintaining context across queries. Only provide this in the `agentic` query if you want to continue the previous conversation.
`dsl_query` | The generated DSL query that was executed (included when `dsl_query` is `true`).
`agent_steps_summary` | A summary of the steps that the agent took to translate the natural language query (included when `agent_steps_summary` is `true`). Available for conversational agents only.
`memory_id` | The conversation memory ID for maintaining context across queries. Available for conversational agents only. Only provide this in the `agentic` query if you want to continue the previous conversation.
`dsl_query` | The generated DSL query that was executed (included when `dsl_query` is `true`). Available for both conversational and flow agents.

## Example

Expand Down Expand Up @@ -98,6 +100,6 @@ The response contains the steps taken by the agent to translate the query, the m

## Related pages

- [Agentic search queries]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search)
- [Agents]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agents/index/)
- [Agentic search]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/)
- [Agentic query]({{site.url}}{{site.baseurl}}/query-dsl/specialized/agentic/)
- [Agentic query translator processor]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/agentic-query-translator-processor/)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ grand_parent: Search pipelines
**Introduced 3.2**
{: .label .label-purple }

The `agentic_query_translator` search request processor enables natural language search by translating user queries into OpenSearch query domain-specific language (DSL) queries using machine learning (ML) agents. It works with [agentic search queries]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search) to provide conversational search capabilities:
The `agentic_query_translator` search request processor enables natural language search by translating user queries into OpenSearch query domain-specific language (DSL) queries using machine learning (ML) agents. It works with [agentic search queries]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/) to provide conversational search capabilities:

1. The processor sends the user's natural language query to the specified ML agent.
2. The agent translates the query into OpenSearch DSL.
Expand Down Expand Up @@ -127,6 +127,6 @@ The response contains the matching documents:

## Related pages

- [Agentic search queries]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search)
- [Agents]({{site.url}}{{site.baseurl}}/ml-commons-plugin/agents-tools/agents/index/)
- [Agentic search queries]({{site.url}}{{site.baseurl}}/vector-search/ai-search/agentic-search/index/)
- [Agentic query]({{site.url}}{{site.baseurl}}/query-dsl/specialized/agentic/)
- [Agentic context processor]({{site.url}}{{site.baseurl}}/search-plugins/search-pipelines/agentic-context-processor/)
177 changes: 0 additions & 177 deletions _vector-search/ai-search/agentic-search.md

This file was deleted.

Loading
Loading