Use LangChain and vector search on Amazon DocumentDB to build a generative AI chatbot
Database Blog
This article discusses building a generative AI chatbot using LangChain and vector search with Amazon DocumentDB. It shows how to leverage Amazon DocumentDB's support for vector search along with AWS AI services like Amazon Bedrock and SageMaker, as well as third-party tools like LangChain and OpenAI.
Specifically, the article covers:
- How to use Retrieval Augmented Generation (RAG) with large language models (LLMs) to retrieve relevant data from a knowledge base and augment prompts
- Creating an HNSW index on an Amazon DocumentDB collection for vector search
- Loading and embedding documents from a PDF using LangChain and Amazon Titan Text Embeddings
- Initializing a reasoning agent like Anthropic Claude from Amazon Bedrock
- Using the RetrievalQA chain to query the vector index and generate answers
- The benefits of combining DocumentDB's JSON flexibility with vector search for AI applications
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
Mar 17
2025
2025
Build a .NET Context-Aware Generative AI Chatbot using Amazon Bedrock and LangChain
Nov 6
2024
2024
Amazon DynamoDB data models for generative AI chatbots
Nov 6
2024
2024
Build a scalable, context-aware chatbot with Amazon DynamoDB, Amazon Bedrock, and LangChain
Oct 7
2024
2024
Build a generative AI Slack chat assistant using Amazon Bedrock and Amazon Kendra
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.