Skip to content

eleva/cloudformation-knowledge-base-bedrock-pinecone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ AWS CloudFormation Template for Amazon Bedrock Knowledge Base with Pinecone Integration

๐Ÿ“– Read more

You can find detailed article on this template here

๐Ÿ“Œ Overview

This AWS CloudFormation template provisions an Amazon Bedrock knowledge base integrated with Pinecone for vector storage. It also creates an Amazon S3 bucket for knowledge base data, an IAM role with necessary permissions, and an AWS Secrets Manager secret to store the Pinecone API key.

๐Ÿ“ฆ Resources Created

1. ๐Ÿ—„๏ธ Amazon S3 Bucket

  • Stores data for the Amazon Bedrock knowledge base.
  • Named dynamically based on the KnowledgeBaseName parameter.

2. ๐Ÿ” IAM Role for Amazon Bedrock

  • Grants Amazon Bedrock permissions to:
    • Access the S3 bucket.
    • Retrieve the Pinecone API key from AWS Secrets Manager.
    • Invoke the Amazon Titan embedding model.

3. ๐Ÿ”‘ AWS Secrets Manager Secret

  • Stores the Pinecone API key securely.
  • Secret name is derived from the KnowledgeBaseName parameter.

4. ๐Ÿ“š Amazon Bedrock Knowledge Base

  • Configured as a vector-based knowledge base.
  • Uses the specified embedding model for text embeddings.
  • Stores vector data in Pinecone.

5. ๐Ÿ“ฅ Amazon Bedrock Data Source

  • Configured to ingest data from the provisioned S3 bucket.

โš™๏ธ Parameters

Parameter Name Description Default Value
EmbeddingModel ARN of the embedding model to use. Defaults to Amazon Titan v2. arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0
KnowledgeBaseName Name of the knowledge base. knowledge-base
PineconeConnectionString Pinecone connection string (API endpoint). https://xxx.xxx.xxx.pinecone.io
PineconeApiKey Pinecone API Key for authentication. {"apiKey": "xxxx_xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
TextField Field name in Pinecone to store raw text data. text
MetadataField Field name in Pinecone to store metadata. metadata

๐Ÿš€ Usage Instructions

  1. ๐Ÿ“ค Deploy the CloudFormation Stack

    • Navigate to the AWS CloudFormation console.
    • Create a new stack and upload this template.
    • Provide values for parameters if different from defaults.
    • Deploy the stack.
  2. โœ… Verify Created Resources

    • Check the S3 bucket for storage.
    • Ensure the IAM role is properly assigned to Amazon Bedrock.
    • Validate the knowledge base and its Pinecone integration.

๐Ÿ”’ Security Considerations

  • The Pinecone API key is stored securely in AWS Secrets Manager.
  • The IAM role follows the principle of least privilege, allowing only necessary actions.

๐Ÿ”ฎ Future Enhancements

  • Add support for additional vector database options.
  • Implement tighter access controls on the Pinecone API key.
  • Automate data ingestion workflows.

This template enables seamless integration between Amazon Bedrock and Pinecone for a scalable, vector-based knowledge retrieval system.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published