A production-grade Go substrate for multi-turn LLM agents, built on the Google Agent Development Kit. Ships the wiring — providers, MCP, skills, permissions, durable sessions, remote attach, an in-process Bubble Tea TUI, and a headless CLI — so downstream projects can focus on their own tools and product logic.
📚 Full documentation: go-steer.github.io/core-agent
Runtime
- Multi-turn conversation via ADK's
runner.Runner; parallel tool-call dispatch. - In-process Bubble Tea TUI as the default TTY surface;
--no-tuiline REPL fallback; slim build (-tags no_tui) drops the TUI tree entirely. autonomous.Runfor unattended workers with turn / token / cost / wallclock budgets and model-driven termination;autonomous.Resumepicks up from a durable checkpoint after a crash.- Long-session survivability: automatic post-turn compaction at ~85% context utilization, subtasks with
agentic_*tool wrappers that keep bulk tool output out of the parent's context, and task-boundary checkpoints viamark_task_done. See Context management.
Providers
- Gemini API (
GEMINI_API_KEY/GOOGLE_API_KEY) and Vertex AI (ADC +GOOGLE_CLOUD_PROJECT) with server-sideGoogleSearchandURLContextwired up. - Anthropic Claude via
api.anthropic.com(ANTHROPIC_API_KEY) and via Vertex AI (ADC +ANTHROPIC_VERTEX_PROJECT_ID) as a nativemodel.LLMadapter. - Built-in provider profiles via
go-steer/core-models(openai,xai,vertex-maas,sap-ai-core,vllm,sglang,ollama,openai-compatible) plus custom profiles underprovidersin.agents/config.json. - Mock providers for credential-free testing:
--provider=echoand--provider=scripted --script=path.jsonl;--record-to=path.jsonlcaptures any real session for later replay. model.builtin_toolsgates each provider's server-side built-ins (web_search,url_context,code_execution) under one provider-neutral, tri-state set of names — the defaults differ per provider, so this is what makes an internet-reachability posture survive a provider switch. Distinct from--no-builtin-toolsbelow, which is core-agent's own catalog. The startup summary names the effective set.
Instructions, tools, MCP, skills
AGENTS.mdprimary +AGENTS.d/*.mdoverlay directory +@include <path>directive for composable, multi-file system instructions; three scopes (user~/.core-agent/, user-home~/.agents/, project) concatenated in order, withCLAUDE.md/GEMINI.mdfallbacks.- Built-in tool catalog covering files (
read_file,read_many_files,view_file_outline— a file's declaration skeleton without the bodies, parsed for Go,write_file,edit_file,delete_file,stat,list_dir), search (glob,grep), data + network (json_query,fetch_url), shell (bash), planning (todo, opt-inrecord_plan), verification (wait_and_verify— bounded, read-only poll-until-condition, no shell required), and interactive prompting (opt-inask_user). Disable the whole suite with--no-builtin-toolsor specific entries with--disable-tools=bash,write_file. - MCP servers declared in
.agents/mcp.json(project) and/or~/.agents/mcp.json(portable user scope); stdio and Streamable HTTP transports (including remote MCP with Google OAuth); tools are namespaced (<server>_<tool>) and route through the permission gate. - Claude-compatible skills auto-discovered from
.agents/skills/<name>/SKILL.md(project),~/.agents/skills/(portable user), and~/.core-agent/skills/(legacy user-global fallback). A skill may declarerequires: [shell, kubectl, gcloud]in its frontmatter; one whose requirements this runtime can't meet is withheld from the toolset at startup and named on stderr, instead of instructing the model to do something a distroless image cannot do.
Permissions
ask/auto/acceptEdits/plan/allow/yolomodes (--permission-mode <mode>, whereautoplaces an approver model in front of the person) with pattern-based allow/deny lists, path-scope enforcement on file tools, URL-scope allowlist forfetch_url, and a non-overridablebashdenylist that catchesrm -rf /-class mistakes.- Plan-first enforcement (
permissions.plan_mode+record_plantool +/replanslash): underrequired, denies mutating tool calls until the model has recorded a plan for the current turn — turns "research → approve → execute" from a prompt convention into a substrate primitive. Underadvisory(v2.9+) the plan artifact is still recorded but nothing is blocked, for unattended runs with no operator to approve. - Pluggable
Prompterinterface so the same gate works in a TTY, headless (--ask=auto), the in-process TUI, or a custom web frontend.
Persistence + observability
- Durable sessions and audit log via
eventlog.Open(...)— SQLite (pure-Go, CGO-free), Postgres, or MySQL — with monotonicseq,Since(seq)replay,Watch(seq)live-tail, and a session lock for crash-safe multi-process resume. - Opt-in OpenTelemetry export (console / OTLP); off by default so a fresh invocation makes zero outbound telemetry calls (for total network silence beyond the model, pass
--no-pricing-refreshor setpricing.refresh: falseto skip the daily LiteLLM pricing refresh). - Per-model token + cost tracking with layered pricing (daily LiteLLM refresh, per-config overrides, longest-prefix fallback).
Remote attach + operator surface
- Attach API: HTTP + Server-Sent Events live-tail +
POST /sessions/<sid>/inject+/wakefor headless agents, over mTLS + bearer auth. Read-onlyGET /sessions/<sid>/{tools,agents,status}andGET /permissions/snapshotendpoints for operator dashboards. - Operator hold (v2.9+):
/interruptcancels the in-flight turn and parks the loop — auto-continue stands down, a queued inbox message stays queued, and nothing starts a new turn until the operator says how to proceed (steerwith a new instruction,continueunchanged, orabandon).POST /pauseholds without cancelling anything;POST /agents/<name>/stopreaches a runaway background subagent, which interrupting the parent alone never did. State is onGET /statusand pushed as apauseSSE frame, so a second dashboard watching the same session sees the hold too. - Remote TUI client (
core-agent-tui, separately-versioned binary): thin bubble-tea shell ongo-steer/core-tuithat attaches to any daemon over the attach API — full slash parity with the in-process TUI (/stats,/context,/compact,/done,/subagent,/btw,/memory,/skills,/mcp,/pricing,/perms,/allow,/deny,/reload), Esc to stop-and-hold (/pauseholds without cancelling) then type to steer or/continue//abandonto release, per-turn cost footer, live tool-approval modals over HTTP, mid-turn/inject, session switcher. - Multi-session daemon: one
core-agentdaemon serves many concurrent sessions with per-caller identity, ACL (Owner/Viewers/Contributors), permission grants, instruction overlays, and audit attribution. Sessions survive daemon restarts (config change, image upgrade, K8s pod replacement) — a reconnecting TUI resumes transparently. Opt-in viamulti_session.enabled: true. - Attach-config (
.agents/config.jsonattach.*block +${ENV_VAR}expansion) so a K8s ConfigMap can replace half a dozen CLI flags. - Peer registration for hub-and-spoke fleet discovery on top of attach.
- Agent-card discovery: opt-in
/.well-known/agent-card.jsonendpoint describing name, description, skills, and required auth in the A2A AgentCard shape so agent registries can index the binary.
Subagents
- In-process:
agent.WithSubagents([]*Agent)for synchronous delegation;background.NewManager+spawn_agent/stop_agentfor background subagents the model spawns at runtime (results are pushed back via[Background reports];spawn_agent { wait: true }blocks inline). - Remote:
background.NewSpawnRemoteAgentToolwith a consumer-suppliedRemoteAgentSpawnerfor out-of-process spawning (gRPC / K8s Jobs / Cloud Run). - Subagent events stream into the parent's audit log under a
Branchlabel so the trail stays unified.
Kubernetes triage sidecar (v2.6+)
lookout-watch— watches Kubernetes Events, filters + dedupes, and injects matched incidents into per-incident sessions on a core-agent daemon. Pairs with the bundled triage skill to drive diagnose → fix → verify loops via the GKE MCP, gated by plan-first. The watcher ships from go-steer/k8s-lookout asghcr.io/go-steer/lookout(the recipe inexamples/gke-troubleshoot-agent/pinsv0.43.2); its entrypoint islookout watch. lookout v0.17.0 retired thek8s-event-watchertransition naming it inherited from the retiredghcr.io/go-steer/k8s-event-watcherimage, so the Kubernetes resources, token Secret, andlookout_*metric prefix all read as lookout.
Optional adapters
extras/scion-agent/— runscore-agentinside Scion's container runtime with lifecycle status emission and asciontool_statustool.extras/ax-agent/(on theaxplorebranch) — AX gRPC remote-agent packaging.
CLI (Go toolchain, requires Go 1.26+):
go install github.com/go-steer/core-agent/v3/cmd/core-agent@latestPre-built binary (Sigstore-signed; linux/darwin × amd64/arm64):
TAG=$(gh release view --repo go-steer/core-agent --json tagName -q .tagName)
OS=$(uname -s | tr A-Z a-z)
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
gh release download "$TAG" --repo go-steer/core-agent \
--pattern "core-agent_${TAG#v}_${OS}_${ARCH}.tar.gz"
tar xzf "core-agent_${TAG#v}_${OS}_${ARCH}.tar.gz"
./core-agent --versioncore-agent-tui archives use the same naming pattern. Verification details are in each release's notes footer.
Container images (multi-arch amd64 + arm64; distroless static; Sigstore-signed):
docker pull ghcr.io/go-steer/core-agent:latest # daemon + in-process TUI
docker pull ghcr.io/go-steer/core-agent-slim:latest # headless daemon, ~5MB smaller
docker pull ghcr.io/go-steer/core-agent-tui:latest # remote TUI client only(The k8s-event-watcher sidecar image now ships from go-steer/k8s-lookout; tags published from this repo through v2.7 remain pullable.)
Floating tags: :latest, :X.Y.Z, :X.Y, :X (semver, no v prefix), :main, :main-<sha>.
Library:
go get github.com/go-steer/core-agent/v3Module path note: the module path carries the major-version suffix required by Go's SIVE rule. From 3.0 it is
github.com/go-steer/core-agent/v3; upgrading from 2.x means rewriting importsgithub.com/go-steer/core-agent/v2/...→github.com/go-steer/core-agent/v3/...(and moving togoogle.golang.org/adk/v2, see the 3.0 release notes). v2.x tags keep the/v2path, so pinned 2.x consumers are unaffected. Container images and source builds never depend on the suffix; onlygo installandgo getdo. Tags v2.0.0 through v2.7.0-dev.4 predate the/v2suffix and can't bego installed — use@main, a pinned commit SHA, container images, or a source build for those.
| Image | What it is | When to pull it |
|---|---|---|
core-agent |
Full daemon: multi-session runtime + in-process Bubble Tea TUI + remote-attach API. | Default target. |
core-agent-slim |
Same daemon, built -tags no_tui. ~5MB smaller. |
Distroless K8s pods where the TUI is dead weight. |
core-agent-tui |
Remote TUI client only. Connects to a daemon over the attach API. | Operator workstations attaching to a remote daemon. |
The k8s-event-watcher sidecar (watches Kubernetes Events, dedupes, injects matched ones into a daemon) moved to go-steer/k8s-lookout and ships from there.
# Gemini API key (either variable works)
GEMINI_API_KEY=... core-agent -p "what's 2+2?"
# Anthropic API key
ANTHROPIC_API_KEY=... core-agent --provider anthropic -p "what's 2+2?"
# Multi-turn TUI (bare invocation; conversation persists across turns)
core-agentVertex AI (both Gemini and Claude), scripted providers, .agents/config.json defaults, and the full CLI flag reference live in Getting started.
package main
import (
"context"
"fmt"
"log"
"github.com/go-steer/core-agent/v3/pkg/agent"
"github.com/go-steer/core-agent/v3/pkg/config"
"github.com/go-steer/core-agent/v3/pkg/models"
_ "github.com/go-steer/core-agent/v3/pkg/models/gemini"
)
func main() {
cfg := config.DefaultConfig()
cfg.Model.Provider = config.ProviderGemini
provider, err := models.Resolve(cfg)
if err != nil { log.Fatal(err) }
ctx := context.Background()
m, err := provider.Model(ctx, cfg.Model.Name)
if err != nil { log.Fatal(err) }
a, err := agent.New(m, agent.WithInstruction("Be concise."))
if err != nil { log.Fatal(err) }
for event, err := range a.Run(ctx, "What is the capital of France?") {
if err != nil { log.Fatal(err) }
if event.Content == nil { continue }
for _, p := range event.Content.Parts {
if p.Text != "" && event.Partial {
fmt.Print(p.Text)
}
}
}
fmt.Println()
}Fuller examples in examples/ — basic, with-tools, streaming, autonomous, autonomous-handle, autonomous-resume, with-subagent, background-monitor, scheduled-monitor, replay, plan-first, multi-session-bearer, cloud-run-deploy, gke-*, attach-daemon, compose-multi-session, parallel-spawn, embed/slim (the slim-embed reference, gated by verify-slim-deps).
- Site — https://go-steer.github.io/core-agent/
- Design rationale —
docs/DESIGN.md - Release process —
docs/release-process.md - Changelog + stability promise —
CHANGELOG.md
The site is built with Astro and Starlight; sources live in docs/site/.
core-agent/
├── pkg/ # public library surface (v3 stability; see docs/compatibility-policy.md)
│ ├── agent/ # ADK llmagent + runner wrapper; Option pattern
│ ├── attach/ # HTTP + SSE + auth + multi-session daemon
│ ├── config/ # .agents/config.json schema + discovery
│ ├── digest/ # structural digest system for tool responses
│ ├── eventlog/ # durable session.Service + audit/replay stream
│ ├── instruction/ # AGENTS.md / CLAUDE.md / GEMINI.md loader
│ ├── mcp/ # mcp.json schema, stdio/HTTP server lifecycle
│ ├── models/ # provider registry + gemini/ + anthropic/ + mock/
│ ├── permissions/ # ask/auto/acceptEdits/plan/allow/yolo gate + denylist + path scope
│ ├── recording/ # LLM-wire recorder for offline replay
│ ├── runner/ # headless (one-shot) + REPL/TUI drivers
│ ├── session/ # JSON transcript persistence
│ ├── skills/ # SKILL.md discovery → ADK skilltoolset
│ ├── telemetry/ # OTEL exporter setup
│ ├── tools/ # built-in tools + GateToolset wrapper
│ └── usage/ # per-turn token + cost tracker
├── cmd/
│ ├── core-agent/ # daemon + CLI + in-process TUI
│ └── core-agent-tui/ # remote TUI client
├── extras/scion-agent/ # opt-in Scion runtime adapter
├── examples/ # 15+ worked examples
├── docs/ # DESIGN.md, release-process.md, Astro site
├── SKILLS/ # bundled meta-skills (cli-setup, autonomous-setup, library-embedding)
└── dev/ # build/test/lint/release tooling
The Provider interface is the extension point — register your own model backend with models.Register("name", constructor) and the rest of the stack picks it up.
.agents/directory — walked up from the working directory like.git. Holdsconfig.json,mcp.json,skills/<name>/SKILL.md, and per-session JSON transcripts.AGENTS.md— project-level system-instruction prefix.CLAUDE.mdandGEMINI.mdare picked up as fallbacks for repos that already have one.~/.<binary>/sessions.db— durable session storage when--session-dbis set. The binary name is derived fromos.Executable()socore-agent, adapters, and forks each get their own directory. Override with--session-db-path. Without the flag, sessions are in-memory only and every restart loses all conversation state — for daemon/K8s deployments, always set it (and put the file on storage that survives the pod).
- Run
dev/tools/cibefore opening a PR — same checks GitHub Actions runs (vet, build, lint, mod-tidy, test, vuln scan), in fast-fail order. Seedev/README.md. - Every source file carries the Apache 2.0 header.
goheaderindev/tools/lint-goenforces this for.go; rundev/tools/add-license-headersfor new shell / YAML / Python files. - The library is meant to stay narrow. Downstream-specific tools, flags, and slash commands belong in consumer projects.
Apache-2.0. See LICENSE.