Practical overview
When it fits
Use it as a code starting point when you need to understand or adapt a Python pipeline linking Bedrock embeddings, OpenSearch vector search, and LangChain retrieval.
Who it is for
- Developers learning or prototyping a RAG workflow with Amazon Bedrock and OpenSearch.
- Teams exploring semantic retrieval of text to provide relevant context to language-model prompts.
Documented uses
- Load text from the sample dataset, generate embeddings, and store them in an OpenSearch index.
- Retrieve similar text when submitting a question to a model through Amazon Bedrock.
- Choose a documented Bedrock model ID and, for queries, select an index, region, or tenant ID.
Requirements & limits
The repository is public and licensed under MIT-0. The documented workflow requires Python, Terraform, AWS service setup, and enabled Bedrock model access.
- The sample combines a Python application pipeline with Terraform-managed OpenSearch infrastructure.
- Its example dataset is the gooaq_pairs file from Hugging Face.
- The README's cluster configuration uses a public endpoint and is explicitly described as testing-only.
- The README documents Python 3.11.4 as the version used for testing.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up and query the sample RAG workflow
Create the sample OpenSearch cluster, load embeddings from the example dataset, and submit a question through Amazon Bedrock.
Before you start
- Python 3.11.4 is identified as the version used for testing.
- A clean Python environment and the repository's requirements file.
- Terraform to create the OpenSearch cluster.
- Enable the desired foundation models in Amazon Bedrock.
Steps
Create and activate a virtual environment, then install dependencies with the command below.
pip install -r requirements.txtFrom the
terraformdirectory, runterraform initandterraform apply -auto-approveto create the cluster.Run the command below to load the example data and embeddings.
python load-data-to-opensearch.py --recreate 1 --early-stop 1Run the command below to query the model using retrieved text.
python ask-bedrock-with-rag.py --ask "your question here"
Expected outcome
A sample workflow that stores text embeddings in OpenSearch and uses retrieved matches when asking a model through Bedrock.
Guide limitations
- The README describes the public-endpoint cluster configuration as testing-only.
- The early-stop option loads only 100 embedded documents.
- The workflow depends on configuring AWS services and enabling model access.
Compare options for Retrieval-augmented applications
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Rag Using Langchain Amazon Bedrock And Opensearch | Load text from the sample dataset, generate embeddings, and store them in an OpenSearch index. | Cloud | The repository is public and licensed under MIT-0. The documented workflow requires Python, Terraform, AWS service setup, and enabled Bedrock model access. |
| Langsearch | Crawl website or local data for a knowledge base. | CLI, Self-hosted, Server | |
| Hybrid Search Rag | Combine document retrieval and language-model generation in a configurable workflow. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- aws-samples/rag-using-langchain-amazon-bedrock-and-opensearch · Official homepage title · retained in its source language

