Purpose
tRPC-Agent-Go is a Go language framework for building production-grade agent systems. It is aimed at developers who want to integrate agent applications into Go services, emphasizing concurrency, observability, ease of deployment, and support for integration with protocols such as A2A, AG-UI, and MCP.
Main Capabilities
- Go-native agent runtime: Supports streaming runners, context cancellation, and service-oriented APIs.
- GraphAgent: Type-safe graph workflows with support for multi-condition routing, functionally equivalent to a Go version of LangGraph.
- Multi-agent collaboration: Supports chained, parallel, and loop-based workflows.
- Rich tool ecosystem: Function tools, MCP tools, web search, code execution, and custom services.
- Persistent state: Sessions, memory, artifacts, and knowledge retrieval.
- Agent Skills: Reusable SKILL.md workflows with support for secure execution.
- Agent self-evolution: Hermes-style session review that can extract, gate, and publish reusable SKILL.md workflows.
- Prompt caching: Automatic cost optimization, with cached content saving 90% of costs.
- Evaluation and benchmarking: Evaluation sets and metrics for continuously measuring quality.
- Protocol integration: AG-UI for the frontend, A2A for agent interoperability, and MCP for tools.
- Production observability: OpenTelemetry tracing, metrics, and Langfuse examples.
Usage
Requirements
- Go 1.21 or later
- LLM provider API key (such as OpenAI, DeepSeek, etc.)
Quick Start
The official documentation states that you can build your first agent in 3 simple steps, in about 5 minutes. After running the example, you can see: interactive chat with an AI agent, real-time streaming responses, tool use (calculator + time tool), and multi-turn conversations with memory. You can try asking: "What's the current time? Then calculate 15 * 23 + 100".
Stopping/Canceling a Run
To interrupt a running agent, it is recommended to cancel the context passed to Runner.Run. This safely stops model calls and tool calls and lets the runner clean up. Note: do not just "jumpout" event loop, the agent goroutine may continue running and block on channel writes. Always cancel first, then continue draining the event channel until it closes. Ctrl+C can be converted into a context cancellation.
Example Directory
The example directory contains runnable demos covering each major feature:
- First multi-turn agent: examples/runner
- Controllable graph workflow: examples/graph
- Agent frontend or streaming UI: examples/agui
- A2A interoperability: examples/a2aagent
- RAG and knowledge retrieval: examples/knowledge
- Evaluation and prompt iteration: examples/evaluation
- Skills and local automation: examples/skillrun
- Wrapping an agent as a callable tool: examples/agenttool
- Multi-tool orchestration: examples/multitools
- Web search tool integration: examples/duckduckgo
- Providing files as input: examples/fileinput
Built-in Agents
Most applications do not need to implement the agent.Agent interface themselves. The framework already includes multiple ready-to-use agents that can be composed like Lego bricks. The composition API allows nesting chains, loops, or parallelism without low-level plumbing code.
Agent Skills
A skill is a folder containing a SKILL.md specification and optional docs/scripts. Built-in tools include: skill_load, skill_list_docs, skill_select_docs, skill_run, and (when the executor supports interactive sessions) skill_exec, skill_write_stdin, skill_poll_session, skill_kill_session. skill_run is the default one-shot command runner in an isolated workspace. skill_exec and the session tools cover interactive stdin/TTY flows without inlining the full script into the prompt. They are only registered when the code executor exposes InteractiveProgramRunner (or falls back to the local engine).
skill.NewFSRepository(...) can scan multiple root directories, for example sharedSkill directory plus user private directory. In long-running processes, call (*skill.FSRepository).Refresh() after installing or deleting skills. NewFSRepository also accepts HTTP(S) URLs (e.g. .zip or .tar.gz archives); the payload is downloaded and cached locally (the cache location can be overridden via SKILLS_CACHE_DIR).
It is recommended to use skill_run only for commands required by the selected skill documentation, rather than general shell exploration. When LLMAgent uses WithCodeExecutor(...) solely to support skill_run, the response code execution processor can be disabled via llmagent.WithEnableCodeExecutionResponseProcessor(false), to prevent Markdown fenced code blocks embedded in assistant text from being automatically executed when skill_run is enabled.
examples/skillfind demonstrates a real end-to-end discovery flow: the model uses the built-in skill-find skill to search the public web, installs a public GitHub skill into the user private directory, refreshes the repository, and uses the new skill in the same conversation. Local execution is disabled by default and can be explicitly enabled when installed skills need to be run.
Agent self-evolution
Completed sessions can be reviewed asynchronously, promoted through quality gates, and published back to future turns as managed Agent Skills. It supports revision storage, quality gates, human approval, and warm-start behavior when skills are available in subsequent runs. Runner integration requires only one option: runner.WithEvolutionService(...).
Evaluation and benchmarking
Evaluate agents using reproducible evaluation sets and pluggable metrics. Includes local file-backed runs and in-memory runs.
Applicable scenarios
The official list of suitable builds:
- Customer support bots: agents that understand context and resolve complex queries.
- Data analysis assistants: agents that query databases, generate reports, and provide insights.
- DevOps automation: intelligent deployment, monitoring, and incident response systems.
- Business process automation: multi-step workflows with human-in-the-loop capabilities.
- Research and knowledge management: RAG-driven agents for document analysis and question answering.
Limitations
The materials do not provide information on charging, pricing, platform support scope,performance metrics, or specific results. Some features (such as interactive session tools) depend on whether the code executor exposes InteractiveProgramRunner. Local execution is disabled by default. You need to provide your own LLM provider API key before use.