Skip to content

Is Opensearch filters directly supported inside Bedrock Invoke Agent API

0

So in Bedrock Invoke API there are a bunch of filtering operators like IN, EQUALS, NOTEQUALS, GREATERTHAN, GREATERTHANEQUALS, LESSERTHAN, LESSERTHANEQUALS, NOTIN, STRINGCONTAINS, LISTCONTAINS. These filtering operators are internally converted to opensearch schema right? If thats the case then why when RANGE is supported in opensearch why its not supported inside the bedrock invoke model. Or is it there?

Is there a way to directly give opensearch supported operators to the invoke agent

1 Answer
0
Accepted Answer

The Bedrock Invoke Agent API does support filtering, but it doesn't directly expose all OpenSearch filtering operators. The filtering operators you mentioned (IN, EQUALS, NOTEQUALS, etc.) are indeed available in the Bedrock API, and these are likely translated to appropriate OpenSearch queries internally. However, not all OpenSearch operators are directly exposed in the Bedrock API.

Regarding the RANGE operator specifically, while it's supported in OpenSearch, it's not directly available as a filtering operator in the Bedrock Invoke Agent API. Instead, the API provides GREATERTHAN, GREATERTHANEQUALS, LESSERTHAN, and LESSERTHANEQUALS, which can be used to achieve similar functionality to a range query.

As for directly using OpenSearch-supported operators in the Invoke Agent API, there isn't a straightforward way to do this. The API is designed to provide a abstracted interface that works across different knowledge base types, not just OpenSearch. This abstraction allows for consistency but may limit access to some database-specific features.

If you need more advanced filtering capabilities that are specific to OpenSearch, you might need to consider implementing these in a custom function that the agent can call, rather than relying solely on the built-in filtering capabilities of the Invoke Agent API.

It's worth noting that the available filtering options and capabilities may evolve over time as the Bedrock service is updated, so it's always a good idea to check the latest documentation for any new features or changes in this area.
Sources
Bedrock Agent with knowledgebase metadata search | AWS re:Post
Configure and customize queries and response generation - Amazon Bedrock
PatternObjectFilterConfiguration - Amazon Bedrock

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.