trpc-agent-go
A Go framework for building production agent systems with graph workflows, tools, memory, A2A, AG-UI, MCP, evaluation, and observability.
Install / Use
claude mcp add trpc-group -- npx -y github:trpc-group/trpc-agent-goIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Skill content
View source on GitHub<a id="trpc-agent-go"></a>
<h1>tRPC-Agent-Go</h1> <p> English | <a href="README.zh_CN.md">中文</a> </p> <p align="center"> <a href="https://trendshift.io/repositories/15288"><img src="https://trendshift.io/api/badge/repositories/15288" alt="GitHub Trending #3 Repository Of The Day archived by Trendshift" width="250" height="55"></a> <a href="https://trendshift.io/repositories/15288"><img src="https://trendshift.io/api/badge/trendshift/repositories/15288/daily?language=Go" alt="Trendshift #1 Go Repository Of The Day" width="250" height="55"></a> </p> <p align="center"> <a href="https://pkg.go.dev/trpc.group/trpc-go/trpc-agent-go"><img src="https://pkg.go.dev/badge/trpc.group/trpc-go/trpc-agent-go.svg" alt="Go Reference"></a> <a href="https://github.com/trpc-group/trpc-agent-go/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green.svg" alt="LICENSE"></a> <a href="https://github.com/trpc-group/trpc-agent-go/releases"><img src="https://img.shields.io/github/release/trpc-group/trpc-agent-go.svg?style=flat-square" alt="Releases"></a> <a href="https://github.com/trpc-group/trpc-agent-go/actions/workflows/prc.yml"><img src="https://github.com/trpc-group/trpc-agent-go/actions/workflows/prc.yml/badge.svg" alt="Tests"></a> <a href="https://app.codecov.io/gh/trpc-group/trpc-agent-go/tree/main"><img src="https://codecov.io/gh/trpc-group/trpc-agent-go/branch/main/graph/badge.svg" alt="Coverage"></a> <a href="https://trpc-group.github.io/trpc-agent-go/"><img src="https://img.shields.io/badge/Docs-Website-blue.svg" alt="Documentation"></a> </p> <hr /> </div>tRPC-Agent-Go is a Go framework for building production agent systems. It provides LLM agents, graph workflows, tool calling, session and memory state, knowledge retrieval, agent self-evolution, evaluation, and OpenTelemetry observability in one Go-native stack.
Use it when you want agent applications that fit Go services: concurrent, observable, easy to deploy, and ready to integrate with A2A, AG-UI, and MCP.
Why tRPC-Agent-Go?
- Go-Native Agent Runtime: Streaming runners, context cancellation, and service-friendly APIs
- GraphAgent: Type-safe graph workflows with multi-conditional routing, functionally equivalent to LangGraph for Go
- Multi-Agent Collaboration: Chain, parallel, and cycle-based workflows
- Rich Tool Ecosystem: Function tools, MCP tools, web search, code execution, and custom services
- Persistent State: Session, memory, artifacts, and knowledge retrieval
- Agent Skills: Reusable
SKILL.mdworkflows with safe execution - Agent Self-Evolution: Hermes-style session reviews that extract, gate,
and publish reusable
SKILL.mdworkflows - Prompt Caching: Automatic cost optimization with 90% savings on cached content
- Evaluation & Benchmarks: Eval sets + metrics to measure quality over time
- Protocol Integration: AG-UI for frontends, A2A for agent interoperability, and MCP for tools
- Production Observability: OpenTelemetry tracing, metrics, and Langfuse examples
Use Cases
Perfect for building:
- Customer Support Bots - Intelligent agents that understand context and solve complex queries
- Data Analysis Assistants - Agents that query databases, generate reports, and provide insights
- DevOps Automation - Smart deployment, monitoring, and incident response systems
- Business Process Automation - Multi-step workflows with human-in-the-loop capabilities
- Research & Knowledge Management - RAG-powered agents for document analysis and Q&A
Key Features
<table> <tr> <td width="50%" valign="top">Multi-Agent Orchestration
// Chain agents for complex workflows
pipeline := chainagent.New("pipeline",
chainagent.WithSubAgents([]agent.Agent{
analyzer, processor, reporter,
}))
// Or run them in parallel
parallel := parallelagent.New("concurrent",
parallelagent.WithSubAgents(tasks))
</td>
<td width="50%" valign="top">
Advanced Memory System
// Persistent memory with search
memory := memorysvc.NewInMemoryService()
agent := llmagent.New("assistant",
llmagent.WithTools(memory.Tools()),
llmagent.WithModel(model))
// Memory service managed at runner level
runner := runner.NewRunner("app", agent,
runner.WithMemoryService(memory))
// Agents remember context across sessions
</td>
</tr>
<tr>
<td valign="top">
Rich Tool Integration
// Any function becomes a tool
calculator := function.NewFunctionTool(
calculate,
function.WithName("calculator"),
function.WithDescription("Math operations"))
// MCP protocol support
mcpTool := mcptool.New(serverConn)
</td>
<td valign="top">
Production Observability
// Start Langfuse integration
clean, _ := langfuse.Start(ctx)
defer clean(ctx)
runner := runner.NewRunner("app", agent)
// Run with Langfuse attributes
events, _ := runner.Run(ctx, "user-1", "session-1",
model.NewUserMessage("Hello"),
agent.WithSpanAttributes(
attribute.String("langfuse.user.id", "user-1"),
attribute.String("langfuse.session.id", "session-1"),
))
</td>
</tr>
<tr>
<td valign="top">
Agent Skills
// Skills are folders with a SKILL.md spec.
repo, _ := skill.NewFSRepository("./skills")
// Let the agent load and run skills on demand.
tools := []tool.Tool{
skilltool.NewLoadTool(repo),
skilltool.NewRunTool(repo, localexec.New()),
}
NewFSRepository also accepts an HTTP(S) URL (for example, a .zip or
.tar.gz archive). The payload is downloaded and cached locally (set
SKILLS_CACHE_DIR to override the cache location).
NewFSRepository also accepts multiple roots, which is useful for
combining shared skills with user-private skills. In a long-lived
process, call repo.Refresh() after installing, deleting, or renaming a
skill so the next turn sees the updated skill set.
If you wire Skills through LLMAgent with llmagent.WithCodeExecutor(...),
consider also setting
llmagent.WithEnableCodeExecutionResponseProcessor(false) so Markdown fenced
code blocks embedded in assistant text do not auto-execute while skill_run is
enabled.
Agent Self-Evolution
repo, _ := skill.NewFSRepository("./managed_skills")
evo := evolution.NewService(reviewerModel,
evolution.WithManagedSkillsDir("./managed_skills"),
evolution.WithSkillRepository(repo))
defer evo.Close()
runner := runner.NewRunner("app", agent,
runner.WithEvolutionService(evo))
Completed sessions can be reviewed asynchronously, promoted through quality gates, and published back as managed Agent Skills for future turns.
</td> </tr> <tr> <td colspan="2" valign="top">Evaluation & Benchmarks
evaluator, _ := evaluation.New("app", runner, evaluation.WithNumRuns(3))
defer evaluator.Close()
result, _ := evaluator.Evaluate(ctx, "math-basic")
_ = result.OverallStatus
</td>
</tr>
</table>
Table of Contents
- tRPC-Agent-Go
Documentation
Ready to dive into tRPC-Agent-Go? Our documentation covers everything from basic concepts to advanced techniques, helping you build powerful AI applications with confidence. Whether you're new to AI agents or an experienced developer, you'll find detailed guides, practical examples, and best practices to accelerate your development journey.
Blog
These blog posts cover the framework overview, core capabilities, and engineering practices—read as needed:
- A Go Agent Framework for Building Intelligent AI Applications
- GraphAgent Seamlessly Combines AI Workflows and Agents
- Quickly Build AG-UI-Based Agent Services
- A Go-Native Implementation of the Anthropic Agent Skills Specification
- Building an Enterprise-Grade, Secure, and Controllable OpenClaw Runtime
- A Complete Guide to AI Agent Automated Evaluation Paradigms and Engineering Practice
- A Complete Guide to Automated Prompt Iteration and Engineering Practice for AI Agents
Quick Start

The demo above shows a tRPC-Agent-Go service streaming agent events to an AG-UI client while the agent plans, calls tools, and updates the interface.
Prerequisites
- Go 1.21 or later
- LLM provider API key (OpenAI, DeepSeek, etc.)
- 5 minutes to build your first intelligent agent
Run the Example
Get started in 3 simple steps:
# 1. Clone and setup
git clone https://github.com/trpc-group/trpc-agent-go.git
cd trpc-agent-go
# 2. Configure your LLM
export OPENAI_API_KEY="your-api-key-here"
export OPENAI_BASE_URL="your-base-url-here" # Optional
# 3. Run your first agent!
cd examples/runner
go run . -model="gpt-4o-mini" -streaming=true
What you'll see:
- Interactive chat with your AI agent
- Real-time streaming responses
- Tool usage (calculator + time tools)
- Multi-turn conversations with memory
Try asking: "What's the current time? Then calculate 15 * 23 + 100"
Basic Usage
package main
import (
"context"
"fmt"
"log"
"trpc.group/trpc-go/trpc-agent-go/agent/llmagent"
"trpc.group/trpc-go/trpc-agent-go/model"
"trpc.group/trpc-go/trpc-agent-go/model/openai"
"trpc.group/trpc-go/trpc-agent-go/runner"
"trpc.group/trpc-go/trpc-agent-go/tool"
"trpc.group/trpc-go/trpc-agent-go/tool/function"
)
func main() {
// Create model.
modelInstance := openai.
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
84.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
73.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.1kOpen-source super AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
