What Is AgentScope Service (Implementation View)
From an implementation perspective, AgentScope Service is not a single process but a set of components with clear boundaries:
It serves two kinds of workloads at the same time:
- Managed Agents: the control plane holds versioned Snapshots, and the data plane builds
HarnessAgentfrom the Snapshot and runs eventized Turns; - BYO Agents: existing AgentScope / LangChain / Claude and other runtimes connect via extensions,
instrument(), or Sidecar, entering the same fleet and Session observability model.
aistiod.
Why a Platform Like This Is Needed
Looking at the agent loop alone, today’s frameworks are already enough to write demos. The hard part is turning “it runs” into “it can be operated”:- Local scripts / CLI: state lives in local directories, good for individuals, not for multi-replica or audit scenarios.
- Embedded SDK inside business services: every application reimplements SessionStore, HITL, leases, event replay, and permissions on its own, with duplicated costs and divergent standards.
- Low-code orchestration: exposes Harness engineering details to business configurers, making unified platform upgrades difficult.
- Single managed runtime: works well, but cross-framework fleets, customer VPC Hands, and team collaboration state often end up as separate stovepipes.
- Governance concerns converge on the control-plane / data-plane contract;
- Inference kernel converges on AgentScope Harness;
- Tool execution boundary converges on Environment (Hands).
Overall Architecture
Plane Responsibilities
Data Ownership
The planes may share a single PostgreSQL server, but they do not share tables:
The Dataplane resolves Managed Sessions through the control plane’s internal API and builds the runtime only from the returned Agent Snapshot. Data-plane replicas can scale horizontally, but the product Catalog still takes the control plane as the source of truth, avoiding dual writes and cache drift. A local Catalog fallback may look convenient, but in the long run it tends to create ghost bugs where “instance A has been updated, but instance B is still running the old definition.”
A Full Turn Path
- The client appends
user.messageto an existing Session. - The Dataplane acquires the Turn Lease and marks the Session as
running. - The control plane resolves the pinned Agent Snapshot, Environment, Workspace, Memory, and Vault.
SessionTurnRunnerexecutesHarnessAgent.streamEvents.- Authoritative events such as
agent.message,agent.tool_use, andspan.model_request_*are written to PostgreSQL; optional Preview Deltas are used only for typewriter effects and are not persisted. - The Session returns to
idle, pauses for HITL / Tool Result, or terminates with a typed error.
Brain and Hands
self_hosted is suitable for private networks: the Brain does not need inbound access to the customer intranet; instead the Worker actively polls outbound for tool calls. The protocol semantics are a stable tool_use / tool_result event closed loop — when Hands move elsewhere, the Brain’s inference loop does not need to be rewritten.
Security and compliance teams can therefore approve three questions separately: the scope of model context visibility, the reachable network and filesystem for tools, and the data-minimization policy for results returned to the Brain. This is easier to land than treating “the whole agent container” as a single black-box permission object.
Core Capabilities (Implementation Layer)
For UI screenshots, see the product post; here we focus on the mechanisms.
Dashboard: Fleet and Runtime Observability
Dashboard data comes mainly from the control-plane Runtime Store and data-plane event projections, rather than ad-hoc frontend aggregation:- Agent / Instance health and online inventory
- Session phase (e.g.
active/idle/compressing/archived/terminated) and Turn duration - Context pressure, Token delta, error counts
- Team member status, task progress, lifecycle events
- Session: a recoverable conversation thread;
phasedescribes the thread’s operational state. - Turn: an execution unit from one user request to the response; duration statistics belong to Turn, not to the wall-clock lifetime of a Session mistakenly treated as “active time.”
Managed Agents: Versioned Definition + Eventized Session
The product resource model is roughly as follows:
A few key design choices:
-
Session creation is a static binding
Creation records only resource relationships; the Agent is not run until the firstuser.message. -
Event-native
Inbound events drive work, and outbound events describe progress and results. Every persisted event has a monotonically increasing sequence number within the Session, so clients can resume from breakpoints. -
HITL as a first-class citizen
The Ask Policy tool pauses the Turn and emits a confirmation request;user.tool_confirmationcontinues or rejects, while preserving the full history. -
Authoritative events vs Preview
SSE can pushevent_start/event_deltafor an immediate experience, but the persisted events are final. UI refresh, multi-device recovery, and audit replay all rely on the same source of truth. -
Version pin
A Session binds to a specific versioned Snapshot of an Agent to avoid an unreproducible trajectory caused by a hot update mid-run. When an upgrade is needed, explicitly create a new Session or take the product-defined upgrade path.
HarnessAgent: context compaction, tool-result eviction, state recovery, Skills / subtasks, and other engineering defaults do not need to be reimplemented as another agent loop at the product layer. What the product layer adds are tenant resources, ACL, event contract, Turn Lease, HITL ticket, Environment, and Worker queue — these are the costs that turn a “framework” into a “platform.”
Agent Teams: Cross-Session Collaboration State Machine
Agent Teams turn multi-agent collaboration into a control-plane resource rather than a temporary chat in some process’s memory:- Lead / Member topology and dynamic membership (count / whitelist constraints)
- Unicast and broadcast messages
- Shared tasks, Claim / Assign, Plan Approval
- Member Wakeup, graceful shutdown, lifecycle deadlines, failure recovery
- Messages and tasks retained across processes and across Sessions
rt schema, avoiding confusion with the per-Session dp event log — Session is responsible for one conversation trajectory, while Team is the persistent unit for cross-member collaboration.
A pragmatic constraint is that Teams do not assume all members come from the same source. The Lead can be a Managed Harness Agent, and a Member can be a connected Coding Agent or LangChain service. The control plane handles topology, tasks, and lifecycle; the member side only needs to satisfy the collaboration and observability contract. Heterogeneous teaming is closer to enterprise reality than “unify the framework first, then talk about collaboration.”
How to Connect
AgentScope (Native)
The Java side connects throughagentscope-extensions-aistio. The extension registers the Runtime with the control plane, reports Session / Context / health information, and handles operational commands. For existing AgentScope applications, this is the least invasive and most contract-complete path: it shares the Dashboard and Session observability model with Managed Agents.
Because both sides share the same set of AgentScope event and state semantics, Level-1 / Context / compaction capabilities are usually the first to align. If you are already using HarnessAgent, the marginal cost of integration is mainly dependencies, registration config, and runtime identity, not rewriting business prompts.
LangChain
The Python SDK providesaistio.instrument(). For LangChain / LangGraph, the adapter hooks into Callback / Checkpointer interception points:
Claude SDK and Sidecar
The Claude Agent SDK also usesinstrument() to obtain Level-1 snapshots and compaction / termination capabilities by decorating paths such as SessionStore.
For Coding Agents such as Claude Code and Qoder where embedding an SDK is inconvenient, a Sidecar is used:
- The main container continues to run the original CLI / Agent;
- The Sidecar observes the local Session directory (e.g.
~/.claude/) and runtime state; - It reports fleet and Session information to the control plane and forwards supported operational commands;
- When necessary, it synchronizes Session file state to external storage to support cross-node recovery.
Local Startup and Validation
- Managed Session: deliver
user.message, recover from the event stream, and confirm sequence resumption after page refresh; - HITL: trigger Ask Policy, continue after confirmation, and verify the history is complete;
self_hosted: Worker poll / ack / heartbeat / returntool_result, and confirm the Turn recovers correctly.
docs/guide/14-validation.md and the architecture notes in docs/guide/02-architecture.md.
Implementation Pitfalls Worth Avoiding Early
-
Treating Preview SSE as the authoritative log
Typewriter effects can be dropped and rebuilt on reconnect; audit, review, and billing should align with persisted event sequence numbers. -
Letting the data plane cache product Catalog locally and silently fall back when the control plane is unreachable
It may look highly available in the short term, but in the long term it produces the worst failure: “ran an unknown version.” Better to fail observably than to silently use an old definition. -
Mixing Session phase with Turn duration
active/idledescribe thread state; duration belongs to Turn. Otherwise Dashboard “who is busiest” will be misled by long-hanging sessions. -
Inventing parallel metrics in BYO adapters
Fleet KPIs must share semantics. When adapting a new framework, align the contract first, then consider specialized fields. -
Stuffing Team messages into a member’s Session event stream to fake collaboration state
Session trajectory and Team state-machine lifecycles differ; mixing them causes recovery, cleanup, and permission boundaries to all break.
Roadmap (Engineering View)
-
Adapter coverage
Deepen Level-1 / Level-2 / Context alignment for LangChain, ADK, Claude, Qoder, OpenAI Agents, and others, reduce framework-specific fields, and ensure Dashboard KPIs mean the same thing everywhere. -
Production-grade multi-tenancy and governance
ACL, quotas, audit, canary release, key rotation, and stricter Environment isolation policies; Vault / Memory lifecycle and access boundaries will also continue to be refined. -
Automation
Evolve Deployment / Cron / Webhook / Channel from “can trigger” to “orchestratable, replayable, compensable.” When an automated Turn fails, there must be typed errors, retry policies, and a human takeover entry. -
Event-driven entry points
GitHub / GitLab, DingTalk, WeCom, etc.: stably map external events to Session Turns or Team Tasks while preserving idempotency and authentication boundaries. Retries from external systems are normal; the platform must prevent duplicate work. -
Teams and recovery
Dynamic membership, plan approval, member-disconnection recovery, cross-Session restart, and consistency of mixed Managed / BYO teams. The collaboration state machine is harder than a single Session because the failure domain spans multiple Runtimes.
What Is Different from “Just Embedding Harness”
If your business service directly embedsHarnessAgent, you already have solid long-task and compaction capabilities. But once you face multi-tenant, multi-replica, multi-team scenarios, you still need to add:
- Versioned Agent definitions and Session pin;
- Append-only events and cursor-based resume;
- Turn Lease and HITL ticket;
- Environment switching and Self-hosted Work Queue;
- Fleet registration, context pressure, compaction / termination commands;
- Team task board and cross-Session collaboration state.
Closing
The technical kernel of AgentScope Service can be summarized in three sentences:- The control plane manages desired and runtime state, the data plane runs Turns, and Hands decides where tools land;
- The persisted event sequence is the source of truth for Session; in-process objects are only disposable caches;
- Managed and BYO share the fleet contract; framework differences converge in adapters, not scattered across the Console.
agentscope-service/README.md directly; for product capabilities and onboarding stories, return to the release post.