A powerful yet elegant framework for AI agents

Agentle makes it effortless to create, compose, and deploy intelligent AI agents - from simple task-focused agents to complex multi-agent systems.

Python 3.13+ MIT License PyPI version
quickstart.py
from agentle.agents.agent import Agent
from agentle.generations.providers.google import GoogleGenerationProvider

# Create a simple agent
agent = Agent(
    name="Quick Start Agent",
    generation_provider=GoogleGenerationProvider(),
    model="gemini-2.0-flash",
    instructions="You are a helpful assistant."
)

# Run the agent
response = agent.run("What are the three laws of robotics?")

# Print the response
print(response.text)
Gemini LangFuse BlackSheep Streamlit Pydantic A2A Protocol

Features

Everything you need for AI agents

Built with developer productivity and type safety in mind, Agentle provides a clean, intuitive API.

Simple Agent Creation

Build powerful AI agents with minimal code using a clean, intuitive API.

Composable Architecture

Create sequential pipelines or dynamic teams of specialized agents for complex tasks.

Tool Integration

Seamlessly connect agents to external tools and functions to perform actions beyond text generation.

Structured Outputs

Get strongly-typed responses with Pydantic integration for predictable data handling.

Built-in Observability

Automatic tracing via Langfuse with extensible interfaces for monitoring agent performance.

Ready for Production

Deploy as APIs (BlackSheep), UIs (Streamlit), or embedded in applications.

Agent-to-Agent (A2A)

Support for Google's standardized A2A protocol for seamless agent communication.

Prompt Management

Flexible system for organizing and managing prompts for consistent agent behavior.

Knowledge Integration

Seamlessly incorporate static knowledge from documents, URLs, or text.

Examples

See Agentle in action

Here are some examples of what you can build with Agentle.

Tool Integration

weather_agent.py
def get_weather(location: str) -> str:
    """
    Get the current weather for a location.

    Args:
        location: The city or location to get weather for

    Returns:
        A string describing the weather
    """
    weather_data = {
        "New York": "Sunny, 75°F",
        "London": "Rainy, 60°F",
        "Tokyo": "Cloudy, 65°F",
        "Sydney": "Clear, 80°F",
    }
    return weather_data.get(location, f"Weather data not available for {location}")

# Create an agent with a tool
weather_agent = Agent(
    name="Weather Assistant",
    generation_provider=GoogleGenaiGenerationProvider(),
    model="gemini-2.0-flash",
    instructions="You are a helpful assistant that can answer questions about the weather.",
    tools=[get_weather]  # Pass the function as a tool
)

# The agent will automatically use the tool when appropriate
response = weather_agent.run("What's the weather like in Tokyo?")

Structured Outputs

structured_outputs.py
from pydantic import BaseModel
from typing import List, Optional
from agentle.agents.agent import Agent
from agentle.generations.providers.google import GoogleGenerationProvider

# Define your output schema with Pydantic
class WeatherForecast(BaseModel):
    location: str
    current_temperature: float
    conditions: str
    forecast: List[str]
    humidity: Optional[int] = None

# Create an agent with structured output
structured_agent = Agent(
    name="Weather Agent",
    generation_provider=GoogleGenerationProvider(),
    model="gemini-2.0-flash",
    instructions="You are a weather forecasting assistant. Provide accurate forecasts.",
    response_schema=WeatherForecast  # Define the expected response structure
)

# Run the agent
response = structured_agent.run("What's the weather like in San Francisco?")

# Access structured data with type hints
weather = response.parsed
print(f"Weather for: {weather.location}")
print(f"Temperature: {weather.current_temperature}°C")
print(f"Conditions: {weather.conditions}")
print(f"Forecast: {', '.join(weather.forecast)}")
if weather.humidity:
    print(f"Humidity: {weather.humidity}%")

Agent Pipelines

agent_pipeline.py
from agentle.agents.agent import Agent
from agentle.agents.agent_pipeline import AgentPipeline

# Create specialized agents
research_agent = Agent(
    name="Research Agent",
    generation_provider=provider,
    model="gemini-2.0-flash",
    instructions="""You are a research agent focused on gathering information.
    Be thorough and prioritize accuracy over speculation."""
)

analysis_agent = Agent(
    name="Analysis Agent",
    generation_provider=provider,
    model="gemini-2.0-flash",
    instructions="""You are an analysis agent that identifies patterns.
    Highlight meaningful relationships and insights from the data."""
)

summary_agent = Agent(
    name="Summary Agent",
    generation_provider=provider,
    model="gemini-2.0-flash",
    instructions="""You are a summary agent that creates concise summaries.
    Present key findings in a logical order with accessible language."""
)

# Create a pipeline
pipeline = AgentPipeline(
    agents=[research_agent, analysis_agent, summary_agent],
    debug_mode=True  # Enable to see intermediate steps
)

# Run the pipeline
result = pipeline.run("Research the impact of artificial intelligence on healthcare")

Monitoring & Observability

Full visibility into your agents

Built-in integration with Langfuse gives you complete observability into your agent's behavior, making debugging and optimizing performance easier than ever.

Automatic tracing of all agent interactions

Performance analytics to identify bottlenecks

Detailed logs of token usage and costs

Langfuse Dashboard Screenshot

Ready to build with Agentle?

Join the community of developers building the next generation of AI agents.