agentcore

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0

README

agentcore

Opinionated agent components for Go. A library of reusable parts every real agent ends up needing — layered on top of agentkit (single-agent primitives) and swarmkit (multi-agent NATS coordination).

Status: early development. APIs are not yet stable. Not ready for production use.

What it is

agentcore is the opinionated middle tier:

  • agentkit gives you the pieces — LLM clients, tools, memory, MCP, shell/content guards, policy, credentials, shutdown coordination.
  • swarmkit gives you the radio — messaging, task dispatch, heartbeats, agent registry.
  • agentcore tells you how the pieces typically fit together — a composition-tree workflow runtime, supervision pipeline, content-guard wiring, telemetry, and packaging.

Pragmatic, not dogmatic. Agents are free to mix agentcore, agentkit, and swarmkit directly; agentcore never forces indirection.

Packages

Package Status
workflow landed
workflow/security landed
observe landed
supervise landed
packaging landed
identity, config planned

Quickstart

The workflow package is the entry point today. A minimal workflow:

import (
    "github.com/vinayprograms/agentcore/workflow"
    "github.com/vinayprograms/agentcore/workflow/security"
    "github.com/vinayprograms/agentkit/llm"
)

model, _ := llm.New(llm.Config{Service: "anthropic", APIKey: apiKey})

wf := workflow.New("daily-summary").
    Input(workflow.Parameter{Name: "topic"}).
    Add(workflow.Sequence("main").Steps(
        workflow.Goal("draft", "Write a brief on $topic").WithOutputs("brief"),
        workflow.Goal("review", "Check $brief for accuracy"),
    )).
    Security(security.Default)

state, err := wf.Execute(ctx, &workflow.Runtime{Model: model},
    map[string]string{"topic": "memory consistency models"})

To wire telemetry, add a sink from the observe package:

rt := &workflow.Runtime{
    Model:     model,
    Telemetry: observe.Logger(slog.Default()), // logs every event to slog
}

OTel tracing is emitted automatically by the workflow package whenever a TracerProvider is wired. No sink configuration needed for spans — just set up your OTel provider as you would for any other Go program.

To supervise a goal, mark it with .Supervise() (or .SuperviseByHuman()), wire a Runtime.Supervisor (e.g., supervise.New(supervise.Config{})), and optionally set Runtime.MaxReorientAttempts. See workflow/README.md for the full surface.

Install

go get github.com/vinayprograms/agentcore

Design principles

  1. Interface-driven at every seam. Consumers program to interfaces; concrete types are returned from constructors and otherwise unexported.
  2. Independence by construction. Composition deep-copies. State from one execution cannot bleed into another.
  3. Testable by design. Dependencies (LLM, tools, MCP, supervisor, human channel) are injected via Runtime. Target: 100% statement coverage on testable code.
  4. Small, focused packages. Each package has one purpose.
  5. No re-implementations. If agentkit or swarmkit owns a concept, agentcore depends on it.

Contributing

See CONTRIBUTING.md.

License

Apache 2.0 — see LICENSE.

Directories

Path Synopsis
Package agentfile parses Agentfile DSL source and compiles it to an executable workflow.Workflow plus a pre-populated workflow.Runtime base.
Package agentfile parses Agentfile DSL source and compiles it to an executable workflow.Workflow plus a pre-populated workflow.Runtime base.
Package config loads agent.toml into a typed Config.
Package config loads agent.toml into a typed Config.
Package observe provides default EventSink implementations for agentcore packages — structured logging via slog, OTel metric counters, and a typed-callback registry.
Package observe provides default EventSink implementations for agentcore packages — structured logging via slog, OTel metric counters, and a typed-callback registry.
Package packaging creates, verifies, and installs signed agent packages.
Package packaging creates, verifies, and installs signed agent packages.
keys
Package keys is a lightweight helper for Ed25519 key management — generate, save, and load.
Package keys is a lightweight helper for Ed25519 key management — generate, save, and load.
Package supervise provides a default workflow.Supervisor implementation for the five-phase supervision pipeline (COMMIT → EXECUTE → POST → RECONCILE → SUPERVISE).
Package supervise provides a default workflow.Supervisor implementation for the five-phase supervision pipeline (COMMIT → EXECUTE → POST → RECONCILE → SUPERVISE).
Package workflow implements agentcore's execution model: a composition tree of typed nodes where each primitive owns its own execution loop.
Package workflow implements agentcore's execution model: a composition tree of typed nodes where each primitive owns its own execution loop.
security
Package security defines the workflow's content-guard tier modes and the logic that turns a mode into a fully-configured *contentguard.Guard.
Package security defines the workflow's content-guard tier modes and the logic that turns a mode into a fully-configured *contentguard.Guard.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL