Skip to content
For Developers

Write a function.Get an agent.

Async execution. No timeout limits. Signed webhooks. Cross-agent discovery. Human-in-the-loop. Scales to thousands. Python, Go, or TypeScript.

$curl -sSf https://agentfield.ai/get | sh
main.py
Python
1from agentfield import Agent, AIConfig
2from pydantic import BaseModel
 
3app = Agent(
4node_id="claims-processor",
5version="2.1.0",# Canary deploys, A/B testing, blue-green rollouts
6ai_config=AIConfig(model="anthropic/claude-sonnet-4-20250514"),
7)
 
8class Decision(BaseModel):
9action: str# "approve", "deny", "escalate"
10confidence: float
11reasoning: str
 
12@app.reasoner(tags=["insurance", "critical"])discoverable
13async def evaluate_claim(claim: dict) -> dict:
 
14# Structured AI judgment - returns typed Pydantic output
15decision = await app.ai(structured AI
16system="Insurance claims adjuster. Evaluate and decide.",
17user=f"Claim #{claim['id']}: {claim['description']}",
18schema=Decision,
19)
 
20if decision.confidence < 0.85:
21# Human approval - suspends, notifies, resumes when approved
22await app.pause(human-in-the-loop
23approval_request_id=f"claim-{claim['id']}",
24expires_in_hours=48,
25)
 
26# Route to the next agent - traced through the control plane
27await app.call("notifier.send_decision", input={agent mesh
28"claim_id": claim["id"],
29"decision": decision.model_dump(),
30})
 
31return decision.model_dump()
 
32app.serve()one line to production
33# Exposes: POST /api/v1/execute/claims-processor.evaluate_claim
34# Auto-registers, cryptographic identity, tamper-proof audit trail.