RAG requires organizations to perform several cumbersome steps to convert data into embeddings (vectors), store the embeddings in a specialized vector database, and build custom integrations into the database to search and retrieve text relevant to the user’s query. This can be time-consuming and inefficient.
With Knowledge Bases for Amazon Bedrock, simply point to the location of your data in Amazon S3, and Knowledge Bases for Amazon Bedrock takes care of the entire ingestion workflow into your vector database. If you do not have an existing vector database, Amazon Bedrock creates an Amazon OpenSearch Serverless vector store for you. For retrievals, use the LangChain - Amazon Bedrock integration via the Retrieve API to retrieve relevant results for a user query from knowledge bases.
Amazon Bedrock now also offers Managed Knowledge Bases, which handle embedding, storage, and retrieval automatically—no external vector store needed. See the Managed Knowledge Base section below.
Integration details
Setup
Knowledge Bases can be configured through AWS Console or by using AWS SDKs. We will need theknowledge_base_id to instantiate the retriever.
If you want to get automated tracing from individual queries, you can also set your LangSmith API key by uncommenting below:
Installation
This retriever lives in thelangchain-aws package:
langchain-aws>=1.6.3, which installs boto3>=1.43.32.
Instantiation
Vector Knowledge Base
For traditional vector-based knowledge bases (with OpenSearch Serverless, Pinecone, etc.):Managed Knowledge Base
For Managed Knowledge Bases (recommended—no vector store needed):Agentic Retrieval
For complex queries that benefit from query decomposition and managed reranking, use the standaloneagentic_retrieve helper:
AgenticRetrieveStream which performs intelligent query decomposition and managed reranking. It requires langchain-aws>=1.6.3 and only works with managed knowledge bases.
Usage
Use within a chain
Required IAM Permissions
Resources
API reference
For detailed documentation of allAmazonKnowledgeBasesRetriever features and configurations head to the API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

