HAS AWS re:Invent 2023, we announced the general availability of Knowledge Bases for Amazon Bedrock. With the Knowledge Bases for Amazon Bedrock, you can securely connect foundation models (FM) in Amazonian substrate to your business data for fully managed Augmented Recovery Generation (AGR).
In previous articles we covered new features such as hybrid search support, filtering metadata to improve retrieval accuracyand how Knowledgebases for Amazon Bedrock manage end-to-end RAG workflow.
Today we're introducing the new feature to chat with your document without any setup in Knowledge Bases for Amazon Bedrock. With this new feature, you can securely ask questions on single documents, without having to set up a vector database or ingest data, making it easy for businesses to use their enterprise data. Simply provide a relevant data file as input and choose your FM to get started.
But before getting into the details of this feature, let's start with the basics and understand what RAG is, its benefits and how this new feature enables content retrieval and generation for time-based needs.
What is recovery augmented generation?
FM-powered artificial intelligence (AI) assistants have limitations, such as providing outdated information or difficulty managing context outside of their training data. RAG solves these problems by allowing FMs to cross-reference authoritative knowledge sources before generating answers.
With RAG, when a user asks a question, the system retrieves relevant context from a curated knowledge base, such as company documentation. It provides this context to the FM, which uses it to generate a more informed and precise response. RAG helps overcome the limitations of FM by augmenting its capabilities with an organization's proprietary knowledge, enabling chatbots and AI assistants to provide up-to-date, context-specific information tailored to business needs without retraining the entire FM. At AWS, we recognize the potential of RAG and have worked to simplify its adoption through Knowledge Bases for Amazon Bedrock, delivering a fully managed RAG experience.
Short-term and instant information needs
Although a knowledge base does all the heavy lifting and is a large, persistent store of business knowledge, you may need temporary access to data for specific tasks or analyzes within isolated user sessions. Traditional RAG approaches are not optimized for these short-term, session-based data access scenarios.
Businesses incur costs for storing and managing data. This can make RAG less cost-effective for organizations with very dynamic or ephemeral information needs, particularly when data is only needed for specific, isolated tasks or analyses.
Ask questions on a single document without any configuration
This new feature to chat with your document in knowledge bases for Amazon Bedrock addresses the challenges noted above. It provides a configuration-free way to use your single document for content retrieval and generation-related tasks, as well as FMs provided by Amazon Bedrock. With this new feature, you can ask questions about your data without having to set up a vector database or ingest data, making it easier to use your company's data.
You can now interact with your documents in real time without data ingestion or prior database configuration. You do not need to complete any further data preparation steps before querying the data.
This configuration-free approach makes it easy to use your company's information assets with generative AI using Amazon Bedrock.
Use cases and benefits
Consider a recruiting company that must analyze resumes and match candidates to suitable job opportunities based on their experience and skills. Previously, you had to set up a knowledge base, calling a data ingestion workflow to ensure that only authorized recruiters can access the data. Additionally, you will need to manage cleanup when data is no longer needed for a session or candidate. Ultimately, you'll pay more for vector database storage and management than you will for actually using FM. This new Knowledge Base feature for Amazon Bedrock allows recruiters to quickly and ephemerally scan resumes and match candidates with suitable job opportunities based on their experience and skills.
For another example, consider a product manager at a technology company who needs to quickly analyze customer feedback and support tickets to identify common issues and areas for improvement. With this new feature, you can simply upload a document to extract information from it in no time. For example, you might ask “What are the requirements for the mobile app?” or “What are some common issues customers mention regarding our onboarding process?” This feature allows you to quickly summarize this information without the hassle of data preparation or management costs. You can also ask for summaries or takeaways, such as “What are the highlights of this requirements document?” »
The benefits of this feature extend beyond cost savings and operational efficiencies. By eliminating the need for vector databases and data ingestion, this new Knowledge Bases feature for Amazon Bedrock helps secure your first-party data, making it accessible only in the context of isolated user sessions.
Now that we've covered the benefits of the feature and the use cases it enables, let's take a look at how you can get started using this new Knowledge Bases feature for Amazon Bedrock.
Chat with your document in knowledge bases for Amazon Bedrock
You have several options to start using this feature:
- The Amazon Bedrock Console
- Amazonian bedrock
RetrieveAndGenerate
API (SDK)
Let's see how to get started using the Amazon Bedrock console:
- On the Amazon Bedrock console, under Orchestration In the navigation pane, choose Knowledge Bases.
- Choose Chat with your document.
- Below Modelchoose Select model.
- Choose your model. For this example, we're using the Claude 3 Sonnet template (we only support Sonnet at launch).
- Choose Apply.
- Below Datayou can upload the document you want to chat with or point to the Amazon Simple Storage Service Location of the bucket (Amazon S3) that contains your file. For this article, we are downloading a document from our computer.
Supported file formats are PDF, MD (Markdown), TXT, DOCX, HTML, CSV, XLS and XLSX. Make sure the file size does not exceed 10 MB and does not contain more than 20,000 tokens. A token is considered a unit of text, such as a word, subword, number, or symbol, treated as a single entity. Due to the predefined ingest token limit, it is recommended to use a file smaller than 10 MB. However, a text-heavy file much smaller than 10 MB can potentially exceed the token limit.
You are now ready to chat with your document.
As shown in the following screenshot, you can chat with your document in real time.
To personalize your prompt, enter your prompt under System fast.
Likewise, you can use the AWS SDK through the retrieve_and_generate
APIs in major coding languages. In the following example, we use the AWS SDK for Python (Boto3):
Conclusion
In this article, we explained how Knowledge Bases for Amazon Bedrock now makes it easier to ask questions about a single document. We explored the fundamental concepts of RAG, the challenges this new feature addresses, and the different use cases it enables across different roles and industries. We also demonstrated how to configure and use this feature through the Amazon Bedrock Console and AWS SDK, demonstrating the simplicity and flexibility of this feature, which provides a configuration-free solution for collecting information from a single document, without configuring vector database. .
To further explore knowledge base capabilities for Amazon Bedrock, see the following resources:
Share and learn with our generative AI community on community.aws.
About the authors
Suman Debnath is a leading developer advocate for machine learning at Amazon Web Services. He frequently speaks at conferences, events and AI/ML meetups around the world. He is passionate about large-scale distributed systems and is a big fan of Python.
Sébastien Munera is a Software Engineer on the Amazon Bedrock Knowledge Base team at AWS, where he focuses on building customer solutions that leverage generative AI and RAG applications. He previously worked on creating generative AI-based solutions enabling clients to streamline their Low Code/No Code processes and applications. In his spare time, he enjoys running, lifting weights, and tinkering with technology.