> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agenite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Explore real-world examples of Agenite in action

This page contains examples demonstrating how to use Agenite for various use cases. Each example showcases different features and capabilities of the framework.

## Example repository

All examples are available in our GitHub repository:

> [card] [Agenite Examples](https://github.com/agenite/agenite/tree/main/examples)
>
> Browse the full collection of examples on GitHub

## Featured examples

### Basic agent with calculator tool

This example demonstrates a simple agent that uses a calculator tool to perform math operations.

```typescript theme={null}
import { Agent } from '@agenite/agent';
import { Tool } from '@agenite/tool';
import { BedrockProvider } from '@agenite/bedrock';

// Create a calculator tool
const calculatorTool = new Tool<{ expression: string }>({
  name: 'calculator',
  description: 'Perform basic math operations',
  inputSchema: {
    type: 'object',
    properties: {
      expression: { type: 'string' },
    },
    required: ['expression'],
  },
  execute: async ({ input }) => {
    try {
      const result = new Function('return ' + input.expression)();
      return { isError: false, data: result.toString() };
    } catch (error) {
      return { isError: true, data: 'Error calculating expression' };
    }
  },
});

// Create an agent
const agent = new Agent({
  name: 'math-buddy',
  provider: new BedrockProvider({
    model: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
  }),
  tools: [calculatorTool],
  instructions: 'You are a helpful math assistant.',
});

// Example usage
const result = await agent.execute({
  messages: [
    {
      role: 'user',
      content: [{ type: 'text', text: 'What is 1234 * 5678?' }],
    },
  ],
});
```

### Multi-tool agent

This example shows an agent using multiple tools to provide a more comprehensive service.

> [card] [Multi-tool Agent Example](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src/custom-steps.ts)
>
> View on GitHub

### Custom steps implementation

Learn how to create custom steps for more complex agent workflows.

> [card] [Custom Steps Example](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src/custom-steps.ts)
>
> View on GitHub

### Streaming responses

This example demonstrates how to stream responses from an agent in real-time.

> [card] [Streaming Example](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src/old-examples/advanced/streaming-agent.ts)
>
> View on GitHub

## Categories

Browse examples by category:

> [card] [Basic examples](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src)
>
> Start with these simple examples to learn the basics of Agenite

> [card] [Advanced examples](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src/old-examples/advanced)
>
> Complex examples showcasing advanced features

> [card] [Provider examples](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src)
>
> Examples using different LLM providers

> [card] [Tool examples](https://github.com/agenite/agenite/tree/main/examples/@agenite/agent/src)
>
> Various tool implementations

## Next steps

> [card] [API reference](https://docs.agenite.com/api-reference/agent.md)
>
> Explore the detailed API documentation

> [card] [Core concepts](https://docs.agenite.com/core-concepts/overview.md)
>
> Learn about the fundamental concepts


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.