- Newest
- Most votes
- Most comments
Yes, you can create an agent with an action group to perform custom retrievals on a Knowledge Base (KB) in Amazon Bedrock. Here's how you can approach this:
-
Custom Retrievals on Knowledge Base: You can define a custom retrieval logic for a Knowledge Base by using the Retrieve API or RetrieveAndGenerate API within an action group Lambda function. This allows you to customize the retrieval process, including specifying the number of results, applying filters, and even using different search configurations.
-
Using OpenSearch: While the sources don't explicitly mention using OpenSearch for custom retrievals with Bedrock Agents, you can potentially integrate OpenSearch into your workflow by creating a custom Lambda function as part of your action group. This function could interact with OpenSearch to perform custom retrievals based on your specific requirements.
-
Custom RAG Workflow: You can implement a custom RAG workflow using Amazon Bedrock Agents by combining various components:
a. Create an agent with a custom instruction that defines its purpose and capabilities. b. Define an action group with Lambda functions that implement your custom retrieval logic. c. Use the Retrieve or RetrieveAndGenerate API within your Lambda function to interact with the Knowledge Base. d. Implement additional logic in your Lambda function to process and filter the retrieved information as needed. e. Return the processed information to the agent for further reasoning and response generation.
This approach allows you to have fine-grained control over the retrieval process while leveraging the power of Amazon Bedrock Agents for orchestration and reasoning.
- Alternative Options: If you need even more flexibility, you could consider building a custom RAG system using Amazon Nova Models. This approach allows you to define your own retriever as a tool and implement custom instructions for your RAG system. However, this would be separate from the Bedrock Agents framework.
In summary, the recommended approach would be to use Amazon Bedrock Agents with custom action groups (Lambda functions) to implement your desired retrieval logic on Knowledge Bases. This provides a good balance of flexibility and integration with the Bedrock ecosystem.
Sources
Bedrock Agent with knowledgebase metadata search | AWS re:Post
Integrate dynamic web content in your generative AI application using a web search API and Amazon Bedrock Agents | AWS Machine Learning Blog
Building a custom RAG system with Amazon Nova - Amazon Nova
Guidance for Agentic Workflow Assistants on AWS
The provided response addresses the queries posed. For further reference, please refer to the accompanying documentation. [1] AWS Bedrock User Guide - "Action Groups": https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html [2] AWS Bedrock User Guide - "Lambda input event from Amazon Bedrock": https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html#agents-lambda-input [3] AWS Bedrock User Guide - "Control agent session context": https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html [4] AWS Bedrock API Reference - "RetrieveAndGenerate": https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html [5] AWS Machine Learning Blog - "Integrate dynamic web content in your generative AI application using a web search API and Amazon Bedrock Agents": https://aws.amazon.com/blogs/machine-learning/integrate-dynamic-web-content-in-your-generative-ai-application-using-a-web-search-api-and-amazon-bedrock-agents/ [6] Amazon Nova Documentation - "Building a custom RAG system with Amazon Nova": https://docs.aws.amazon.com/nova/latest/userguide/rag-building.html
Relevant content
- asked 10 months ago
