Skip to content
AgentField
SDKs

Python SDK

Build agents with the AgentField Python SDK

Python SDK — pip install agentfield

Build AI agents as production microservices with Python.

The Python SDK turns registered reasoners and skills into callable agent endpoints with routing, coordination, memory, async execution, and optional DID-backed governance. Identity and verifiable-credential features are available when you enable them.

Install

pip install agentfield

Requires Python 3.8+. The package version is currently 0.1.61.

Quick Start

from agentfield import Agent, AIConfig
from pydantic import BaseModel

app = Agent(
    node_id="my-agent",
    ai_config=AIConfig(model="anthropic/claude-sonnet-4-20250514"),
)

class Summary(BaseModel):
    title: str
    key_points: list[str]

@app.reasoner()
async def summarize(text: str) -> dict:
    result = await app.ai(
        system="You are a concise summarizer.",
        user=text,
        schema=Summary,
    )
    return result.model_dump()

app.run()

Start the control plane and your agent:

af server          # Terminal 1 — Dashboard at http://localhost:8080
python app.py      # Terminal 2 — Agent auto-registers

Call your agent:

curl -X POST http://localhost:8080/api/v1/execute/my-agent.summarize \
  -H "Content-Type: application/json" \
  -d '{"input": {"text": "AgentField is an open-source control plane..."}}'