Gojent Documentation
Gojent is a standard-library-first, strongly typed Go agent runtime built around explicit contracts, one-way module dependencies, and fail-closed policies. Browse installation guides, core runtime semantics, and machine-readable specifications below.
Getting Started
Installation, zero-key mockllm quickstart, and first typed tools.
- Quickstart
Install Gojent and run a strongly typed, streaming-first Go agent in minutes using key-free mockllm or a real model provider.
/docs/quickstart → - Architecture
Understand Gojent's four extension seams, immutable agent model, fail-closed guarantees, atomic persistence, and one-way module boundaries.
/docs/architecture →
Core Runtime
Execution loop, canonical LLM contracts, typed tools, policies, and sessions.
- Typed Tools
Build schema-validated Go tools with tool.New, struct tag constraints, side-effect annotations, panic containment, and multimodal tool.Result outputs.
/docs/core/tools → - Streaming & Runs
Stream live text, reasoning, and tool events with Agent.Stream, consume Run.Events(), wait for completion, and cancel runs cleanly.
/docs/core/streaming → - Sessions & Stores
Scope multi-tenant conversations with session.Session and persist transcripts atomically through the two-method session.Store contract.
/docs/core/sessions → - Policies & Approvals
Enforce fail-closed runtime guardrails, human-in-the-loop approvals, ordered policy chains, and agent-to-run option layering.
/docs/core/policies → - Structured Output
Constrain model responses to a strict JSON Schema generated from a Go type with GenerateStructured[T], WithOutputSchema[T], and Response.Unmarshal.
/docs/core/structured-output → - Subagents & Composition
Expose any Agent as a typed or compact tool with AsTool, AsToolWith, and AsTypedTool, with depth limits, shared budgets, policy inheritance, and event forwarding.
/docs/core/subagents → - Observability
Observe every run lifecycle event with agent.Sink and agent.SinkFunc without altering execution, and wrap seams for metrics and tracing.
/docs/core/observability →
Modules
Model providers, durable stores, ready-made tools, and MCP client adapters.
- Ready-Made Tools
Equip agents with sandboxed filesystem tools, managed foreground/background command execution, managed subagent lifecycles, web fetch and search, and in-memory task tracking.
/docs/modules/tools → - Model Providers
Connect Google Gemini, OpenAI Responses and Chat Completions, Anthropic Messages, or mockllm behind the uniform llm.Model contract.
/docs/modules/providers → - Session Stores
Persist conversation transcripts durably with stores/sqlite and stores/postgres, or run ephemeral tests with session.Memory.
/docs/modules/stores → - MCP Client
Connect stdio and Streamable HTTP Model Context Protocol servers to Gojent agents with allow/deny filtering, AuthHook, elicitation, catalog refresh, and host resources/prompts.
/docs/modules/mcp → - Codjent Sample App
Explore Codjent, the reference ACP v2 stdio coding agent and Bubble Tea provider manager built on Gojent.
/docs/modules/codjent →
Guides
Testing, observability, middleware seams, and production patterns.
- Extending Gojent
Implement custom llm.Model and session.Store adapters, verify behavior with llmtest.Run and sessiontest.Run, and wrap seams for middleware.
/docs/guides/extending → - Development & Releases
Set up a local Gojent workspace, run per-module and cross-repo checks, enforce architecture boundaries, and tag independent module releases.
/docs/guides/development →
Machine-Readable Endpoints
Every documentation page ships alongside a clean Markdown mirror and AEO index for coding assistants and retrieval pipelines:
-
/llms.txt— Curated index of Gojent docs with concise descriptions and.mdURLs. -
/llms-full.txt— Full concatenated Markdown corpus in navigation order.