Skip to content

Latest commit

 

History

1,904 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AgentField is an open-source framework and control plane for digital AI workers. You write a worker as plain Python, Go or TypeScript, on any model or coding harness such as Claude Code or Codex; AgentField runs it as an API that any service can call, with queues, retries, memory, an identity of its own and a signed record of every call. The same code runs one agent on your laptop or ten thousand in one workflow.

agentfield-readme-film.mp4

AgentField in three minutes. Functions that think become APIs, governed and observed.

Quick start

curl -fsSL https://agentfield.ai/install.sh | bash

Then, in Claude Code, Codex, Gemini CLI, OpenCode, Cursor or any coding agent, describe the system you want:

/agentfield Build a claims processor with risk scoring, pattern detection,
and human approval for low-confidence decisions.

You get a Docker Compose stack wired end to end: the agent, the control plane and a REST endpoint you can curl straight away. See it in action →

Installer options

The installer also installs the codeaf coding harness in $AGENTFIELD_HOME/bin (~/.agentfield/bin by default), so harness-backed agents work out of the box; skip it with --no-codeaf (--no-aforge remains an alias). Staging uses ~/.agentfield-staging; an explicit AGENTFIELD_HOME selects the production managed home. AGENTFIELD_INSTALL_DIR selects the af directory; CodeAF always uses the managed home's bin. Repair it with af codeaf ensure. The provider name aforge remains an alias; set AFORGE_BIN and select provider="aforge" to pin the legacy adapter. CodeAF state stays isolated in $AGENTFIELD_HOME/codeaf. See harness providers for binary overrides, mirror/skip switches, and telemetry controls.

On macOS the installer does not register anything to run at login. Add the optional menu-bar icon with --with-tray; it registers one login job for the icon, and the icon's Control plane → Start at login switch decides whether the control plane starts at login as well. A machine that already has the icon keeps it and is updated in place (--no-tray skips that). When launchd supervises the control plane, stop it with af service stop or the menu-bar icon — a plain kill looks like a crash and it restarts. af service status shows health and in-flight work.

The DX you get

Plain Python (or Go / TypeScript) functions. No DSL, no YAML, no graph wiring.

import asyncio
from agentfield import Agent, AIConfig
from pydantic import BaseModel

app = Agent(
    node_id="researcher",
    version="1.0.0",# Canary deploys, A/B testing, blue-green rollouts
    ai_config=AIConfig(model="anthropic/claude-sonnet-4-20250514"),
)

class SubQuestions(BaseModel):
    questions: list[str]

@app.reasoner(tags=["research"])
async def research(question: str, depth: int = 0, model: str | None = None) -> dict:

    if depth >= 3:  # depth cap keeps fan-out bounded
        answer = await app.ai(system="Answer directly and concisely.", user=question, model=model)
        return {"question": question, "answer": answer}

    # Break the question into sub-questions
    plan = await app.ai(
        system="Break this into 3-5 independent sub-questions.",
        user=question, schema=SubQuestions, model=model,
    )

    # Fan out: each sub-question recurses on this same agent, through the control plane
    branches = await asyncio.gather(*[
        app.call(f"{app.node_id}.research", question=q, depth=depth + 1, model=model)
        for q in plan.questions
    ])

    # Synthesize the branches back into one answer
    synthesis = await app.ai(system="Synthesize these findings.", user=str(branches), model=model)
    return {"question": question, "answer": synthesis, "branches": branches}

app.run()
# This single line exposes: POST /api/v1/execute/researcher.research
# One request fans out to thousands of agents. The control plane queues, retries, and traces
# every branch. No broker, no queue setup, no timeout.

What you just saw: app.ai() calls an LLM and returns structured output. app.call() routes to other agents (or back to itself) through the control plane, so recursion becomes distributed fan-out. asyncio.gather() runs every branch in parallel. app.run() auto-exposes everything as REST. Read the full docs →

Need approvals, audit trails, and governance? (the enterprise sample)
from agentfield import Agent, AIConfig
from pydantic import BaseModel

app = Agent(
    node_id="claims-processor",
    version="2.1.0",# Canary deploys, A/B testing, blue-green rollouts
    ai_config=AIConfig(model="anthropic/claude-sonnet-4-20250514"),
)

class Decision(BaseModel):
    action: str# "approve", "deny", "escalate"
    confidence: float
    reasoning: str

@app.reasoner(tags=["insurance", "critical"])
async def evaluate_claim(claim: dict) -> dict:

    # Structured AI judgment - returns typed Pydantic output
    decision = await app.ai(
        system="Insurance claims adjuster. Evaluate and decide.",
        user=f"Claim #{claim['id']}: {claim['description']}",
        schema=Decision,
    )

    if decision.confidence < 0.85:
        # Human approval - suspends execution, notifies via webhook, resumes when approved
        await app.pause(
            approval_request_id=f"claim-{claim['id']}",
            approval_request_url=f"https://internal.acme.com/approvals/claim-{claim['id']}",
            expires_in_hours=48,
        )

    # Route to the next agent - traced through the control plane
    await app.call("notifier.send_decision", input={
        "claim_id": claim["id"],
        "decision": decision.model_dump(),
    })

    return decision.model_dump()

app.run()
# This single line exposes: POST /api/v1/execute/claims-processor.evaluate_claim
# The agent auto-registers with the control plane, gets a cryptographic identity, and every
# execution produces a verifiable, tamper-proof audit trail.

What you just saw: app.ai() calls an LLM and returns structured output. app.pause() suspends for human approval. app.call() routes to other agents through the control plane. app.run() auto-exposes everything as REST. Read the full docs →

Prefer to scaffold by hand? (Python / Go / TypeScript / Docker)
af init my-agent --defaults                            # Scaffold agent
cd my-agent && pip install -r requirements.txt
af server          # Terminal 1 → Dashboard at http://localhost:8080
python main.py     # Terminal 2 → Agent auto-registers
# Call your agent
curl -X POST http://localhost:8080/api/v1/execute/my-agent.demo_echo \
  -H "Content-Type: application/json" \
  -d '{"input": {"message": "Hello!"}}'
# Go
af init my-agent --defaults --language go && cd my-agent && go run .

# TypeScript
af init my-agent --defaults --language typescript && cd my-agent && npm install && npm run dev

# Docker (control plane only)
docker run -p 8080:8080 agentfield/control-plane:latest

Deployment guide → for Docker Compose and production setups, or use the repository's Kubernetes deployment guide.

See it in action

The AgentField control plane UI: a claims run paused until a person approves it, the same run drawn as a graph of agent calls with timings, the runs list with status, steps and duration, and registered agent nodes with their tags.

Architecture

Your app, events and other agents call your AI workers through the AgentField control plane, which runs, governs and observes them. Workers run anywhere, in Python, Go or as coding agents like Claude Code, on any model in your cloud.

The control plane is a stateless Go service. Agents connect from anywhere: your laptop, Docker, Kubernetes. They register what they can do, the control plane routes calls between them, tracks every run as a DAG and enforces policy. Full architecture docs →

How AgentField fits in your stack

Most agent tools help you write agent logic. AgentField is what runs it in production: the layer that makes agents callable by other software, durable across failures, and observable when one request fans out to a thousand branches. You write the agents in AgentField itself, in place of a framework: a reasoner is a plain Python, TypeScript or Go function, and AgentField gives it everything around it.

Frameworks
LangChain · CrewAI · PydanticAI · OpenAI Agents SDK
Workflow engines
Temporal · Airflow
Visual builders
n8n · Zapier
AgentField
Build agent logic (prompts, tools, structured output) ● — — ●
Prebuilt chains, retrievers, integrations ● — ◐ ◐
Production REST APIs out of the box — ◐ ● ●
Async + retries + webhooks — ● ◐ ●
Memory scopes (global · actor · session · workflow) ◐ — — ●
Service discovery + cross-agent calls — — — ●
Distributed agents (register from anywhere, one mesh) — ◐ — ●
Coding agents as functions (Claude Code · Codex · CLI) — — — ●
Agent identity, access policies, signed audit trails — — — ●
Fleet observability (DAGs · metrics · traces) — ◐ — ●
Multi-language SDKs (Python · Go · TypeScript) ◐ ● — ●

● full · ◐ partial · — not the focus

Prototype in whatever you like. The moment a second service needs to call your agent, put it on AgentField. That is the point where you would otherwise start writing queues, retries, discovery, and tracing by hand.

Full comparison & decision guide →

How AgentField compares

AgentField is an open-source (Apache 2.0) framework and control plane: you write agents in it and they run as backend services, so it replaces an agent framework rather than sitting under one.

What it is for Where AgentField differs
LangGraph A graph framework and runtime for stateful agents, with checkpoints and interrupts Agents become HTTP services other software can call, with discovery, policy and a signed audit trail
CrewAI A framework for teams of role-based agents, with a managed option (AMP) Write the agents in AgentField instead: each one is an HTTP service other software can call, with durable runs, identity, policy and audit built in
Temporal Durable execution for workflows that must finish exactly as written, with a full event history Durability without workflow code or determinism rules, plus agent-native reasoners, memory scopes, identity and audit
OpenAI Agents SDK A lightweight agent loop with handoffs, guardrails and tracing, best on OpenAI models Runs agents on any model, switching per call, in Python, TypeScript or Go, on infrastructure you control

Choose LangGraph for an explicit, inspectable graph inside one process, CrewAI to ship a role-based team fast, Temporal when a business process must be correct across failures, and the OpenAI Agents SDK to build on OpenAI models with minimal code; choose AgentField when other services must call your agents, runs are long, and security asks who did what.

How it scales

The control plane is a stateless Go service. You put more of them behind a load balancer and the fleet grows horizontally. Work is admitted into a bounded in-process queue with backpressure (429/503 plus Retry-After). On graceful shutdown, in-flight executions are terminated with status_reason control_plane_shutdown rather than silently dropped.

Property What it means
Stateless Go control plane Horizontal scaling behind a load balancer. Add replicas to add capacity.
Bounded in-process admission Backpressure returns 429/503 with Retry-After; graceful shutdown records control_plane_shutdown.
Async execution Webhooks and SSE, no timeout limits. A single run can go for hours or days.
Backpressure Queue-depth limits and circuit breakers keep a fan-out from overwhelming downstream agents.
Routing overhead Roughly 100-200ms per cross-agent hop. It matters when a branch does little work per hop, so keep hops coarse when latency is tight.

Two examples already run at this load. The deep-research engine fanned out 10,000+ agent invocations in one workflow. The security auditor runs 250 coordinated agents per audit.

Deployment guide → for Docker Compose, Kubernetes, and production setups.

What You Get

Build - Python, Go, or TypeScript. Every function becomes a REST endpoint.

  • Reasoners & Skills - @app.reasoner() for AI judgment, @app.skill() for deterministic code
  • Structured AI - app.ai(schema=MyModel) → typed Pydantic/Zod output from any LLM
  • Harness - app.harness("Fix the bug") dispatches multi-turn tasks to CodeAF, AgentField's own coding harness — no setup. Add provider="claude-code" (or codex, gemini, opencode, pi, omp) to orchestrate someone else's.
  • Cross-Agent Calls - app.call("other-agent.func") routes through the control plane with full tracing
  • Discovery - app.discover(tags=["ml*"]) finds agents and capabilities across the mesh. tools="discover" lets LLMs auto-invoke them.
  • Memory - app.memory.set() / .get() / .similarity_search() - KV + vector search, four scopes, no Redis needed

Scale - Production infrastructure for non-deterministic AI.

  • Async Execution - Fire-and-forget with webhooks, SSE streaming, retries. No timeout limits - agents run for hours or days.
  • Canary Deployments - Traffic weight routing, A/B testing, blue-green deploys. Roll out agent versions at 5% → 50% → 100%.
  • Human-in-the-Loop - app.pause() suspends execution for human approval. Crash-safe, durable, audited.
  • Observability - Automatic workflow DAGs, Prometheus /metrics, structured logs, execution timeline.

Govern - Every agent gets its own cryptographic identity, access policy and a signed record of what it did, built into the open-source control plane. For governance across every agent in the company, see GovernAF.

  • Cryptographic Identity - Every agent gets a W3C DID (decentralized identifier) - not a shared API key. Agents authenticate to each other the way services authenticate with mTLS, but with cryptographic signatures that travel with the agent.
  • Verifiable Credentials - Tamper-proof receipt for every execution. Offline-verifiable: af vc verify audit.json.
  • Policy Enforcement - Tag-based policy gates with cryptographic verification. "Only agents tagged 'finance' can call this" - enforced by infrastructure, not prompts.

See the full production-ready feature set →

All 90+ production features

AI & LLM

Feature How
Structured output (Pydantic/Zod) app.ai(schema=MyModel)
Multi-turn coding agents app.harness("task") — CodeAF by default
Orchestrate another harness app.harness("task", provider="claude-code") (also codex, gemini, opencode, pi, omp)
LLM auto-discovers agents and tools app.ai(tools="discover")
Multimodal (text, image, audio) app.ai("Describe", image_url="...")
Streaming responses app.ai("...", stream=True)
100+ LLMs via LiteLLM AIConfig(model="anthropic/claude-sonnet-4-20250514")
Temperature, max tokens, format app.ai(..., temperature=0.2)

Agent Mesh & Discovery

Feature How
Cross-agent calls with tracing app.call("agent.func", input={...})
Discover agents by tag (wildcards) app.discover(tags=["ml*"])
Discover by health status app.discover(health_status="active")
Agent routers (namespacing) AgentRouter(prefix="billing")
Auto context propagation Workflow, session, actor IDs forwarded
Parallel agent execution asyncio.gather(app.call(...), ...)
Auto-registration on startup Service mesh with zero config

Execution Engine

Feature How
Sync execution (REST) POST /api/v1/execute/{agent}.{func}
Async (fire-and-forget) POST /api/v1/execute/async/{agent}.{func}
Webhooks + HMAC-SHA256 signing AsyncConfig(webhook_url="...", secret="...")
SSE streaming (real-time) /api/v1/execute/stream/{id}
No timeout limits (hours/days) Control plane allows unlimited duration
Execution polling GET /api/v1/executions/{id}
Restart/replay POST /api/v1/executions/{id}/restart
Run naming, labels, links POST /api/v1/runs/{id}/metadata
Batch status checks POST /api/v1/executions/batch-status
Progress updates mid-execution Intermediate payloads during long tasks
Auto retries + exponential backoff Transparent - control plane handles
Backpressure + queue depth limits Fair scheduling, circuit breakers
Bounded in-process queue Backpressure and explicit graceful-shutdown termination

Memory (Distributed State)

Feature How
Key-value storage app.memory.set(key, value) / .get(key)
Vector search (semantic) app.memory.similarity_search(embedding, top_k=5)
Four scopes Global, actor, session, workflow
Reactive memory events @app.memory.on_change("order_*")
Metadata filtering Filter stored values by metadata
Zero dependencies Built into control plane - no Redis

Human-in-the-Loop

Feature How
Durable pause/resume await app.pause(reason="...")
Approval workflows with UI approval_request_url for reviewers
Configurable timeouts expires_in_hours=24 + auto-escalation
Crash-safe state Survives agent restarts

Canary Deployments & Versioning

Feature How
Traffic weight routing 5% → 50% → 100% rollouts
A/B testing 50/50 splits with X-Routed-Version
Blue-green deployments Instant weight switch, zero downtime
Per-version health tracking Unhealthy versions auto-removed
Agent lifecycle states pending → starting → ready → degraded → offline

Identity & Governance

Feature How
Cryptographic identity per agent Auto-generated W3C DID + Ed25519 keys
Verifiable Credentials Tamper-proof receipt per execution
Offline VC verification af vc verify audit.json
Tag-based access policies ALLOW/DENY rules on caller → target tags
Cryptographically signed requests Ed25519 signatures on cross-agent calls
VC hierarchy (3 tiers) Platform → Node → Function control
Agent notes (audit log) app.note("Decision", tags=["critical"])
Non-repudiation Cryptographic proof of actions
Permission request workflows Auto-created when access denied

Observability & Fleet Management

Feature How
Automatic DAG visualization Workflow graphs in dashboard
Prometheus metrics /metrics out of the box
Structured JSON logging Automatic from SDK
Execution timeline Chronological decision trace
Health checks (K8s-ready) /health, /ready endpoints
Correlation IDs X-Workflow-ID, X-Execution-ID
Workflow DAG API GET /api/v1/workflows/{id}/dag
Agent heartbeat monitoring Auto health status transitions

Harness (Multi-turn Coding Agents)

Feature How
Zero-setup default harness CodeAF (codeaf), installed alongside af
Swap the worker, keep the loop provider="claude-code" | "codex" | "gemini" | "opencode" | "pi" | "omp"
Fleet-wide default override AGENTFIELD_HARNESS_PROVIDER=codex
Schema-constrained output schema=ResultModel (Pydantic/Zod)
Cost capping max_budget_usd=3.0
Turn limiting max_turns=100
Tool access control tools=["Read", "Write", "Bash"]
Environment injection env={"KEY": "value"}
System prompt override system_prompt="..."
OpenCode per-run configuration All SDKs preserve caller OPENCODE_CONFIG_CONTENT; AGENTFIELD_OPENCODE_STEPS overrides the default 500 steps
OpenCode prompt compatibility All SDKs support AGENTFIELD_OPENCODE_INLINE_SYSTEM_PROMPT=1 for the opt-in inline rollback
Provider-agnostic reasoning variants variant="high" or a #high model suffix
Multi-layer output recovery Cosmetic repair → retry → full retry

Connector API (Fleet Management)

Feature How
Remote agent management /connector/reasoners
Version traffic control /connector/.../weight
Bearer token auth AGENTFIELD_CONNECTOR_TOKEN
Air-gapped deployment Outbound WebSocket only

Developer Experience

Feature How
CLI scaffolding af init my-agent --defaults --language python|go|typescript
Local dev with dashboard af server → http://localhost:8080
Hot reload af dev auto-detects changes
Auto-REST from decorators Every @app.reasoner() → POST /api/v1/execute/...
Python, Go, TypeScript SDKs Native patterns per language
MCP server integration af add --mcp --url <server>

| Config storage API | POST /api/v1/configs/:key - database-backed | | Docker + Kubernetes ready | Stateless control plane, horizontal scaling |

Explore all features in detail →

Built With AgentField

Each of these is a real, installable agent node. With a control plane running, drop any of them into your setup with a single command — af install <repo-url> clones the repo, isolates its dependencies, and registers the node. You're prompted once for shared secrets like OPENROUTER_API_KEY (stored encrypted and reused across every node), then the node's reasoners are callable over REST or with af call:

af install https://github.com/Agent-Field/SWE-AF             # autonomous engineering team   → node: swe-planner
af install https://github.com/Agent-Field/sec-af             # security auditor              → node: sec-af
af install https://github.com/Agent-Field/cloudsecurity-af   # cloud / IaC security scanner  → node: cloudsecurity
af install https://github.com/Agent-Field/pr-af              # agentic code review           → node: pr-af
af install https://github.com/Agent-Field/person-to-brief-af # cited person intelligence     → node: person-to-brief-af

af run swe-planner                                          # start a node (prompts once for required secrets)
af call swe-planner.build --in '{"goal": "Add JWT auth", "repo_url": "https://github.com/user/my-repo"}'

Full walkthrough — authoring, installing, and configuring nodes: Installing agent nodes →.

Autonomous Engineering Team
Autonomous Engineering Team
One API call spins up PM, architect, coders, QA, reviewers - hundreds of coordinated agents that plan, build, test, and ship.

View project →
Deep Research Engine
Deep Research Engine
Recursive research backend. Spawns parallel agents, evaluates quality, generates deeper agents, and recurses -10,000+ agents per query.

View project →
Reactive MongoDB Intelligence
Reactive MongoDB Intelligence
Atlas Triggers + agent reasoning. Documents arrive raw and leave enriched - risk scores, pattern detection, evidence chains.

View project →
Autonomous Security Audit
Autonomous Security Audit
250 coordinated agents trace every vulnerability source-to-sink and adversarially verify each finding. Confirmed exploits, not pattern flags.

View project →
CloudSecurity AF
CloudSecurity AF
AI-native cloud infrastructure security scanner that performs shift-left attack path analysis directly from IaC, prioritizing the most dangerous risk chains before deployment.

View project →
Agentic PR Reviewer — #1 open-source on Code-Review-Bench
Agentic PR Reviewer
#1 open-source reviewer on Code-Review-Bench - 0.706 golden recall across 42 tools compared, at ~10x lower cost per review. Builds a custom review strategy for every PR, then adversarially challenges its own findings.

View project →
Person to Brief AF
Person to Brief AF
Give it a name and company. It resolves the right identity, researches public professional sources in parallel, verifies claims, and returns an outreach-ready brief plus cited PDF.

View project →

See all examples →

Built something with AgentField? Submit your project to be featured on the examples page.

Part of the AgentField suite

The AgentField suite: WorkAF, an AI workspace for every employee; CodeAF, a software factory for engineering; AgentField, digital workers served as APIs; and GovernAF, enterprise governance and provenance across all three. All on your model, in your infrastructure.

AgentField is the backend of an open-source AI suite your company runs on its own model, in its own cloud.

What it is
WorkAF AI workspace for every employee. People and their agents make docs, decks and apps, and hand recurring work to AgentField workers. Download for Mac
CodeAF Open-source software factory and coding harness, built for open models. app.harness() uses it with no setup. Repo
GovernAF Enterprise governance and provenance across all three: who each agent is, what it may do, and a signed record of what it did. Book a briefing
First on DeepSWE: senior-dev, CodeAF's developer subharness, solved the most tasks (54.9%) at the lowest cost per solved task (1x). Every other harness solved less and paid more per solve: mini-swe-agent 1.9x, codex 2.1x, pi 2.4x, claude-code 3.4x, omp, kilo and opencode about 4.5x, muse-code 11.3x, deepseek-harness 26.6x.

CodeAF ranked #1 on DeepSWE out of ten coding harnesses on the same model (DeepSeek V4 Flash), ahead of Claude Code, Codex and OpenCode, at the lowest cost per solved issue. See the benchmark →

Learn More

AgentField sends privacy-minimized installation and lifecycle telemetry by default; no prompts or execution payloads are sent. Set AGENTFIELD_TELEMETRY_ENABLED=false to disable it. Telemetry details.

The thinking behind AgentField - essays on AI backends, harness orchestration, and the infrastructure production agents actually need.

What is harness orchestration?
What is harness orchestration?
The atomic unit of intelligence is climbing from the model call to the autonomous harness - and what changes when it does.

Read post →
Part 1: The Black Box
Part 1: The Black Box
Treating harnesses like Claude Code and Codex as autonomous, embodied, persistent computational entities.

Read post →
Part 2: Engineering the Membrane
Part 2: Engineering the Membrane
Shaping the boundary surface of a harness across four engineerable dimensions: workspace, drift, verifier placement, and recovery budget.

Read post →
The AI Backend
The AI Backend
Our thesis: in five years every serious software company will run an AI backend - a reasoning layer that makes the decisions that used to be hardcoded.

Read post →
Fan out 1,000 parallel agents from one request
A tutorial on turning a single call into a bounded fan-out across the control plane, with queues, retries, and traces on every branch.

Read post →
Claude Code as a function
Wrap a multi-turn coding harness behind a REST endpoint and call Claude Code the same way you call any other agent.

Read post →

Documentation

Community

License

Apache 2.0