FlowCraft
Go SDK for building AI agents with long-term memory, knowledge retrieval, runtime orchestration, and voice. Source on github.com/GizClaw/flowcraft.
Guides
Runtime
- Graph Runtime —
core/graph: declarative DAG engine, node I/O roles, parallel branches, custom node types. - Tool System —
core/tool: LLM function-calling contract, Registry / Catalog / Executor split, middleware chain, built-in tool adapters and the MCP bridge. - Event Bus —
core/event: subject-routed publish/subscribe, in-processMemoryBus, host capability wiring, backpressure policies. - Application Runtime —
core/runtime+core/runtime/session: process-level services and leased, interruptible streaming sessions above a built deployment. - Prompt Lifecycle Events — the
agent.run.<id>.prompt.*lifecycle events UI consumers subscribe to.
State and execution boundary
- Workspace —
core/workspace: per-run filesystem abstraction, backends, capabilities, thestate vs policysplit vs Sandbox. - Sandbox —
core/sandbox: agent execution boundary, env / net / resources policy, runners (local / seatbelt / bwrap), decorators and approval. - Memory Stack — the three-layer memory stack:
core/memorycontracts, deploy/runtime glue, and app-registered implementations.
Assembly
- Inference Runtime — unified Generate / Embed / Transcription (Realtime reserved): deployment config, routing, extensions, streaming, media intents, hot reload.
- Deployment Assembly —
core/deploy: one YAML document + oneBuildcall to wire shared resources, named agents, engines, and lifecycle hooks. - Resource Protocol —
core/resource: the provider-neutral factory, dependency DAG, loader, and lifecycle phases that every deployment resource uses.
Delegation
- Delegation —
core/delegation: backend-neutral target discovery, sync / async execution, and the session-bound delegation lifecycle.
Migrations
core/v0.1.0— the breaking cut fromsdk/sdkxto thecoreplatform module, providerdriver/*modules, and platform-specificbackends/*.- One driver per wire family —
the consolidation that folded the Azure, DeepSeek and Kimi drivers into
driver/openai, moved MiniMax's Messages surface todriver/anthropic, and removeddriver/qwen.
Older sdk/sdkx migration notes remain in docs/migrations/ as
historical reference and are not part of the current core migration path.
Layered architecture
The repository is organised as independently released Go modules:
| Layer | Package | Responsibility |
|---|---|---|
| Execution contracts | core/agent |
Engine / Board / Run / Host / Interrupt / Checkpoint contracts |
| DAG executor | core/graph |
Declarative graph runtime (*Graph implements agent.Engine) |
| Agent runtime | core/agent |
Agents, observers, referees, board seeders, and execution lifecycle |
| Delegation contracts | core/delegation |
Backend-neutral target discovery, sync / handoff / async requests, service and host contracts |
| Async delegation | core/delegation/kanban |
In-memory AsyncBackend / WorkSource implementation and operational views |
| Adapters | driver/*, backends/* |
Concrete provider / protocol bindings layered on core contracts |
Repository layout
core/ Platform module (contracts, deploy, runtime, built-in resources)
driver/ Provider inference adapters
backends/ SQLite checkpoints and plugin shell (sandbox backends live in core/)
examples/ Reference assemblies
Getting started
go get github.com/GizClaw/flowcraft/core@latest
See the package-level doc.go files for runnable usage snippets:
core/agent/doc.go, core/graph/doc.go, and
the focused packages under core/.