agentle.agents.agent_pipeline¶
Agent Pipeline Module for the Agentle Framework
This module provides functionality for creating sequential pipelines of AI agents, where the output of one agent becomes the input to the next. Pipelines offer a deterministic way to decompose complex tasks into a series of simpler steps handled by specialized agents.
Unlike the AgentTeam which uses an orchestrator to dynamically select agents, AgentPipeline follows a fixed sequence of predefined agents, providing a more predictable execution flow. This is particularly useful for workflows where:
The sequence of operations is known in advance
Each step builds upon the results of the previous step
A clear division of responsibility between agents is needed
Example: ```python from agentle.agents.agent import Agent from agentle.agents.pipelines.agent_pipeline import AgentPipeline from agentle.generations.providers.google.google_genai_generation_provider import GoogleGenaiGenerationProvider
# Create specialized agents research_agent = Agent(
name=”Research Agent”, instructions=”You are a research agent. Your task is to gather information on a topic.”, model=”gemini-2.0-flash”, generation_provider=GoogleGenaiGenerationProvider(),
)
- analysis_agent = Agent(
name=”Analysis Agent”, instructions=”You are an analysis agent. Your task is to analyze information and identify patterns.”, model=”gemini-2.0-flash”, generation_provider=GoogleGenaiGenerationProvider(),
)
- summary_agent = Agent(
name=”Summary Agent”, instructions=”You are a summary agent. Your task is to create concise summaries.”, model=”gemini-2.0-flash”, generation_provider=GoogleGenaiGenerationProvider(),
)
# Create a pipeline of agents pipeline = AgentPipeline(agents=[research_agent, analysis_agent, summary_agent])
# Run the pipeline result = pipeline.run(“Tell me about renewable energy technologies”) print(result.generation.text) ```
Functions
|
!!! abstract "Usage Documentation" |
|
Runs a callable synchronously. |
Classes
|
The main class of the Agentle framework that represents an intelligent agent. |
|
A sequential pipeline of AI agents where the output of one agent becomes the input to the next. |
|
Represents the complete result of an agent execution. |
|
Special type indicating an unconstrained type. |
|
Alias for pydantic.BaseModel. |
|
All the operations on a read-write sequence. |
|
All the operations on a read-only sequence. |