A simple agent with calculator and HTTP tools that answers research questions using the ReAct pattern.
pnpm install# Set environment variables
export GATEWAY_URL=http://localhost:3100
export API_KEY=your-api-key
export MODEL=claude-3-haiku # optional
# Run with default question
npx tsx index.ts
# Run with custom question
npx tsx index.ts "What is the population of France divided by the population of Germany?"- The agent receives a task (question)
- It reasons about what tools to use (ReAct pattern)
- For math questions, it uses the
calculatortool - For web data, it uses the
http_requesttool - It combines results into a final answer