MCPcopy Index your code
hub / github.com/Agent-Field/agentfield

github.com/Agent-Field/agentfield @v0.1.97 sqlite

repository ↗ · DeepWiki ↗ · release v0.1.97 ↗
17,588 symbols 72,679 edges 1,720 files 5,875 documented · 33%
README

AgentField — The AI Backend

Build agents like APIs. Run ten thousand of them like microservices.

One request fans out to thousands of agents. The control plane queues, retries, and traces every branch.

Stars License Downloads Coverage Last Commit Discord

Docs · Quick Start · Python SDK · Go SDK · TypeScript SDK · REST API · Examples · Discord

Now includes Harness Orchestration — multi-turn coding agents with Claude Code, Codex, Gemini CLI, and OpenCode

AgentField is an open-source control plane that lets you build AI agents callable by any service in your stack - frontends, backends, other agents, cron jobs - just like any other API. You write agent logic in Python, Go, or TypeScript. AgentField turns it into production infrastructure: routing, coordination, memory, async execution, and observability. Every function becomes a REST endpoint, and the same code scales from one agent on your laptop to ten thousand in a single workflow: the control plane handles the fan-out, the queues, and the retries.

https://github.com/user-attachments/assets/9fb7b1cf-26de-4b9b-9ba2-917252cc26ec

One prompt → a running containerized production ready multi-agent backend. No glue code, start using the agent API!

Build production agents with a prompt.

Describe the system in one line. Get a production-ready multi-agent backend. Works in Claude Code, Codex, Gemini CLI, OpenCode, Aider, Windsurf, and Cursor.

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

Then in your coding agent, paste any spec with /agentfield :

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

You get a Docker Compose stack wired up end-to-end — the agent, the control plane, and a production ready REST API endpoint you can paste and curl into a terminal to try it. See it in action →

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, Kubernetes, and production setups.

See it in action

AgentField Dashboard

Real-time workflow DAGs · Execution traces · Agent fleet management · Audit trails

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. Keep the framework you already use for authoring; a reasoner is a plain function, so existing LangGraph or CrewAI code can run inside one.

| | 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 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 lands in a durable PostgreSQL queue with lease-based processing, so a crash or a restart resumes where it left off instead of dropping the job.

Property What it means
Stateless Go control plane Horizontal scaling behind a load balancer. Add replicas to add capacity.
Durable PostgreSQL queue Lease-based processing. Jobs survive crashes and restarts.
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

*

Extension points exported contracts — how you extend this code

AgentService (Interface)
AgentService defines the contract for agent management operations. This interface abstracts running, stopping, and monit [6 …
control-plane/internal/core/interfaces/services.go
Provider (Interface)
Provider is the interface that CLI-based harness providers implement. Each provider knows how to invoke a specific codin [10 …
sdk/go/harness/provider.go
HarnessProvider (Interface)
(no doc) [30 implementers]
sdk/typescript/src/harness/providers/base.ts
NotificationBellProps (Interface)
* Notification bell + popover center. * * Lives in the sidebar header next to ModeToggle. Always visible, muted at *
control-plane/web/client/src/components/NotificationBell.tsx
ProcessInput (Interface)
(no doc)
examples/ts-node-examples/verifiable-credentials/reasoners.ts
MarkdownContentProps (Interface)
(no doc)
examples/python_agent_nodes/rag_evaluation/ui/components/MarkdownContent.tsx
BenchmarkResult (Interface)
(no doc)
examples/benchmarks/100k-scale/ts-bench/benchmark.ts
Source (Interface)
Source is the common contract every plugin satisfies. Implementations also satisfy exactly one of HTTPSource or LoopSou [13 …
control-plane/internal/sources/source.go

Core symbols most depended-on inside this repo

Run
called by 1461
control-plane/internal/sources/source.go
Set
called by 1029
control-plane/internal/storage/storage.go
JSON
called by 894
sdk/go/ai/response.go
ServeHTTP
called by 845
sdk/go/agent/agent.go
Close
called by 758
control-plane/internal/storage/storage.go
Add
called by 702
control-plane/internal/server/knowledgebase/kb.go
Error
called by 585
control-plane/internal/handlers/execute.go
get
called by 554
sdk/python/agentfield/memory.py

Shape

Function 8,480
Method 6,171
Struct 1,151
Class 894
Interface 734
Route 113
TypeAlias 27
FuncType 18

Languages

Go54%
Python29%
TypeScript17%

Modules by API surface

control-plane/internal/storage/local.go242 symbols
control-plane/internal/handlers/connector/handlers_test.go210 symbols
control-plane/internal/storage/storage.go176 symbols
control-plane/internal/handlers/config_storage_test.go174 symbols
control-plane/internal/server/server_routes_test.go172 symbols
control-plane/internal/handlers/agentic/status_test.go165 symbols
sdk/python/tests/test_types.py114 symbols
sdk/python/agentfield/agent.py113 symbols
control-plane/internal/handlers/execute.go100 symbols
control-plane/internal/handlers/ui/config_test.go99 symbols
control-plane/internal/handlers/execute_test.go96 symbols
control-plane/pkg/types/types.go78 symbols

Dependencies from manifests, versioned

github.com/Agent-Field/agentfield/sdk/gov0.0.0-0001010100000 · 1×
github.com/aymanbagabas/go-osc52/v2v2.0.1 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/boltdb/boltv1.3.1 · 1×
github.com/cespare/xxhash/v2v2.3.0 · 1×
github.com/charmbracelet/colorprofilev0.2.3-0.20250311203 · 1×
github.com/charmbracelet/x/ansiv0.10.1 · 1×

Datastores touched

agentfieldDatabase · 1 repos
agentfield_testDatabase · 1 repos
agentfield_devDatabase · 1 repos
controlDatabase · 1 repos

For agents

$ claude mcp add agentfield \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact