Agentle makes it effortless to create, compose, and deploy intelligent AI agents - from simple task-focused agents to complex multi-agent systems.
from agentle.agents.agent import Agent
from agentle.generations.providers.google.google_genai_generation_provider import GoogleGenaiGenerationProvider
# Create a simple agent
agent = Agent(
name="Quick Start Agent",
generation_provider=GoogleGenaiGenerationProvider(),
model="gemini-2.0-flash",
instructions="You are a helpful assistant who provides concise, accurate information."
)
# Run the agent
response = agent.run("What are the three laws of robotics?")
# Print the response
print(response.text)
Everything you need for AI agents
Built with developer productivity and type safety in mind, Agentle provides a clean, intuitive API.
Simple Agent Creation
Composable Architecture
Tool Integration
Structured Outputs
Built-in Observability
Ready for Production
Agent-to-Agent (A2A)
Prompt Management
Knowledge Integration
See Agentle in action
Here are some examples of what you can build with Agentle.
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?")
from pydantic import BaseModel
from typing import List, Optional
# Define your output schema
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=GoogleGenaiGenerationProvider(),
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}")
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")
Join the community of developers building the next generation of AI agents.