zkit — Go packages for agents Skip to content zkit
zkit<br>Go packages for building agents: a streaming loop, tool dispatch, guardrails, compaction, and provider adapters.<br>Get startedArchitectureGitHub
Installgo get github.com/zarldev/zarlmono/zkitImport what you need. Compose the rest.
What is zkit?<br>Section titled “What is zkit?”
zkit is a set of small Go packages for building agents. Take the pieces you need<br>and ignore the rest. Each package has a narrow interface and no framework<br>ceremony.
The runner is the streaming, tool-calling agent loop. Around it are tools,<br>guardrails, compaction, providers, verified completion, and the foundation<br>packages underneath.
package main
import (
"context"
"time"
"github.com/zarldev/zarlmono/zkit/agent/runner"
"github.com/zarldev/zarlmono/zkit/ai/llm/anthropic"
func main() {
provider, _ := anthropic.NewProvider(apiKey)
r := runner.New(runner.ClientFromProvider(provider),
runner.WithPromptText("You are a helpful coding assistant."),
runner.WithMaxIterations(20),
runner.WithToolTimeout(60*time.Second),
_, _ = r.Run(context.Background(), runner.TaskSpec{
Prompt: "Refactor the auth package to use context everywhere.",
})
Core packages
zkit/agentRunner<br>Streaming loop with tool calls, steering, compaction hooks, and per-call timeouts.<br>zkit/aiTools<br>Registry, two-method Tool interface, reflection schemas, JSON repair, MCP.<br>zkit/agentGuardrails<br>Middleware around tool dispatch: schema repair, shell policy, repetition detection, verifier feedback.<br>zkit/agentCompaction<br>History-shrinking strategies behind one interface, with budget-driven triggers.<br>zkit/aiProviders<br>OpenAI, Anthropic, Gemini, DeepSeek, llama.cpp, Ollama, and OAuth backends behind one contract.<br>zkit/agentVerified completion<br>Re-drive attempts against real-world state — tests passing, files present — not the transcript.
Built with zkit
These products share the same repo and the same packages.
TUI agentzarlcode<br>A terminal coding agent: runner, guardrails, sandboxed shell, sub-agents, SQLite sessions.<br>Local assistantzarlai<br>A local multimodal assistant: speech, vision, home automation, autonomous tasks.<br>Evaluationswebench-eval<br>A SWE-bench driver built from the same packages as the TUI.
Where to go next<br>Section titled “Where to go next”
Getting started — install zkit and run your first agent.
Architecture — see how the packages layer.
Runner — understand the loop.