Multimodal RAG with Bedrock Knowledge Bases
Build an AI document search system across PDFs, spreadsheets, and images.
Introduction
30 Second Summary
Think about how much time people spend searching through company documents for a single answer. A sales rep might dig through PDFs, spreadsheets, and product images just to respond to one customer question.
In this project, you will build a multimodal RAG (Retrieval Augmented Generation) system using Amazon Bedrock Knowledge Bases. Your system will answer natural language questions across PDFs, spreadsheets, and images, returning AI-generated answers with source citations.
What You'll Build
A fully functional document intelligence system that ingests multiple file types into a managed vector store and retrieves AI-generated answers grounded in your uploaded content.
By the end of this project, you'll have:
- An S3 bucket containing sample PDF, XLSX, and image files organized for ingestion.
- A Bedrock Knowledge Base configured with multimodal parsing that can process text, tables, and images.
- Verified natural language queries returning accurate, cited answers from your documents.
- Secret Mission: Add metadata filters to your documents so you can query specific document types or categories.
Are there any prerequisites?
You need an AWS account with billing enabled. You also need model access enabled in Amazon Bedrock for Amazon Titan Text Embeddings V2 and a generation model (Amazon Nova Lite or Claude).
Step 1 walks you through enabling this access, so don't worry if you haven't done it yet.
Before We Start
Before We Start...
Enable Bedrock Model Access
Your RAG system needs two types of AI models to work. An embedding model converts your documents into numerical representations (vectors) that can be searched. A generation model reads the retrieved document chunks and writes a natural language answer.
Before you can use any models in Amazon Bedrock, you need to explicitly enable access to them. In this step, you will enable the embedding model, a generation model, and the multimodal parser that processes images and complex PDFs.
In this step, get ready to:
- Enable access to Amazon Titan Text Embeddings V2 for document embedding.
- Enable a generation model (Amazon Nova Lite or Claude 3 Haiku) for answering queries.
- Enable Amazon Bedrock Data Automation (BDA) for multimodal content parsing.
Sign in and navigate to model access
All Bedrock model management happens from the Model access page in the Bedrock console. You need to be in the same region you will use for the rest of the project.
- Sign in to the AWS Management Console at https://console.aws.amazon.com.
- Confirm your region is set to US East (N. Virginia) (us-east-1). You can check and change the region from the dropdown in the top right corner of the console.
- In the console search bar at the top, type Bedrock and select Amazon Bedrock from the dropdown.
- In the left navigation pane, under Bedrock configurations, select Model access.
What is Amazon Bedrock?
Amazon Bedrock is a fully managed service that gives you access to foundation models from multiple AI providers through a single API. You do not need to host or manage any infrastructure to use these models.
Request access to the models you need
You will enable three model capabilities: text embeddings for search, text generation for answers, and multimodal data automation for parsing complex documents.
- On the Model access page, choose Enable specific models.
- In the model list, find and select the checkbox next to Amazon Titan Text Embeddings V2. This is the embedding model that will convert your documents into vectors.
- Also select a generation model. Choose Amazon Nova Lite for the most cost-effective option, or Claude 3 Haiku if you prefer Anthropic's model.
- Also select Amazon Bedrock Data Automation if it appears in the list. This is the multimodal parser for images and complex PDFs.
- Choose Next to proceed to the review page.
- Review your selections, then choose Submit.
Why these specific models?
Amazon Titan Text Embeddings V2 produces 1024-dimension vectors and works seamlessly with Bedrock Knowledge Bases. It converts all your document text into searchable vectors.
The generation model (Nova Lite or Claude 3 Haiku) reads the retrieved chunks and composes a natural language answer. Both are cost-effective choices for a learning project.
Anthropic models may need extra approval
If you choose Claude 3 Haiku, you may be asked to fill out a short use-case form. Describe your use case (e.g., document Q&A) and submit. Amazon-provided models like Nova Lite do not require this extra step.
Verify your model access status
After submitting, you need to confirm all your models show the correct status before moving on.
- Wait a few moments, then refresh the Model access page.
- Verify that each model you selected now shows Access granted in the Access status column.
- Amazon-provided models (Titan, Nova) typically show Access granted instantly. Third-party models like Claude may take a few minutes.
Model still showing pending?
If a model status is not updating, try refreshing your browser. Amazon models should update almost immediately. Anthropic models may require you to submit the use-case form first. Check that no form submission is pending.
help me troubleshoot why my Bedrock model access is not showing Access granted
What is Bedrock Data Automation?
Bedrock Data Automation (BDA) is a fully managed parser that processes multimodal content. It can extract text from figures, charts, and tables inside PDFs, and also process JPEG and PNG image files. Without BDA, the knowledge base can only read plain text from documents.
Your models are ready to go. Next, you will create an S3 bucket and upload the sample documents that your knowledge base will ingest and search through.
Create an S3 Bucket and Upload Sample Documents
With your Bedrock models enabled, you now have the AI brainpower ready to go. But AI needs data to work with.
In this step, you will create an Amazon S3 bucket and organize your sample documents inside it. This bucket becomes the data source that your Knowledge Base will ingest, parse, and index for natural language queries.
In this step, get ready to:
- Create a General Purpose S3 bucket in the same region as Bedrock.
- Upload sample PDF, XLSX, and image files into a documents folder.
- Create a storage folder for Bedrock to store parsed multimodal content.
Create a new S3 bucket
Your Knowledge Base needs a place to read documents from. S3 is the only data source type that supports multimodal content like images and complex PDFs.
- In the AWS Management Console, use the search bar at the top to search for S3 and select it.
- In the left navigation pane, select General purpose buckets.
- Click Create bucket.
- For Bucket type, confirm General Purpose is selected.
- For Bucket name, enter bedrock-kb-multimodal- followed by your name (e.g. bedrock-kb-multimodal-jane). Bucket names must be globally unique, so adding your name avoids conflicts.
- For AWS Region, choose the same region where you enabled your Bedrock models (e.g. us-east-1).
- Under Block Public Access settings for this bucket, leave Block all public access checked. Your documents stay private.
- Leave all other settings at their defaults (ACLs disabled, no versioning).
- Click Create bucket at the bottom of the page.
Why does the bucket region matter?
Your S3 bucket must be in the same Region as your Bedrock Knowledge Base. If they are in different regions, the Knowledge Base cannot access your documents.
What is Amazon S3?
Amazon S3 (Simple Storage Service) is AWS's object storage service. You store files as "objects" inside containers called "buckets." Each bucket has a globally unique name and lives in a single AWS Region.
For this project, S3 acts as the document library that your Bedrock Knowledge Base reads from.
Seeing a bucket name error?
S3 bucket names must be 3-63 characters, use only lowercase letters, numbers, and hyphens, and be globally unique. Try adding more characters to your name (like a date or random number) if you see a conflict.
help me fix my S3 bucket naming error
Create a documents folder and upload sample files
Now you will create a folder to hold the documents your Knowledge Base will ingest. You need a mix of file types to demonstrate the multimodal parsing capability.
- Click on your newly created bucket name to open it.
- On the Objects tab, click Create folder.
- Enter documents as the folder name.
- Click Create folder.
- Click into the documents/ folder.
- Click Upload.
- Click Add files and select files from your computer: one PDF document (e.g. a company report or technical whitepaper), one XLSX spreadsheet (e.g. a product catalog or financial data), and 1-2 images in JPEG or PNG format (e.g. diagrams, charts, or product photos).
- Click Upload at the bottom of the page.
- Wait for the success message to appear on the Upload: status page, then click Close.
What files should I upload?
You can use any documents you have on hand. The goal is to test multimodal ingestion across different formats. A one-page PDF, a simple spreadsheet, and a photo or diagram are all fine for this project.
Each file must be under 50 MB. Image files (JPEG or PNG) must be under 3.75 MB. If you do not have sample files, search for a free sample PDF report or screenshot a diagram from any website.
Upload failing?
Check that each file is under the 50 MB limit and that images are under 3.75 MB. Also confirm that your file formats are supported: PDF, XLSX, JPEG, or PNG.
help me troubleshoot my S3 file upload
Create the multimodal storage folder
Bedrock needs a separate location to store the content it extracts from your multimodal files during parsing. This is where parsed images and text representations will live for retrieval.
- Navigate back to the root of your bucket by clicking your bucket name in the breadcrumb navigation at the top.
- On the Objects tab, click Create folder.
- Enter multimodal-storage as the folder name.
- Click Create folder.
- Verify that your bucket now shows both documents/ and multimodal-storage/ in the Objects list.
Why a separate storage folder?
When the Bedrock Data Automation parser processes your files, it extracts images, tables, and charts into text representations. These extracted pieces are stored in this folder so they can be returned during queries.
You will see a .bda subfolder appear here after your Knowledge Base syncs.
Your document library is ready. Next, you will create the Knowledge Base that connects to this bucket and transforms your files into searchable AI knowledge.
Create the Knowledge Base with Multimodal Parsing
Your S3 bucket is loaded with documents and ready for ingestion. Now it's time to create the core of your RAG system: the Knowledge Base that connects your documents to AI.
An Amazon Bedrock Knowledge Base is a managed pipeline that handles parsing, chunking, embedding, and storing your content automatically. Once created, you can query it with natural language and get AI-generated answers grounded in your documents.
In this step, get ready to:
- Create an Amazon Bedrock Knowledge Base with automatic IAM permissions.
- Configure an S3 data source with Bedrock Data Automation for multimodal parsing.
- Provision a vector store and embeddings model to power semantic search.
Start creating the knowledge base
The knowledge base creation is a multi-page wizard in the Bedrock console. You'll configure the general settings first, then set up your data source and vector store.
- Navigate to Amazon Bedrock in the AWS Management Console.
- In the left navigation pane, select Knowledge bases.
- Choose the Create button and select to create a knowledge base with a vector store.
- In the Name field, enter multimodal-docs-kb.
- In the Description field, enter a brief description such as Knowledge base for multimodal document queries.
- Under IAM permissions, select Create and use a new service role.
- Choose Next to proceed to the data source configuration page.
What is a Knowledge Base in Amazon Bedrock?
A Knowledge Base is a fully managed RAG pipeline. It connects your documents in S3 to AI models by automatically handling parsing, chunking, embedding, and vector storage.
When you query it, the system retrieves the most relevant chunks from your documents and passes them to a generation model. The model uses those chunks to produce an answer with source citations.
Why create a new service role?
The service role gives Bedrock permission to access your S3 bucket and vector store on your behalf. Letting Bedrock create it automatically ensures the correct IAM permissions are configured without manual policy work.
Configure the data source with multimodal parsing
The data source tells the Knowledge Base where your documents live and how to parse them. This is where you'll enable the multimodal parser that can handle PDFs, images, and spreadsheets.
- Select Amazon S3 as your data source type.
- In the Data source name field, enter multimodal-s3-source.
- In the S3 URI field, enter the path to your documents folder:
s3://[[S3_BUCKET_NAME="bedrock-kb-multimodal-yourname"]]/documents/
- Scroll down to the Content parsing and chunking section.
- Select Bedrock Data Automation (BDA) as the parsing strategy.
- Choose Next to proceed to the embeddings and vector store page.
Why BDA over the default parser?
The default parser can only extract plain text from PDFs and spreadsheets. It cannot process figures, charts, tables, or images embedded in those documents.
Bedrock Data Automation (BDA) is a fully managed parser that converts multimodal content into searchable text representations without any additional prompting. Since your documents include images and complex PDFs, BDA ensures nothing gets missed during ingestion.
Select the embeddings model and create the knowledge base
The final configuration page sets up how your document chunks get converted into vector embeddings and where those embeddings are stored.
- In the Embeddings model section, select Amazon Titan Text Embeddings V2.
- In the Vector database section, select Quick create a new vector store.
- In the Multimodal storage destination field, enter the S3 URI for your storage folder:
s3://[[S3_BUCKET_NAME="bedrock-kb-multimodal-yourname"]]/multimodal-storage/
- Choose Next to proceed to the review page.
- Review your configuration details across all sections.
- Choose Create knowledge base.
- Wait for the knowledge base status to change to Ready (this may take 2-5 minutes).
What happens during Quick Create?
When you select Quick Create, Bedrock automatically provisions an OpenSearch Serverless collection as your vector database. This collection stores the vector embeddings of your document chunks, enabling fast semantic search when you query the knowledge base.
You don't need to configure indexes, field mappings, or capacity settings. Bedrock handles all of it for you.
Why Titan Text Embeddings V2 instead of a multimodal embeddings model?
You might expect a multimodal project to need a multimodal embeddings model. However, the BDA parser converts all content types (images, PDFs, spreadsheets) into text first. Titan Text Embeddings V2 then embeds that text into 1024-dimensional vectors.
This approach gives the best coverage across all your file types while keeping the response generation workflow fully supported. Using a multimodal embeddings model like Titan Multimodal G1 would restrict you to the default parser and miss the benefits of BDA.
Knowledge base stuck on Creating?
- Make sure your S3 bucket is in the same region as your Bedrock service. Only General Purpose S3 buckets are supported.
- Verify that model access for Amazon Titan Text Embeddings V2 shows Access granted on the Model access page.
- Check that your S3 URI paths end with a forward slash and match your actual bucket and folder names exactly.
Help me troubleshoot why my Bedrock Knowledge Base is stuck on Creating status.
Your knowledge base is created and ready to go. Next up, you'll sync your documents and verify that all your files were successfully ingested and indexed.
Sync Your Data and Verify Ingestion
Your knowledge base is configured, but it doesn't know what's inside your documents yet. The sync process is where the real magic happens. Bedrock reads each file, parses its content (including images and tables via BDA), splits it into chunks, generates vector embeddings, and stores everything in your OpenSearch Serverless collection.
In this step, you'll trigger the sync, confirm all your documents were ingested successfully, and verify that the multimodal parser extracted content into your S3 storage folder.
In this step, get ready to:
- Sync your data source to ingest all uploaded documents.
- Verify that all documents were scanned and indexed successfully.
- Confirm that BDA extracted multimodal content into your S3 storage folder.
Start the data source sync
Syncing tells Bedrock to scan your S3 folder, process every file it finds, and load the results into the vector store. Ingestion may take several minutes depending on the size and number of your files.
- Return to your knowledge base in the Amazon Bedrock console.
- In the Data source section, select your data source multimodal-s3-source.
- Choose Sync.
- Monitor the sync status on the data source page. The status will change as Bedrock processes your files.
What happens during a sync?
The BDA parser reads each document and extracts text, figures, tables, and charts. It converts everything into text representations that can be embedded as vectors.
Those text chunks are then passed to Amazon Titan Text Embeddings V2, which converts them into 1024-dimensional vectors. The vectors are stored in your OpenSearch Serverless collection, ready for semantic search.
Sync times vary
A handful of sample documents typically takes 2-5 minutes. Larger batches with many images or dense PDFs may take longer. You can stay on the page and wait for the status to update.
Verify your sync results
Once the sync finishes, you need to confirm that all your documents were processed without errors. A successful sync means your knowledge base is ready to answer questions.
- Wait until the sync status shows Completed.
- Check the sync details. Look at the Documents scanned and Documents indexed counts. These should match the number of files you uploaded.
- Check the Documents failed count. This should be zero or very low.
Seeing failed documents?
If any documents failed, check that they meet the format and size requirements. Each source file must not exceed 50 MB. Image files (JPEG and PNG) must be under 3.75 MB.
Also confirm the files are in a supported format (PDF, XLSX, JPEG, or PNG) and that they are stored inside the documents/ folder your data source points to.
Help me troubleshoot why my Bedrock Knowledge Base sync has failed documents.
Confirm multimodal content extraction in S3
When BDA processes your multimodal files, it stores the extracted and parsed content in the storage destination you configured. Verifying this folder confirms that images and complex document elements were processed correctly.
- Navigate to Amazon S3 in the AWS console.
- Open your bucket bedrock-kb-multimodal-yourname.
- Click into the multimodal-storage/ folder.
- You should see a .bda subfolder. This contains the extracted and parsed content from your multimodal files.
What is the .bda folder?
Knowledge Bases stores images parsed into your Amazon S3 bucket with a folder created .bda for easy access. This is where BDA places the extracted figures, charts, and image content it pulled from your PDFs and image files during ingestion.
Don't see the .bda folder?
Make sure you're looking inside the multimodal-storage/ folder, not the documents/ folder. If the folder is still empty, your sync may not have processed any multimodal content. Confirm that you uploaded at least one image (JPEG or PNG) or a PDF with figures.
Help me figure out why my .bda folder is empty after syncing my Bedrock Knowledge Base.
Your documents are now fully ingested, chunked, embedded, and stored. Next up, you'll put your knowledge base to work by asking it natural language questions and seeing AI-generated answers with source citations.
Query Your Knowledge Base
Your documents are ingested, chunked, embedded, and stored in a vector database. Now comes the payoff: asking natural language questions and getting AI-generated answers grounded in your actual documents.
In this step, you'll use the Bedrock console's built-in test interface to query your knowledge base. The system will retrieve relevant chunks from your documents, pass them to a generation model, and return a synthesized answer complete with source citations.
In this step, get ready to:
- Enable response generation in the test window.
- Ask natural language questions about your uploaded documents.
- Inspect source citations and verify cross-document retrieval.
Enable response generation in the test window
The Bedrock test window can operate in two modes: raw chunk retrieval (which just shows you matching text snippets) or full RAG response generation (which synthesizes an answer from those chunks). You need to turn on generation to get complete, cited answers.
- Return to Amazon Bedrock in the console.
- In the left navigation pane, select Knowledge bases.
- Select your multimodal-docs-kb knowledge base.
- In the test window on the right side of the page, find the Generate responses toggle and turn it ON.
- Click Select model to choose a generation model.
- Select a cost-effective model such as Amazon Nova Lite or Claude 3 Haiku.
- Click Apply to confirm your model selection.
Why turn on Generate responses?
Without this toggle, the test window only shows you raw retrieved chunks from the vector store. Turning it on adds the generation step to the pipeline: the model reads the retrieved chunks and writes a coherent answer with footnoted citations pointing back to your source documents.
Ask natural language questions about your documents
This is the moment of truth. You'll type a plain English question and the system will search your vector store, retrieve matching chunks, and generate an answer.
- In the test window's query field, type a question related to one of your uploaded documents.
Here are some example questions depending on what you uploaded:
- For a financial report PDF: "What were the total revenues reported?"
- For a product spreadsheet: "List the products with prices above $50."
- For an image of a diagram: "Describe the architecture shown in the diagram."
- Click Run to execute your query.
You should see an AI-generated response appear below your question. The response includes footnoted numbers (like [1], [2]) that reference the source documents the answer was built from.
What is happening behind the scenes?
When you press Run, the system converts your question into a vector embedding using Titan Text Embeddings V2. It then performs a similarity search against the OpenSearch Serverless vector store to find the most relevant chunks.
Those chunks are passed as context to your generation model (Nova Lite or Claude 3 Haiku), which synthesizes a final answer. The footnotes trace each claim back to the specific chunk it came from.
Not seeing a generated response?
Make sure Generate responses is toggled ON. Without it, you'll only see raw chunks, not a synthesized answer.
Confirm you selected a generation model. If no model is chosen, the system cannot produce a response.
If the response says it cannot find relevant information, try rephrasing your question to use terms that appear in your documents.
Ask for help: Why isn't my Bedrock knowledge base returning a generated answer?
Inspect source citations and verify cross-document retrieval
Citations are what separate a RAG system from a basic chatbot. They let you verify that every claim in the generated answer is backed by your actual documents.
- Click on one of the footnote numbers in the generated response.
- Choose Show source details to expand the full source information.
You should see the raw text from each retrieved chunk, a relevance score indicating how closely it matched your question, and the source document reference (the S3 file path).
- Now try 2-3 different questions, each targeting a different document type.
- Ask one question about your PDF content.
- Ask one question about your spreadsheet data.
- Ask one question about your image content.
- For each response, click the footnotes to confirm the answer is pulling from the correct source document.
What should I look for in the source details?
The relevance score shows how closely a chunk matched your query. Higher scores mean a stronger semantic match. The source document reference should point to the correct file in your documents/ folder.
If a question about your spreadsheet returns chunks from your PDF instead, the question might be too broad. Try making it more specific to the data in your spreadsheet.
Test edge cases
Try asking a question that spans multiple documents to see how the system combines information. Also try asking something not in your documents to see how the model handles missing information. A well-configured RAG system will say it doesn't have enough information rather than hallucinating.
Secret mission
Add Metadata Filters for Targeted Queries
Your knowledge base can answer questions across all your documents. But what if you only want answers from a specific document type or category? Metadata filters let you narrow your queries to exactly the documents you need.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. The OpenSearch Serverless collection is the primary cost driver in this project, billing continuously while it exists.
Cost warning
The Amazon OpenSearch Serverless collection created by "Quick create" bills OCU hours continuously while the collection exists. If you leave it running overnight or over a weekend, charges will accumulate. Deleting it promptly after completing the project keeps costs to a few dollars.
Resources you used:
- Amazon Bedrock Knowledge Base (multimodal-docs-kb).
- Amazon OpenSearch Serverless collection (auto-created vector store).
- S3 bucket (bedrock-kb-multimodal-yourname) with documents/ and multimodal-storage/ folders.
- IAM service role (auto-created by Bedrock).
Keep everything running
No action needed. Choose this if you plan to continue experimenting with your knowledge base and testing different queries.
- Be aware that the OpenSearch Serverless collection bills continuously at approximately $0.24 per OCU per hour (minimum 2 OCUs for indexing and 2 for search).
- S3 storage costs are minimal for a few sample documents.
- Bedrock model usage is pay-per-token, charged only when you run queries.
Pause - I'll come back to this later
OpenSearch Serverless collections cannot be paused. They bill continuously while they exist. For a learning project, deleting and recreating is the recommended approach if you want to take a break.
- If you want to preserve your documents, keep the S3 bucket. Storage costs are negligible for a small number of files.
- Delete the Knowledge Base and OpenSearch Serverless collection (follow the Delete tab instructions for those two resources). You can recreate both later using the same S3 bucket as a data source.
Delete - I don't want to use this again
Remove all project resources to stop all charges. Follow each step below in order.
- Delete the Knowledge Base: In the Bedrock console, select Knowledge bases in the left navigation pane. Select the radio button next to multimodal-docs-kb and choose Delete. Type delete in the confirmation box and choose Delete to confirm.
- Delete the OpenSearch Serverless collection: Navigate to the Amazon OpenSearch Service console. In the left navigation pane, expand Serverless and choose Collections. Select the collection that was auto-created for your knowledge base and choose Delete. Confirm the deletion.
- Empty and delete the S3 bucket: Open the S3 console. Select bedrock-kb-multimodal-yourname and choose Empty. Type permanently delete in the confirmation field and choose Empty. Once emptied, select the bucket again and choose Delete. Type the bucket name to confirm and choose Delete bucket.
- Delete the IAM service role (optional): Open the IAM console. Select Roles in the left navigation pane. Search for the role that was auto-created for your knowledge base (its name will contain AmazonBedrockExecution). Select it and choose Delete. Confirm the deletion.
That's a Wrap!
That's a Wrap!
Nice work! You just built a multimodal AI-powered document intelligence system using Amazon Bedrock Knowledge Bases.
You've learned how to:
- Built a multimodal document pipeline on Amazon S3 with the BDA parser to ingest PDFs, spreadsheets, and images into a single knowledge base.
- Understood the end-to-end RAG workflow from document upload through parsing, chunking, embedding, vector storage, retrieval, and AI-generated response with citations.
- Queried documents with natural language and verified cross-document retrieval using the Bedrock console's built-in test interface.
- Added metadata filters to enable targeted, precision queries across specific document types and categories.
Ready to quiz yourself?