- Newest
- Most votes
- Most comments
Your approach to generating charts using natural language with AWS Bedrock and a vector database is on the right track, but there are some considerations and potential improvements to consider.
First, it's important to note that AWS Bedrock now supports Anthropic's Claude 3.5 Sonnet model, which has advanced capabilities for complex reasoning and quick outputs. This model could be particularly useful for your chart generation task.
Your idea of using tools to instruct the LLM to generate JSON structures for chart libraries is a good one. This approach allows for a separation of concerns, where the LLM focuses on understanding the natural language request and generating the appropriate data structure, while the frontend handles the actual rendering of the chart.
However, instead of relying solely on the vector database to store documentation about chart structures, you might want to consider using Amazon Bedrock's Knowledge Bases feature. This would allow you to securely connect the foundation model (in this case, Claude 3.5 Sonnet) to your internal data sources, including information about chart structures and your actual data.
Here's an improved approach you could consider:
-
Use Amazon Bedrock Knowledge Bases to store both your data and information about chart structures. This allows for Retrieval Augmented Generation (RAG), which can provide more relevant and accurate responses.
-
When a user makes a natural language request for a chart, use the Retrieve and Generate API provided by Amazon Bedrock. This API will query the knowledge base and use the LLM to generate responses based on the retrieved results.
-
In your prompt engineering, include instructions for the LLM to generate the appropriate JSON structure for the requested chart type.
-
On the frontend, use the generated JSON to render the chart using your preferred JavaScript library.
This approach leverages the strengths of the Bedrock ecosystem, particularly the Knowledge Bases feature and the Claude 3.5 Sonnet model's capabilities. It allows for a more integrated and potentially more accurate chart generation process, as the LLM has access to both your data and the chart structure information in a unified knowledge base.
Remember to configure your Knowledge Base with the appropriate vector embeddings model and vector store for optimal performance. You can use various vector store options with Amazon Bedrock Knowledge Bases, including Amazon OpenSearch Serverless, Amazon Aurora, MongoDB Atlas, Pinecone, or Redis Enterprise Cloud, depending on your specific needs and existing infrastructure.
By using this approach, you're not only generating charts based on natural language, but you're also creating a system that can potentially handle more complex queries and provide more insightful visualizations of your data.
Sources
Knowledge Bases for Amazon Bedrock supports Anthropic’s Claude 3.5 Sonnet - AWS
Create an Amazon Bedrock knowledge base - Amazon Bedrock
Dive deep into vector data stores using Amazon Bedrock Knowledge Bases | AWS Machine Learning Blog
Hi,
Yes, it's possible. Watch this video for a full example: https://www.youtube.com/watch?v=dhxrHvgXpSM
Best,
Didier
Relevant content
- asked 5 months ago
- asked 3 months ago
- asked 2 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago