Bedrock Example
This example demonstrates how to use Amazon Bedrock with Agenite to create AI agents that can process user inputs and generate responses using different models (Deepseek and Claude).
Prerequisites
- AWS Account with access to Amazon Bedrock
- AWS credentials configured locally with appropriate permissions
- Node.js installed on your system
Setup
- Install dependencies:
pnpm install
- Configure AWS Credentials:
Make sure you have your AWS credentials configured either through:
- AWS CLI (
aws configure
)
- Environment variables
- AWS credentials file
Running the Examples
The examples include simple demonstrations using different Bedrock models to answer questions.
Deepseek Example
tsx src/deepseek-r1/agent.ts
Claude Sonnet Example
tsx src/claude-sonnet-3.7/agent.ts
Both examples will:
- Initialize an AI agent using the Bedrock provider
- Process a sample question about counting letters in "strawberry"
- Display the agent's reasoning and answer
- Show any tool results used during the process
Configuration
Deepseek Configuration
- Model:
us.deepseek.r1-v1:0
- Region:
us-west-2
- File:
src/deepseek-r1/agent.ts
Claude Sonnet Configuration
- Model:
us.anthropic.claude-3-7-sonnet-20250219-v1:0
- Region:
us-east-2
- Additional settings:
enableReasoning: true
reasoningBudgetTokens: 4000
- File:
src/claude-sonnet-3.7/agent.ts
You can modify these settings in their respective files if needed.
Output Format
Both examples will display:
- User Input (in blue)
- Thinking/Reasoning Process (in yellow)
- Assistant's Response (in green)
- Tool Usage (in cyan, if any)
- Tool Results (in blue, if any)
- Completion message
Note
Make sure you have the necessary AWS permissions to access Amazon Bedrock and the specific models being used in the examples. Different models may require different permissions in your AWS Bedrock setup.