Skip to content
AgentField

Quickstart

Go from zero to a running AI agent in 60 seconds

Zero to running agent in 60 seconds

Install. Scaffold. Write. Run. Done.

Install

curl -sSf https://agentfield.ai/get | sh

This installs the af binary. Verify with af --version.

Alternative: install the SDK directly

pip install agentfield
npm install @agentfield/sdk
go install github.com/Agent-Field/agentfield/control-plane/cmd/af@latest

Scaffold

af init my-agent && cd my-agent

Set your LLM key in the generated .env file:

ANTHROPIC_API_KEY=sk-...

Write your agent

# app.py
from agentfield import Agent, AIConfig
from pydantic import BaseModel

app = Agent(
    node_id="my-agent",
    agentfield_server="http://localhost:8080",
    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:
    return (await app.ai(system="Summarize concisely.", user=text, schema=Summary)).model_dump()

app.run()
// app.ts
import { Agent } from "@agentfield/sdk";
import { z } from "zod";

const agent = new Agent({
  nodeId: "my-agent",
  aiConfig: { provider: "anthropic", model: "claude-sonnet-4-20250514" },
});

agent.reasoner("summarize", async (ctx) => {
  return await ctx.ai(ctx.input.text, {
    system: "Summarize concisely.",
    schema: z.object({ title: z.string(), keyPoints: z.array(z.string()) }),
  });
});

agent.serve();
// main.go
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/Agent-Field/agentfield/sdk/go/agent"
	"github.com/Agent-Field/agentfield/sdk/go/ai"
)

func main() {
	a, err := agent.New(agent.Config{
		NodeID:        "my-agent",
		Version:       "1.0.0",
		AgentFieldURL: "http://localhost:8080",
		AIConfig:      &ai.Config{Model: "anthropic/claude-sonnet-4-20250514"},
	})
	if err != nil {
		log.Fatal(err)
	}

	a.RegisterReasoner("summarize", func(ctx context.Context, input map[string]any) (any, error) {
		text := fmt.Sprintf("%v", input["text"])
		resp, err := a.AI(ctx, text, ai.WithSystem("Summarize concisely."))
		if err != nil {
			return nil, err
		}
		return map[string]any{"summary": resp.Text()}, nil
	})

	a.Serve(context.Background())
}

Run

Start the control plane in one terminal:

af server

Then run your agent app in a second terminal:

python app.py
npx tsx app.ts
go run .

Dashboard at localhost:8080.

Test

Synchronous execution waits for the result inline:

curl http://localhost:8080/api/v1/execute/my-agent.summarize \
  -H "Content-Type: application/json" \
  -d '{"input": {"text": "AgentField is an open-source control plane for AI agents with cryptographic identity, runtime policy, and tamper-proof audit trails."}}'

Structured JSON back -- not raw LLM text:

{
  "execution_id": "exec_a1b2c3",
  "run_id": "run_x7y8z9",
  "status": "succeeded",
  "result": {
    "title": "AgentField Overview",
    "key_points": [
      "Open-source AI agent control plane",
      "Cryptographic identity for every agent",
      "Runtime policy enforcement",
      "Tamper-proof audit trails"
    ]
  },
  "duration_ms": 1420,
  "finished_at": "2026-03-23T10:00:00Z"
}

What just happened

You started the control plane, ran an agent app in your SDK of choice, and invoked it through the execution API. That is the minimum mental model of AgentField: one server process, one agent process, then a target you can call synchronously or defer for later completion.

{
  "control_plane": "af server",
  "agent_app": "python app.py | npx tsx app.ts | go run .",
  "sync_target": "/api/v1/execute/my-agent.summarize",
  "deferred_target": "/api/v1/execute/async/my-agent.summarize"
}

Deferred execution returns immediately with a tracking ID:

curl http://localhost:8080/api/v1/execute/async/my-agent.summarize \
  -H "Content-Type: application/json" \
  -d '{"input": {"text": "AgentField is an open-source control plane for AI agents with cryptographic identity, runtime policy, and tamper-proof audit trails."}}'

Example deferred response:

{
  "execution_id": "exec_a1b2c3",
  "status": "queued"
}

Next steps