Knowledge Bases for Amazon Bedrock

With Knowledge Bases for Amazon Bedrock, you can give FMs and agents contextual information from your company’s private data sources for RAG to deliver more relevant, accurate, and customized responses

Fully managed support for end-to-end RAG workflow

To equip foundation models (FMs) with up-to-date and proprietary information, organizations use Retrieval Augmented Generation (RAG), a technique that fetches data from company data sources and enriches the prompt to provide more relevant and accurate responses. Knowledge Bases for Amazon Bedrock is a fully managed capability that helps you implement the entire RAG workflow from ingestion to retrieval and prompt augmentation without having to build custom integrations to data sources and manage data flows. Alternatively, you can ask questions and summarize data from a single document, without setting up a vector database. You can also have a Session context management is built in, so your app can readily support multi-turn conversations.

A formal depiction of a knowledge base's overview

Securely connect FMs and agents to data sources

Once you point to the location of your proprietary data, Knowledge Bases automatically fetches the documents. You can ingest content from the web and from repositories such as Amazon Simple Storage Service (Amazon S3), Confluence (preview), Salesforce (preview), SharePoint (preview). Once the content is ingested, Knowledge Bases divides the content into blocks of text, converts the text into embeddings, and stores the embeddings in your vector database.
Knowledge Bases also manages workflow complexities such as content comparison, failure handling, throughput control, encryption, and more. If you do not have an existing vector database, Amazon Bedrock creates an Amazon OpenSearch Serverless vector store for you. Alternatively, you can specify an existing vector store in one of the supported databases, including Amazon OpenSearch Serverless, Pinecone, and Redis Enterprise Cloud, Amazon Aurora, and MongoDB.

screen to create knowledge base and set up data sources

Customize Knowledge Bases to deliver accurate responses at runtime

You can now fine-tune retrieval and ingestion to achieve better accuracy across use-cases. Leverage advanced parsing options to understand unstructured data (e.g. PDFs, scanned images) with complex content (e.g., tables). Using advanced data chunking options like custom chunking you can write your own chunking code as a Lamda function, and even use off the shelf components from frameworks like LangChain and LlamaIndex. If you prefer, you can also use one of our built-in chunking strategies including our default, fixed size, no chunking, hierarchical chunking, or semantic chunking. At the time of retrieval, make use of query reformulation to improve the ability of the system to understand complex queries.

bedrock chunking parsing configuration screenshot

Retrieve relevant data and augment prompts

You can use the Retrieve API to fetch relevant results for a user query from knowledge bases. The RetrieveAndGenerate API goes one step further by directly using the retrieved results to augment the FM prompt and return the response. You can also add knowledge bases to Agents for Amazon Bedrock to provide contextual information to agents.

Retrieve And Generate API

Provide source attribution

All the information retrieved from Knowledge Bases for Amazon Bedrock is provided with citations to improve transparency and minimize hallucinations.

A chat window where a user is having a conversation with Agent