Skip to content
Docs
Get startedPython SDK - AGNT5

AGNT5 Python SDK

Build AI agents and durable workflows with the AGNT5 Python SDK


Build AI agents and reliable workflows with automatic recovery. AGNT5 combines agent orchestration and fault-tolerant execution in one lightweight framework.

Primitives comparison

AttributeFunctionEntityWorkflowAgentTool
WhatStateless operation with retriesStateful component with unique keyMulti-step orchestrated processLLM with instructions and toolsPython function LLMs can call
StateNoneIsolated per entity keyIsolated per workflow instanceConversation history via EntityNone
DurabilityAutomatic retries, checkpointingPersistent state across runsCheckpointed steps, resume on failureContext preserved in EntityRuns within agent context
Best ForDocument analysis, embeddings generation, LLM API callsAI chat sessions, agent memory, conversation historyRAG pipelines, content generation with review, AI evalsCustomer support, research assistants, code reviewVector search, knowledge base queries, API integrations

Key Features

  • Automatic recovery from failures with configurable retry policies
  • Checkpointing resumes from exact failure point
  • Multi-agent coordination via handoffs and composition
  • Python-native - decorators, async/await, type hints
  • Multi-provider - OpenAI, Anthropic, Groq, Azure, Bedrock, OpenRouter
  • Built-in tracing for debugging and monitoring

Installation

pip install agnt5

Quick example

from agnt5 import Agent, workflow, tool, Context, WorkflowContext

# Define a tool for the agent
@tool(auto_schema=True)
async def search_docs(ctx: Context, query: str) -> str:
    """Search documentation for answers."""
    # Your search logic here
    return f"Found documentation about: {query}"

# Create an AI agent with tools
agent = Agent(
    name="assistant",
    model="openai/gpt-4o-mini",
    instructions="You are a helpful assistant. Search docs when needed.",
    tools=[search_docs]
)

# Create a durable workflow that orchestrates the agent
@workflow
async def process_question(ctx: WorkflowContext, question: str) -> dict:
    """Durable workflow for processing questions."""

    # Step 1: Get answer from agent (checkpointed)
    answer = await ctx.step("get_answer", agent.run(question))

    # Step 2: Store result (checkpointed)
    await ctx.step("store", save_answer(question, answer))

    return {"question": question, "answer": answer}

# If this crashes after step 1, it resumes from step 2 on restart

Note: Set your OPENAI_API_KEY environment variable before running.

Next Steps

Getting Started

Core Primitives

  • Functions - Stateless operations with retries
  • Entities - Stateful components with unique keys
  • Workflows - Multi-step orchestration patterns
  • Context API - Orchestration, state, AI, and observability APIs

Agent Development Kit (ADK)

  • Agents - Autonomous LLM-driven systems
  • Sessions - Conversation containers and multi-agent coordination
  • Tools - Callable capabilities that extend agent abilities
  • Memory - Long-term knowledge storage with semantic search

Examples

Modules

Detailed reference for each Python SDK module. Each page is also available as markdown for AI agents (append .md to the URL).

© 2026 AGNT5
llms.txt