AgentScope Go Catch-Up Plan: Reaching Parity with the Python Reference Implementation
Based on a comprehensive comparison dated 2026-06-11, this plan aims to bring agentscope.go to (or near) parity with the Python agentscope v2 reference in terms of production-grade agent service delivery and abstraction completeness — while preserving Go's strengths in memory (ReMe), event-driven design, orchestration (a2a/workflow), permissions, and testing.
Where Go Already Leads or Matches
- Event-driven V2 architecture with fine-grained events, Hook/StreamHook, and interrupt/resume (AgentState)
- ReMe long-term memory system (far beyond the currently visible Python implementation)
- Advanced multi-agent orchestration: pipeline / workflow / msghub / reflection / plan / MapReduce
- A2A protocol support (claimed ahead of Python v2)
- Gateway: SSE / WebSocket / StreamableHTTP / AG-UI / Tool Offload / BackgroundTask / Schedule / MCP per-session & workspace, JWT authentication, OTel/LangSmith
gateway/app.goalready hasAppConfig+NewApp+RegisterAppRoutes(commented as mirroring Python'screate_app())service/Storage (Memory + Redis) and entities (User / Session / AgentConfig / Credential encrypted / Schedule / StoredMessage / Snapshot)- CRUD endpoints for agents / sessions / credentials in
gateway/service_handlers.go gateway/agent_factory.gocan build a ReActAgent from persisted AgentConfig + Credential- Task tools (
tool/task/) already aligned with Python's four tools; HintBlock implemented; Tool Offload + hints injection done - Workspace (Local / Docker / E2B + MCP + Offloader), Schedule integration, production examples, extensive bench + e2e tests
- Incremental evolution, not rewrite: map Python's good patterns (typed credentials + schemas, rich records, create_app-style API, startup lifecycle) onto idiomatic Go, reusing the existing gateway/service/session/workspace/agent_factory/schedule/tool_offload components.
- Go philosophy: idiomatic structs/functions, interface abstractions (e.g.,
service.Storage), minimal external dependencies. UI should be self-contained Go (HTMX + templates or a minimal frontend), while keeping the AG-UI protocol complete so users can reuse the Python TS Studio. - Backward compatibility: new abstractions optional; existing production and multi_tenant_workspace examples keep working.
- Verifiable: every phase passes
go test ./... -race; new e2e tests; new examples start with one command and demonstrate CRUD + chat + schedule. - Priority: UI (user perception) + typed Credential + high-level App bootstrap (developer experience) > other polish.
- Build a new
credential/package mirroring Python:credential/base.go(CredentialBase), per-provider implementations (openai.go,anthropic.go, ... with Secret fields),credential/factory.go(register, from_map,list_schemas()returning JSON schemas, class lookup), Cipher integration for encryption. - Enrich service entities: AgentData with ContextConfig/ReActConfig,
Credential.Datatyped map, richer Schedule fields (timezone, permission_mode, stateful, chat_model_config), ChatModelConfig with credential_id; update memory/redis storage and handlers. - Strengthen
gateway/app.go: convenience constructor (NewService/MustNew), auto-wiring of SessionManager / BackgroundTaskMgr / ToolOffload / WorkspaceManager, startup lifecycle (restore schedules, start scheduler, register default tools, defaults for permission and optional ReMe memory), new/credential/schemasroute, improved AgentFactory for typed credentials. - Milestone:
go test ./... -racegreen; typed OpenAI/Anthropic credentials round-trip; schemas endpoint returns usable JSON schemas. - Schedule restore at startup (mirroring Python's lifespan + scheduler.restore).
- Convenient registration of a standard tool set (file + task + schedule + web + json + skillviewer + subagent) bound to workspace/permission.
- Expose ToolOffloadMiddleware / hints via high-level AppConfig.
- Align more Python schema/router fields; enhance agent_factory/session construction for dynamic injection of toolkit + memory + permission + workspace binding.
- Milestone: persisted schedules auto-restore after restart; a new
examples/full_servicedemonstrates end-to-end CRUD + scheduled tasks + background tool offload. - Extend
workspace/docker.goRenderDockerfile with multiple templates (install_pypi, install_src, node support, MCP sidecar); improve BuildImage / health checks. - Create a top-level
embedding/package: base interface, provider implementations (OpenAI, Ollama, Gemini), file embedding cache, dimension/modality support. - Add Meta-style tools (e.g., ResetTools) if useful; ensure SkillViewer + load_skill_tool register easily.
- Milestone: varied Dockerfile rendering works; embedding package usable standalone for memory or RAG.
- Recommended main approach: a lightweight self-contained Studio in
examples/studioor astudio/package using Gohtml/template+ HTMX (+ Tailwind Play CDN ortempl). Covering: auth (register/login), Agents CRUD, Credentials with schema-driven dynamic forms, Sessions & Chat (integrating/v2/chat/streamor AG-UI SSE with multimodal, simple tool renderers, confirmation cards), Schedules (cron + timezone + permission_mode + stateful), Workspaces/MCP status, and model selection. - Auxiliary approach: polish AG-UI protocol support (
gateway/agui.go) and document how to connect the Python TS Studio to the Go gateway (baseURL + auth headers); optional minimal TS/JS demo. - Not recommended now: a full 1:1 port of the 60+ component React app (high maintenance cost).
- Milestone: after
go run ./examples/production, a user can register, create credential + agent, chat, and create a working schedule in the browser. - Wrap existing observability (OTel + LangSmith + hooks) into easy-to-use tracing middleware.
- Update README/docs, migration guide, AGENTS.md; add unit/integration/e2e tests for new packages and bootstrap; keep
-racegreen; CHANGELOG and release prep. - Optional forward-looking items (evaluation/finetune/voice) deferred.
- UI effort: lightweight HTMX UI estimated at 1–3 weeks for core features; a full React port is high-risk.
- Credential refactor: must not break existing
service.Credential+ AgentFactory consumers — use a new package plus adapter layer. - Storage backward compatibility: new fields optional; old records migratable.
- Dependencies: avoid heavy frontend frameworks; HTMX + minimal JS keeps deps low.
- AG-UI compatibility: prioritize protocol stability so the Python UI becomes a "free" rich option.
- Scope control: strict phase slicing, no gold-plating; each phase ends with demonstrable value.
go test ./... -race -count=1passes- New features have unit / integration / e2e tests
- Runnable examples demonstrating target flows (CRUD + chat + schedule + UI)
- README / docs updated; no breaking public API changes (or a clear migration path)
- Agentic RL / finetuning
- Full real-time voice multimodality (Go already has AudioModel + OpenAITTS + voice examples)
- Distributed execution (early
dist/scaffolding exists) agentscope/app/create_app + lifespan + _manager/* + _router/* + storage/*→gateway/app.go + NewApp + service/Storage + gateway/*_handlers + session_manager + background_task + workspace_manager + schedule_*(goal: higher-level convenience constructor + auto-wiring)agentscope/credential/* + CredentialFactory + list_schemas→ newcredential/package + factory +/credential/schemasagentscope/embedding/*→ newembedding/packagemessage/HintBlock + tool_offload_middleware→ Go already has HintBlock + tool_offload.go (align usage)workspace/_docker/templates → extendworkspace/docker.go+ template filesexamples/web_ui/frontend+examples/agent_service→ Goexamples/studio(lightweight) + AG-UI docs + upgraded production exampletool/_task/→tool/task/(already aligned)
Main Gaps to Close
1. Production-grade Web UI / Studio — the biggest user-visible gap. Python ships a full React/TS "new-studio" (60+ components, chat/credential/schedule/agent/skill/workspace management, i18n, tour, dynamic forms). Go has only a minimal static demo in examples/web_ui/.
2. Unified App/Service framework completeness — Python offers app.create_app(...) with lifespan auto-start of all managers, schedule restoration, full router registration, and rich storage records. Go has strong components but lacks a one-command bootstrap.
3. Credential abstraction — Python has a credential/ package (CredentialBase, per-provider subclasses, type discriminator, SecretStr, CredentialFactory with register / from_dict / list_schemas() for dynamic forms). Go's service.Credential is flat (provider + label + encrypted) with no typed models, schema endpoint, or factory.
4. Other abstraction gaps — no standalone top-level embedding/ package; single Docker template vs. Python's multiple Dockerfile.*.template files; less rich Agent/Session/Schedule data models (missing ContextConfig/ReActConfig, timezone/permission_mode/stateful ScheduleData fields, explicit credential_id on ChatModelConfig); tracing middleware organization.
5. End-to-end "Agent Service + Studio" example — Python pairs examples/agent_service with a full web UI; Go's production examples are strong but lack a rich companion UI.
Overall Strategy
Phased Roadmap
Phase 1: Core Abstraction Parity & Bootstrap
Phase 2: Service Completeness & Lifecycle
Phase 3: Workspace & Tool Polish + Embedding Package
Phase 4: Rich Web UI / Studio (Closing the Biggest Gap)
Phase 5: Observability, Docs, Tests, Release
Implementation Order & Parallelism
Phase 1 → Phase 2 → Phase 3 (partially parallelizable) → Phase 4 (depends on Phase 1 schemas and CRUD) → Phase 5. Embedding work and Docker templates can start early; UI design sketches can be prepared in advance.
Risks & Trade-offs
Definition of Done (per phase)
Out of Scope (future evolution)
Key File Mapping (Python → Go)
credential package (the foundation for schemas and dynamic forms), tracked via a detailed todo list, with progress validated by tests and runnable examples.