Agentscope Go AI Agent

by agentscope-ai• 67•• Scanned•Claim this listing•Request removal
Coding Agentsagentagenticagentic aiaichatbot

AgentScope Golang: Agent-Oriented Programming for Building LLM Applications

Agentscope Go is an open-source ai agent by agentscope-ai, written mainly in Go, with 67 GitHub stars and the Apache-2.0 license. Its code was last updated Oct 30, 2026.

<p align="center"> <img src="https://img.alicdn.com/imgextra/i1/O1CN01nTg6w21NqT5qFKH1u_!!6000000001621-55-tps-550-550.svg" alt="AgentScope" width="120" /> </p>

AgentScope Go

CI Go License

Español · Quick start · Examples · Documentation · Contributing

AgentScope Go is a Go library for building LLM applications with agents, tools and multi-agent workflows. It implements the core concepts of AgentScope through Go interfaces, contexts and channels, and can be embedded in a service or command-line program.

What you can build

  • Tool-using assistants: connect model calls to Go functions, manage context and request human confirmation for tool execution. Use AskUser to collect structured choices through your own frontend. On main (unreleased), opt into bounded tool dispatch with agent.WithToolConcurrencyLimit(width).
  • Multi-agent workflows: coordinate agents with pipelines, message routing and leader/worker teams. On main (unreleased), use the experimental TeamPipeline for serial named-member delegation and participant confirmation/external-result routing.
  • Applications with memory: combine retrieval, conversation state and memory middleware with your own data sources.
  • Services and experiments: expose an HTTP service or browser UI, record model responses, evaluate runs and inspect traces.

Quick start

You need Go 1.25+ and, for the program below, an Anthropic API key and an available model ID. Other adapters are listed under Model providers.

Install in your application

Install the latest tagged release from the community module path. Applications using github.com/alanfokco/agentscope-go/v2 need to update their import prefix; see the module migration notes.

From a new directory:

mkdir agentscope-demo
cd agentscope-demo
go mod init example.com/agentscope-demo
go get github.com/agentscope-ai/agentscope-go/v2@latest

Create an agent

Save this as main.go:

package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"time"

	"github.com/agentscope-ai/agentscope-go/v2/pkg/agentscope/agent"
	"github.com/agentscope-ai/agentscope-go/v2/pkg/agentscope/model"
)

func main() {
	cm, err := model.NewAnthropicChatModel(&model.AnthropicConfig{
		SecretAPIKey:    model.NewSecretStr(os.Getenv("ANTHROPIC_API_KEY")),
		Model:           os.Getenv("ANTHROPIC_MODEL"),
		MaxOutputTokens: 1024,
	})
	if err != nil {
		log.Fatal(err)
	}

	assistant := agent.NewUnifiedAgent(
		"assistant", "You are a helpful assistant. Keep answers concise.", cm,
	)

	ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
	defer cancel()

	reply, err := assistant.Reply(ctx, "What is an AI agent? Explain in one sentence.")
	if err != nil {
		log.Fatal(err)
	}
	if text := reply.GetTextContent("\n"); text != nil {
		fmt.Println(*text)
	}
}

Set your key and a model ID available to your account, then run the program. These shell commands use Bash/Zsh syntax; in PowerShell, set environment variables with $env:NAME = 'value'.

export ANTHROPIC_API_KEY='your-api-key'
export ANTHROPIC_MODEL='your-model-id'
go mod tidy
go run .

The program makes a model API request and prints its reply. To add function calling, see the tool example; for configuration and next steps, see Getting started.

Model providers

Adapters are available for OpenAI (Chat Completions and Responses), Anthropic, DashScope, DeepSeek, Gemini, Moonshot, xAI, Ollama, Volcengine Ark and MiniMax. See provider configuration and the adapter source for options and defaults.

Tool calling, multimodal input, thinking and usage reporting depend on the provider and model. Provider ChatStream methods expose response chunks; UnifiedAgent.ReplyStream streams thinking/text deltas from ChatStream by default when no middleware is installed. Legacy middleware chains keep buffered Chat calls so response filters can run before publication. Use agent.WithModelStreaming(false) for the previous buffered behavior. See agent streaming for completion, cancellation and fallback semantics.

For local models, configure the context window and request timeout for your server and device. Model cards describe model capabilities; they do not configure the server. See edge deployment and the tracked local-model limitations.

Examples

Examples run from a repository checkout, separately from the application above. This worker-pool demo uses simulated jobs and needs no model API key:

git clone https://github.com/agentscope-ai/agentscope-go.git
cd agentscope-go
go run ./examples/agent_pool

Start with agent_v2 for function tools, model_call for direct model streaming, or webui for a browser interface. Check each example's source for its model choice, environment variables and required services or runtimes.

<details> <summary>Browse all examples</summary>
ExampleDemonstrates
simpleA custom agent with a single model call
agent_v2UnifiedAgent with a function tool
react_toolA custom FunctionTool
react_builtin_toolsThe built-in coding toolkit
streamingAgent lifecycle events and provider text deltas
ask_userStructured questions with a simulated model and host answer
consoleTerminal chat and tool-call confirmation
managed_routing_evalManaged fixed/rules/classifier comparisons, offline fixtures and opt-in live pilot
managed_routingManaged pools, classification and fallback with offline fixtures
tier_routingUnifiedAgent with fixed and three-tier routed fake ChatModels
embodied_demoSingle-device observation, edge/cloud planning and simulated action loop
managed_taskFixed-model managed text execution with a local HTTP fixture
classifierTyped classification with offline fake results and attempt accounting
piccoloLocal Piccolo text decisions with an offline fixture and opt-in live server
permission_advisoryShadow-mode classifier advice with unchanged scripted user confirmation
model_callDirect model streaming, tool calls and structured output
volcengineDirect Ark chat streaming with API-key authentication
minimaxMiniMax tool use with preserved thinking and a streamed follow-up
structured_outputStructured output through tool calling
multi_providerProvider configuration and model cards
multimodalImage input using URLs and base64 data
multiagentMulti-agent conversation
multiagent_multimodalMulti-agent conversation with image input
openai_responseOpenAI Responses API
openai_serverOpenAI-compatible Chat Completions serving with a simulated order assistant
middlewareModel-call and tool-execution hooks
permissionTool permission modes
tracingTracing with LoggerTracer
tracing_otlpAn OTLP integration setup pattern
agent_loopLoop configuration and metrics
embeddingText embeddings and similarity
long_term_memoryLong-term memory middleware
agentic_memoryFile-based memory and MEMORY.md
rag_reactRetrieval with an in-memory index
pipeline_multi_agentPipeline and MsgHub coordination
goal_pipelineBounded executor-verifier loop with offline models and an actual artifact
team_pipelineOffline named-member delegation with host confirmation and a follow-up
agent_teamLeader/worker agent coordination
mcpMCP tool discovery and calls
mcp_streamableMCP Streamable HTTP client with an in-process spec server
a2a_httpAgent-to-agent communication over HTTP
grpc_a2aTCP messaging with newline-delimited JSON, not gRPC
replaySimulated response tapes and file persistence
replayviewA terminal viewer for RunJSONL logs
rundiffCompare RunJSONL logs
eval_harnessScore recorded response fixtures
agent_poolA bounded worker pool with simulated jobs
hotreloadTyped configuration reloads
benchLoad testing and latency reports
quality_loadTask quality under scheduled arrivals, with offline fixtures
qdrant_filterMetadata filtering against a local Qdrant server
wasm_sandboxWASM runtime discovery and sandbox configuration
hub_installComponent registries and installation APIs
skill_partitionsPer-agent workspace skill directories
workspace_sharingSession/workspace bindings and artifact access
access_controlResource grants and access checks
document_parserDocument parsing and chunking
audit_loggingSandbox policy checks and audit records
guardrailBlock, redact and warn with mock model responses
spend_capObserved-cost budgets with a mock model
agent_serviceHTTP service and SSE events
scoped_serviceOffline shared service with owner-scoped sessions and file tools
webuiEmbedded browser UI
dingtalk_channelDingTalk messages and confirmations
scheduled_taskOne-shot and recurring tasks
realtime_echoA realtime-interface echo client
edge_offlineCloud/local routing with Ollama
edge_sensorSensor middleware with a mock sensor
edge_serial_robotDevice tools with a mock serial device
edge_fleetIn-memory pub/sub fleet simulation
werewolvesA multi-agent Werewolves game
k8s_workspaceKubernetes workspace configuration and cluster tools
</details>

The examples guide provides running instructions and links to the same catalog.

Documentation

TopicGuide
Setup and a first agentGetting started
Models and toolsProviders · Tools
Context compactionExperimental tool-exchange retention
Managed text tasksFixed-deployment execution, limits and accounting · Routing and deployment pools · Evaluation workflow
Probabilistic classificationClassifier API and attempt accounting · Jev adapter · Bailian adapter · OpenAI Decisions adapter
Middleware and memoryMiddleware
Goal executionExperimental GoalPipeline and Agent adapters
Named-member teamsExperimental serial TeamPipeline and host interactions
Shared HTTP serviceExperimental owner-scoped sessions and request-aware construction
Application deploymentDeployment · Execution and session limits · Reply recovery
OpenAI-compatible servingExperimental Chat Completions handler and client contract
Runtime and evaluationRuntime features · Load and quality testing · Replay and evaluation source
Local models and devicesEdge deployment · Device tools · Multi-device coordination · Offline operation
Implementation and compatibilitySource map · API stability · Changelog

Project status

Stability varies by package. The core model, message, agent, tool, permission, formatter and error APIs have documented stability commitments; other packages include experimental interfaces. Read STABILITY.md for the exact scope and remaining hardening work. Features on main may not be in a release.

For deployments that execute shell commands or access files, configure and test the appropriate workspace backend and permissions. Permission checks alone do not provide complete process, network or resource isolation. Deployment requirements depend on the selected providers and backends.

Contributing

Bug reports, regression tests, documentation and focused feature contributions are welcome. For a bug, include the version or commit, configuration and a minimal reproduction with secrets removed. For a larger feature, open an issue to discuss the use case and API before starting a broad implementation.

Read CONTRIBUTING.md for setup and the PR process, and AGENTS.md for validation and review requirements. Small PRs with a clear purpose are easier to review; there is no need to take on a whole subsystem. Please follow our Code of Conduct.

Report suspected vulnerabilities privately through SECURITY.md, not in a public issue.

License and citation

Licensed under Apache-2.0. For research using AgentScope, see AgentScope: A Flexible yet Robust Multi-Agent Platform.

Agentscope Go alternatives

View more →

Similar ai agents in Coding Agents, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
Agentscope Go (this page)
agentscope-ai
67Apache-2.0Oct 30, 2026Scanned, no flagged issues
AutoGPT
Significant-Gravitas
188kNone foundNov 1, 2026Not scanned yet
Langchain
langchain-ai
149kMITNov 1, 2026Scanned, no flagged issues
Gemini CLI
google-gemini
109kApache-2.0Nov 1, 2026Scanned, no flagged issues
MetaGPT
FoundationAgents
71kMITJan 21, 2026Scanned, no flagged issues
Oh My Openagent
code-yeongyu
71kNone foundNov 1, 2026Not scanned yet