trpc-group/trpc-agent-go

A Go framework for building production agent systems with graph workflows, tools, memory, A2A, AG-UI, MCP, evaluation, and observability.

1,643 ★287 forksGoUpdated 1d ago

What you need to know

A Go framework for building production agent systems — LLM agents, graph workflows (GraphAgent), tool calling, session/memory state, RAG knowledge retrieval, agent skills and self-evolution, with OpenTelemetry observability and AG-UI, A2A, and MCP protocol integration.

Install

Add via Go module: go get trpc.group/trpc-go/trpc-agent-go
Clone and run the example: git clone https://github.com/trpc-group/trpc-agent-go.git && cd trpc-agent-go && export OPENAI_API_KEY=... && cd examples/runner && go run . -model="gpt-4o-mini" -streaming=true

Usage

  • Create a model and agent: openai.New("deepseek-chat", ...) + llmagent.New("assistant", llmagent.WithModel(...), llmagent.WithTools(...))
  • Run via Runner with session/memory: runner.NewRunner("app", agent).Run(ctx, userID, sessionID, message)
  • Compose multi-agent workflows: chainagent.New / parallelagent.New / CycleAgent
  • Add MCP tools: mcpTool := mcptool.New(serverConn); expose frontends via AG-UI (SSE) and interop via A2A

Key features

  • GraphAgent: type-safe graph workflows with multi-conditional fan-out routing, functionally equivalent to LangGraph for Go
  • Multi-agent orchestration (chain, parallel, cycle) plus planner + executor loop
  • Rich tool ecosystem: function tools, MCP tools (via trpc-mcp-go), web search, code execution, file tools
  • Persistent session/memory (in-memory or Redis), RAG knowledge retrieval, versioned artifacts (in-memory, S3, COS)
  • Agent Skills (SKILL.md spec) with safe execution, agent self-evolution (Hermes-style session reviews), prompt caching (~90% savings), evaluation & benchmarks, OpenTelemetry + Langfuse observability

Best for

Go services that need concurrent, observable, production-grade agent applications integrating with MCP tools and AG-UI/A2A frontends.

Caveats

  • Requires Go 1.21+ and an LLM provider API key (OpenAI, DeepSeek, etc.)
  • Do not break the event loop when cancelling — always cancel the context and keep draining the event channel
  • When using WithCodeExecutor only for skill_run, disable the response code-execution processor to avoid auto-executing fenced code blocks (2.x guidance)
Platforms: Linux · macOS · Windows
Documentation ↗

Reviewed 2026-08-07

Topics

a2aa2a-protocolag-uiagentagent-frameworkaiai-agentsevaluationgogolanggraph-workflowsllmmcpmodel-context-protocolmulti-agentobservabilityopentelemetryrag
View on GitHub ↗
Stars
1,643★
Forks
287
Language
Go
License
Apache-2.0
Created
2025-05-14
Last push
2026-08-06