构建、运行和扩展 API 和微服务等 AI 代理
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.
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 | bashThe installer also drops the aforge coding harness beside af in
~/.agentfield/bin, so harness-backed agents work out of the box; skip it with
--no-aforge.
On macOS the installer also registers the control plane to start at login (under
launchd) and adds a menu-bar icon. 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; install with --no-tray to skip this entirely.
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 →
Plain Python (or Go / TypeScript) functions. No DSL, no YAML, no graph wiring.
…Need approvals, audit trails, and governance? (the enterprise sample)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 →
…Prefer to scaffold by hand? (Python / Go / TypeScript / Docker)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 →
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:latestDeployment guide → for Docker Compose and production setups, or use the repository's Kubernetes deployment guide.
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 →
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.
Build - Python, Go, or TypeScript. Every function becomes a REST endpoint.
@app.reasoner() for AI judgment, @app.skill() for deterministic codeapp.ai(schema=MyModel) → typed Pydantic/Zod output from any LLMapp.harness("Fix the bug") dispatches multi-turn tasks to AForge, AgentField's own coding harness — no setup. Add provider="claude-code" (or codex, gemini, opencode, pi, omp) to orchestrate someone else's.app.call("other-agent.func") routes through the control plane with full tracingapp.discover(tags=["ml*"]) finds agents and capabilities across the mesh. tools="discover" lets LLMs auto-invoke them.app.memory.set() / .get() / .similarity_search() - KV + vector search, four scopes, no Redis neededScale - Production infrastructure for non-deterministic AI.
app.pause() suspends execution for human approval. Crash-safe, durable, audited./metrics, structured logs, execution timeline.Govern - IAM for AI agents. Every agent gets a cryptographic identity. Identity, access control, and audit trails - built in.
af vc verify audit.json.暂无开放 Issues,或尚未同步最近议题。