Voiced by Amazon Polly |
Overview
Businesses rely on structured data to manage operations effectively in today’s data-driven world. Amazon Bedrock Knowledge Bases now supports structured data retrieval, enabling natural language querying to access structured data from various sources. This enhancement allows developers to build custom generative AI applications seamlessly incorporating contextual information from structured and unstructured data. By leveraging natural language processing (NLP), Amazon Bedrock Knowledge Bases can transform user queries into SQL, executing them directly on supported databases without requiring data movement or preprocessing.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Introduction
Integrating structured data into generative AI applications has traditionally been challenging due to the complexities of training large language models (LLMs) to generate SQL queries based on intricate database schemas. Ensuring proper data governance and security adds another layer of difficulty. Amazon Bedrock Knowledge Bases addresses these challenges with a fully managed Natural Language to SQL (NL2SQL) module. Users can now retrieve structured data effortlessly by asking questions in plain language, and Amazon Bedrock Knowledge Bases will automatically generate and execute the corresponding SQL queries.
Currently, this feature supports Amazon Redshift and Amazon Sagemaker Lakehouse, offering a streamlined solution for structured data retrieval in all commercial regions where Amazon Bedrock Knowledge Bases are available.
Amazon Bedrock Knowledge Bases
Amazon Bedrock Knowledge Bases enables users to integrate with structured data stores such as Amazon Redshift and AWS Glue Data Catalog. It translates natural language queries into SQL queries, retrieves relevant data, and generates responses. Key functionalities include:
- Retrieve operation: Fetches data from the knowledge base.
- RetrieveAndGenerate operation: Generates responses based on the retrieved data.
- GenerateQuery operation: Converts user queries into SQL statements without retrieving data.
Businesses can streamline data access and improve decision-making processes by leveraging these capabilities.
Connecting a Knowledge Base to a Structured Data Store
To connect a knowledge base to a structured data store, you must specify the following components:
- Data Store Selection: You can connect to Amazon Redshift or AWS Glue Data Catalog.
- Query Engine: Amazon Bedrock currently supports Amazon Redshift for SQL query generation.
- Authentication Methods: Various authentication methods ensure secure access:
- AWS IAM Role: Uses an AWS IAM service role with necessary permissions.
- Temporary Credentials: Authenticates via a database user.
- AWS Secrets Manager: Utilizes stored credentials for secure authentication.
- Query Configurations (Optional): Enhance SQL generation accuracy using:
- Maximum query time limits
- Metadata descriptions for tables and columns
- Inclusion/exclusion lists to filter tables or columns
- Curated queries with pre-defined SQL examples
Steps to Set Up a Knowledge Base
Using AWS Console
- Sign in to the AWS Management Console.
- Navigate to Knowledge Bases and select Create Knowledge Base with Structured Data Store.
- Configure settings such as query engine, AWS IAM role, and authentication method.
- Choose a data store, enter database details, and modify query configurations if needed.
- Review and confirm settings to create the knowledge base.
Using Amazon Bedrock API
Send a CreateKnowledgeBase request with the following JSON body:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
{ "name": "example_knowledge_base", "roleArn": "arn:aws:iam::<account_ID>:role/BedrockRole", "knowledgeBaseConfiguration": { "type": "SQL", "sqlKnowledgeBaseConfiguration": { "queryEngineType": "REDSHIFT" } }, "description": "A structured data knowledge base", "tags": { "Project": "DataManagement" } } |
Syncing a Structured Data Store with Amazon Bedrock
You must sync the knowledge base to ingest metadata once the knowledge base is connected. This allows Amazon Bedrock to process user queries efficiently. You should also re-sync whenever database schema changes occur.
Syncing via AWS Console
- Open the Amazon Bedrock console.
- Navigate to Knowledge Bases and select your knowledge base.
- Under Data Source, click Sync to begin metadata ingestion.
- Check sync status and view logs for any warnings or errors.
Syncing via API
Use the SyncKnowledgeBase API request to initiate synchronization.
Structured Data Retrieval (SQL Generation) Pricing
Structured Data Retrieval incurs charges per request for generating SQL queries. These queries are used to fetch data from structured databases.
Region: Asia Pacific (Mumbai)
- Feature: Structured Data Retrieval (SQL Generation)
- Pricing: $2.00 per 1,000 queries
Conclusion
Amazon Bedrock Knowledge Bases streamlines the querying of structured data, improving accessibility and efficiency.
Drop a query if you have any questions regarding Amazon Bedrock Knowledge Bases and we will get back to you quickly.
Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.
- Reduced infrastructure costs
- Timely data-driven decisions
About CloudThat
CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.
FAQs
1. What is a structured data store?
ANS: – A structured data store is a database that organizes data in a predefined schema, such as tables and columns. Examples include Amazon Redshift and AWS Glue Data Catalog.
2. Can I use a query engine that is different from Amazon Redshift?
ANS: – Currently, Amazon Bedrock only supports Amazon Redshift as the query engine for structured data stores.

WRITTEN BY Aditya Kumar
Aditya works as a Senior Research Associate – AI/ML at CloudThat. He is an experienced AI engineer with a strong focus on machine learning and generative AI solutions. He has contributed to a wide range of projects, including OCR systems, video behavior analysis, confidence scoring, and RAG-based chatbots. He is skilled in deploying end-to-end ML pipelines using services like Amazon SageMaker and Amazon Bedrock. With multiple AWS certifications, he is passionate about leveraging cloud and AI technologies to solve complex business problems. Outside of work, Aditya stays updated on the latest advancements in AI and enjoys experimenting with emerging tools and frameworks.
Comments