Appearance
Getting Started
Installation
bash
npm install agentree zod
Your First Agent
typescript
import { Agent, tool } from 'agentree';
import { z } from 'zod';
const weatherTool = tool({
name: 'get_weather',
description: 'Get weather for a city',
parameters: z.object({
city: z.string()
}),
execute: async ({ city }) => {
return `The weather in ${city} is sunny!`;
}
});
const agent = new Agent({
name: "weather-assistant",
task: "Tell me the weather in Paris",
tools: [weatherTool]
});
const result = await agent.execute();
console.log(result);
What Just Happened?
- Agent created with a specific task
- Tool provided for weather lookup
- Agent executed and used the tool automatically
- Result returned with the weather information
Next Steps
- Core Concepts - How agents create children
- Examples - More complex scenarios
- Custom Tools - Build your own tools