Task-based index for Geppetto docs and example programs.
Geppetto is a Go toolkit for building AI-powered applications. It provides:
require("geppetto")) for scripting and host embeddingIf you're new to Geppetto, read these docs in order:
After that, explore based on what you need:
| Doc | What It Covers |
|---|---|
| Turns and Blocks | The Turn data model: Run → Turn → Block. How conversations are represented. |
| Opinionated Runner API | The recommended pkg/inference/runner surface for new Go apps that already have resolved runtime input. |
| Inference Engines | The Engine interface, factory pattern, and provider implementations. |
| Tools | Defining tools, registering them, and executing tool calls. |
| Events and Streaming | Real-time event delivery, Watermill routing, and printers. |
| Middlewares | Adding cross-cutting behavior (logging, tool execution) around inference. |
| JS API Reference | Exhaustive contract for require(\"geppetto\") namespaces and options. |
| JS API User Guide | Practical composition patterns for sessions, middlewares, tools, and hooks. |
| Doc | What It Covers |
|---|---|
| Profiles | Registry-first profile model, read-only resolution flow, and migration from legacy profile maps. |
| Embeddings | Vector embeddings for semantic search, including caching. |
| Linting (turnsdatalint) | Custom linter for Turn data key hygiene. |
| Tutorial | What You'll Build |
|---|---|
| Streaming Inference with Tools | A Cobra command that streams output and supports tool calling. |
| Event Routing and Structured Logging | Multiple event handlers with JSON logging and metrics. |
| Embeddings Workflows | Semantic search with caching and batch processing. |
| Structured Data Extraction | Extract structured data from streaming output in real-time. |
| JS API Getting Started | End-to-end walkthrough of turns, sessions, tools, and hooks from JavaScript. |
| Build Scoped JavaScript Eval Tools | Detailed intern-friendly guide to pkg/inference/tools/scopedjs, runtime wiring, registration, and debugging. |
| Build a Streaming Tool-Loop Agent with Glazed Flags | Build a small Glazed CLI that streams events, runs a tool loop, and keeps engine settings hidden in app bootstrap. |
Operational step-by-step guides for common tasks:
| Playbook | What You'll Do |
|---|---|
| Add a New Tool | Register a tool, attach to context, configure on Turn, run tool loop. |
| Add a New Event Handler | Implement handler, subscribe to router, parse events. |
| Progressive Structured Data | Extract structured payloads from streaming output with filtering sinks. |
| Migrate to Session API | Migrate from legacy lifecycle APIs to session.Session + ExecutionHandle. |
| Migrate legacy profiles.yaml to registry | Convert legacy profile maps to canonical registry YAML and switch to registry-first profile workflows. |
| Operate SQLite-backed profile registry | Run profile registry with SQLite storage, plus backup/recovery and permissions guidance. |
| Bootstrap binary StepSettings from defaults, config, registries, and profile | Build final runtime settings by separating hidden base parsing from profile resolution. |
These working examples are the source of truth for patterns. Run them to see Geppetto in action:
| Example | Description |
|---|---|
inference/ | Basic blocking inference without tools. |
streaming-inference/ | Basic streaming inference without tools. |
runner-simple/ | Smallest pkg/inference/runner blocking example. |
runner-tools/ | pkg/inference/runner example with a function tool and tool-name filtering. |
runner-streaming/ | pkg/inference/runner async/event-sink example. |
runner-registry/ | pkg/inference/runner example that resolves runtime prompt metadata from a profile registry. |
runner-glazed-full-flags/ | pkg/inference/runner example driven by full Geppetto sections and Glazed parsing. |
runner-glazed-registry-flags/ | pkg/inference/runner example where only Glazed profile-registry flags are public and base StepSettings stay app-owned. |
advanced/generic-tool-calling/ | Provider-agnostic low-level tool calling example. |
advanced/openai-tools/ | Low-level OpenAI native function-calling example. |
advanced/claude-tools/ | Low-level Claude native tool_use example. |
advanced/middleware-inference/ | Low-level middleware and tool execution example. |
citations-event-stream/ | Structured data extraction from streaming output. |
Find examples in: geppetto/cmd/examples/
go 1.25.7)OPENAI_API_KEYANTHROPIC_API_KEYGOOGLE_API_KEYhttp://localhost:11434┌─────────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────┐ ┌──────────┐ ┌─────────────────────────┐ │
│ │ Turn │───▶│ Engine │───▶│ Provider (OpenAI/...) │ │
│ │ (Blocks)│◀───│ │◀───│ │ │
│ └─────────┘ └────┬─────┘ └─────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Event Sink │──▶ Router ──▶ Handlers │
│ └──────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Middleware: Logging │ Tools │ Validation │ Custom │
└─────────────────────────────────────────────────────────────┘
go doc github.com/go-go-golems/geppetto/pkg/...geppetto/cmd/examples/--print-parsed-fields to see resolved configurationAll public docs use the Turn-based architecture. Legacy conversation APIs are intentionally omitted.