Bedrock AgentCore

AWS Bedrock AgentCore tools for code interpretation and browser automation

Diagram

Input

Agent

Tool

Output

Bedrock AgentCore

AWS Bedrock AgentCore provides code interpretation and browser automation capabilities.

Installation

bash
npm install praisonai-ts

Code Interpreter

Execute Python code in a sandboxed environment:

typescript
import { Agent, bedrockCodeInterpreter } from 'praisonai-ts';

const codeInterpreter = bedrockCodeInterpreter({
  // Optional configuration
});

const agent = new Agent({
  name: 'CodeAgent',
  instructions: 'You help with data analysis using Python code.',
  tools: [codeInterpreter],
});

const response = await agent.chat('Calculate the factorial of 10');

Browser Tools

Navigate

typescript
import { bedrockBrowserNavigate } from 'praisonai-ts';

const navigate = bedrockBrowserNavigate();

const agent = new Agent({
  name: 'BrowserAgent',
  instructions: 'You help navigate websites.',
  tools: [navigate],
});

Click

typescript
import { bedrockBrowserClick } from 'praisonai-ts';

const click = bedrockBrowserClick();

Fill Form

typescript
import { bedrockBrowserFill } from 'praisonai-ts';

const fill = bedrockBrowserFill();

Configuration

typescript
interface CodeInterpreterConfig {
  timeout?: number;      // Execution timeout in ms
  maxMemory?: number;    // Max memory in MB
}

interface BrowserConfig {
  headless?: boolean;    // Run in headless mode
  timeout?: number;      // Navigation timeout
}

Environment Variables

VariableRequiredDescription
AWS_ACCESS_KEY_IDYesAWS access key
AWS_SECRET_ACCESS_KEYYesAWS secret key
AWS_REGIONYesAWS region

Related