Amazon Bedrock + OpenSearch: beginner RAG setup
Build a document Q&A notebook with Amazon Bedrock and OpenSearch Serverless, using S3, Titan Text Embeddings V2 and Amazon Nova Lite.
Player not loading? Watch on YouTube
This beginner tutorial builds a retrieval-augmented generation (RAG) application with AWS services and a Jupyter Notebook. The notebook runs on the presenter's Windows machine, while AWS handles model inference and vector storage. The setup requires an AWS account, credentials and access to the cloud services.
The presenter uploads an Amazon earnings PDF to S3, then creates a Bedrock Knowledge Base with default chunking. Titan Text Embeddings V2 converts the document chunks into vectors for Amazon OpenSearch Serverless. At query time, the notebook retrieves relevant text and passes it to Amazon Nova Lite with a prompt to answer only from that context. The walkthrough uses Nova Lite v1.0 and a Bedrock runtime client in US East 1.
Project setup uses uv, Jupyter and boto3. The tutorial also covers AWS CLI credential configuration and troubleshoots missing credentials, a rejected attempt to create a knowledge base as the root user, and IAM permission errors. To get past the latter, the presenter grants administrator access for the demonstration; he also describes limiting permissions in organizational use.
The final example contrasts an initial unanswered financial question with a response drawn from the uploaded PDF. The presenter reports that the answer matches the document. This demonstrates retrieval against the supplied file, rather than independently verifying its financial figures. AWS inference, vector storage and S3 are hosted services with usage charges; account trial credits do not make the setup permanently free.