Skip to main content

Basic Agent Creation

Create a simple agent and have a conversation.

Using MCP Tools

Connect an agent to a custom MCP server for specialized capabilities.

Create an MCP Server

First, create a simple MCP server with FastMCP:
mcp_server.py

Connect Agent to MCP Server


Using AgentPress Tools

Create an agent with built-in tools for file operations and web browsing.

Multi-Turn Conversation

Maintain context across multiple agent interactions.

Reusing Agents and Threads

Store and reuse agent and thread IDs across sessions.

Full Example with MCP Server

Complete example showing MCP server setup and agent integration.
example.py

Supporting Files


Error Handling Example

Properly handle errors when working with the SDK.

Updating Agent Configuration

Modify an agent’s behavior and tools dynamically.

Running Multiple Agents in Parallel

Execute multiple agents concurrently for different tasks.

Next Steps

SDK Overview

Learn about SDK concepts and architecture

Python SDK Reference

Complete API reference documentation