All of these samples use the Amplify AI. To run these samples you will need an AWS account with AWS Amplify set up and access to Bedrock models in the region you want to deploy in.
This guide will walk you through the steps to set up and use this repository. Follow the instructions below to ensure the project is configured correctly.
-
Create a Pinecone Account and Index
- Sign up for a Pinecone account here.
- Create an index within your Pinecone account for vector-based knowledge base storage.
-
Store Pinecone API Key in AWS Secrets Manager
- Save your Pinecone API key in AWS Secrets Manager. This key will be used to authenticate with Pinecone.
-
Update the AWS Account ID
- Open
claude-ai/amplify/backend.ts
. - Replace
<your-aws-accountId>
in the following line with your AWS account ID:arn:aws:bedrock:${cdk.Stack.of(backend.data).region}:<your-aws-accountId>:knowledge-base/${knowledgeBase.knowledgeBaseId}
- Open
-
Configure Pinecone Endpoint and Secret Manager ARN
- Open
claude-ai/amplify/config.ts
. - Update the following fields with your Pinecone index endpoint and the ARN of the secret stored in AWS Secrets Manager:
pineconeEndpoint: "<your-pinecone-endpoint>", pineconeApiKeySecretArn: "<secret-manager-arn>",
- Open
-
Install Dependencies
Run the following command to install all required dependencies:npm install
Or, if you use Yarn:
yarn
-
Create a Cloud Sandbox
Use Amplify to create a cloud sandbox environment:npx amplify sandbox
-
Update the Knowledge Base ID
- Once the sandbox is created, locate the ID of the created Knowledge Base.
- Open
claude-ai/amplify/data/resolvers/kbResolver.js
and replace<your-knowledgeBase-id>
in the following line with the Knowledge Base ID:resourcePath: "/knowledgebases/<your-knowledgeBase-id>/retrieve",
-
Add Files to Knowledge Base Data Source
- Add files that will be referenced for RAG (Retrieval-Augmented Generation) to the created Knowledge Base's data source.
- You can upload these files through the AWS Management Console.
- Refer to the documentation on supported file types here.
- After adding files, press the Sync button in the Knowledge Base settings to ensure the data source is updated.
This library is licensed under the MIT-0 License. See the LICENSE file.