einoagent

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 0 Imported by: 0

README

eino-agent

Reusable Go runtime for Eino-based agents with AG-UI streaming and Datadog AI/LLM observability.

This repository provides embeddable Go packages for durable Eino agent orchestration. A consuming server supplies auth, routes, provider credentials, tool definitions, config loading, and deployment policy; eino-agent supplies runtime admission, durable session contracts, AG-UI replay/live-tail adapters, tool settlement, and observability/redaction policy.

Module Baseline

  • Module: github.com/mattsp1290/eino-agent
  • Go: 1.26.3
  • CloudWeGo Eino: github.com/cloudwego/eino v0.8.13
  • AG-UI bridge: github.com/mattsp1290/eino-agui v0.1.1
  • Observability: github.com/mattsp1290/eino-obs v0.0.0-20260627060807-a9a6f8bb478b
  • Coding tools: github.com/mattsp1290/eino-tools v0.0.0-20260627192031-e6ee664be93b

See docs/dependency-status.md for prerequisite evidence, docs/consumer-guide.md for the public embedding contract, docs/examples/minimal-server.md for a runnable server example, and docs/architecture/runtime.md for the package architecture.

Quick Embed

The smallest complete embedding is in examples/minimal-server:

go run ./examples/minimal-server -addr :8080

It wires:

  • store/sqlite as the durable session.Store and session.Transactor;
  • runtime.StreamingOrchestrator for run admission and interruption;
  • stream.Tail for live AG-UI deltas;
  • transport.SSEHandler for replay plus live tail;
  • a scripted Eino model resolver so the example runs without provider secrets.

Core route shape:

GET  /sessions/minimal/events
POST /sessions/minimal/runs
POST /runs/{run_id}/interrupt

Use it as a reference for composition, not as an auth or tenancy policy.

Local Gates

Run the full skeleton gate:

make check

Individual targets:

make fmt-check
make vet
make test
make race
make mod-tidy-check
make lint

make lint uses pinned golangci-lint v2.12.2 through go run. make fmt applies gofmt and pinned goimports.

Current Layout

  • doc.go: root package documentation.
  • session: durable session, run, message, part, tool-call, context-epoch, and replay contracts.
  • runtime: orchestration contracts for run admission, turn snapshots, interruption, tools, hooks, and internal events.
  • transport: embeddable HTTP adapters for AG-UI SSE replay/live-tail, interrupt, resume, and message decoding.
  • stream: bounded live-tail implementation for active runtime events.
  • model: provider/model catalog and Eino model resolution contracts.
  • config: immutable runtime config snapshot and validation contracts.
  • tools: typed tool registry and materialization helpers.
  • permissions: tool permission policy primitives.
  • agui: AG-UI durability and replay policy definitions; protocol mechanics stay in eino-agui.
  • obs: Datadog/eino-obs observability redaction and correlation policy definitions.
  • store/sqlite: embedded SQLite store implementation.
  • store/storetest: reusable durable store contract tests for backend implementations.
  • examples/: buildable embedding and integration sketches.
  • docs/: durable planning and architecture context.
  • .github/workflows/ci.yml: CI gate matching the local Makefile targets.

Durability Model

Replayable conversation state is stored as sessions, runs, messages, ordered parts, tool calls, context epochs, and selected event records. Live AG-UI SSE frames and model deltas are transport output, not the replay source of truth. Reconnects reconstruct snapshots from durable messages/parts and then attach to the active live tail.

See docs/architecture/agui-events.md and docs/architecture/storage.md for the detailed rules.

Integration Guides

  • docs/consumer-guide.md: public API, storage, tool lifecycle, observability, configuration, and migration guidance.
  • docs/integrations/datadog.md: Datadog/eino-obs exporter wiring and safe default redaction.
  • docs/integrations/ag-ui-go-server-example.md: AG-UI server migration sketch.
  • docs/integrations/ensemble.md: future ensemble adapter options and non-parity caveat.

Documentation

Overview

Package einoagent provides a reusable Go runtime for Eino-based agents.

Public runtime contracts live in subpackages such as session, runtime, model, and config. The root package is reserved for top-level assembly helpers.

Directories

Path Synopsis
Package agui defines AG-UI durability and replay policy for eino-agent.
Package agui defines AG-UI durability and replay policy for eino-agent.
Package catalog contains model catalog implementations that list provider metadata without creating provider transports.
Package catalog contains model catalog implementations that list provider metadata without creating provider transports.
Package config defines runtime configuration snapshots and hook boundaries.
Package config defines runtime configuration snapshots and hook boundaries.
Package agentcontext defines bounded context-source assembly and propagation metadata shared by runtime, tools, model adapters, and host integrations.
Package agentcontext defines bounded context-source assembly and propagation metadata shared by runtime, tools, model adapters, and host integrations.
examples
ag-ui-go-server-example
Package agui_go_server_example sketches how the Fiber-based ag-ui-go-server-example can embed eino-agent without copying runtime internals.
Package agui_go_server_example sketches how the Fiber-based ag-ui-go-server-example can embed eino-agent without copying runtime internals.
datadog
Package datadogexample shows environment-driven eino-obs wiring for eino-agent runtimes.
Package datadogexample shows environment-driven eino-obs wiring for eino-agent runtimes.
ensemble-adapter
Package ensembleadapter sketches a future adapter from ensemble dispatcher events to eino-agent runtime events.
Package ensembleadapter sketches a future adapter from ensemble dispatcher events to eino-agent runtime events.
minimal-server command
internal
deps
Package deps anchors the initial dependency baseline for the module skeleton.
Package deps anchors the initial dependency baseline for the module skeleton.
Package model defines provider and model catalog contracts for resolving Eino chat models without coupling runtime orchestration to one vendor SDK.
Package model defines provider and model catalog contracts for resolving Eino chat models without coupling runtime orchestration to one vendor SDK.
Package obs defines eino-agent observability and redaction policy.
Package obs defines eino-agent observability and redaction policy.
Package permissions defines runtime tool permission policy decisions and simple rule-based policy hooks.
Package permissions defines runtime tool permission policy decisions and simple rule-based policy hooks.
providers
fake
Package fake provides an in-memory provider adapter for tests and host development.
Package fake provides an in-memory provider adapter for tests and host development.
Package runtime defines orchestration contracts for admitting and executing Eino agent runs over durable sessions.
Package runtime defines orchestration contracts for admitting and executing Eino agent runs over durable sessions.
Package session defines durable session, run, message, part, tool-call, and context-epoch contracts for eino-agent runtimes.
Package session defines durable session, run, message, part, tool-call, and context-epoch contracts for eino-agent runtimes.
Package store documents durable store implementation expectations.
Package store documents durable store implementation expectations.
sqlite
Package sqlite provides a local durable session store backed by SQLite.
Package sqlite provides a local durable session store backed by SQLite.
storetest
Package storetest provides reusable contract tests for session.Store implementations.
Package storetest provides reusable contract tests for session.Store implementations.
Package tools provides typed tool registration and per-run materialization for runtime orchestration.
Package tools provides typed tool registration and per-run materialization for runtime orchestration.
wasmext
gen module

Jump to

Keyboard shortcuts

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