Use Managed Knowledge Bases instead of OpenSearch Serverless
mainAmazon Bedrock now supports Managed Knowledge Bases, which handle embedding, storage, and retrieval automatically without requiring an external vector store like OpenSearch Serverless. This reduces costs and supports agentic retrieval.
Configuration:
- To use managed retrieval in this project, set the environment variable
KNOWLEDGE_BASE_TYPE=MANAGEDin the Lambda function. - Managed KBs require
boto3 >= 1.43.2. - Retrieval uses
managedSearchConfigurationinstead ofvectorSearchConfiguration.
Reranking Options for Managed Search:
MANAGED(default): Automatic reranking.NONE: Disables reranking.CUSTOM: Uses a specific Bedrock reranking model (e.g., Cohere Rerank v3.5).