AgentScope Studio Documentation
repository·main·Indexed 20 days ago
https://github.com/agentscope-ai/agentscope-studioA development-oriented visualization toolkit for building, debugging, and evaluating agent-based applications using AgentScope. It provides real-time runtime visualization, OpenTelemetry-based tracing for LLM calls and token usage, statistical evaluation tools, and project management via Projects and Runs. Includes a built-in development assistant, AgentScope-Friday, and supports deployment via Docker and Docker Compose.
What's inside AgentScope Studio
- AgentScope-Studio is a locally deployed visual development component designed specifically for services developed with AgentScope. It provides a transparent, simple, and engaging environment for developers to develop, debug, and evaluate intelligent agent applications built on the AgentScope framework.
Overview of AgentScope Studio features
mainAgentScope Studio is a local visualization toolkit for AgentScope developers. Key capabilities include:
- Project Management: Organizing AgentScope projects through Projects and Runs.
- Runtime Visualization: A chatbot-style interface for real-time interaction with agents.
- Tracing: OpenTelemetry-based visualization for LLM calls, token usage, and agent invocations.
- Agent Evaluation: Statistical analysis for evaluating agent performance.
- Built-in Copilot (Friday): A development assistant and playground for rapid development and feature integration.
AgentScope-Friday features and capabilities
mainAgentScope-Friday is an evolving agent with the following feature set:
Implemented Features:
- Basic chat functionality with LLMs
- Meta tool support
- Realtime steering and interruption (via websocket connection)
- State and Session management
Upcoming/In-Progress Features:
- Planning and plan visualization
- Long-term memory
- Anthropic agent skill support
- Dynamic user addition of MCP (Model Context Protocol) servers
Technical architecture of AgentScope-Studio
mainAgentScope-Studio is built using the following technology stack:
- Frontend: TypeScript, React, Vite, and TailwindCSS.
- Communication: HTTP-based TRPC and WebSockets.
- Backend: Node.js and Express.
- Database: TypeORM with SQLite.
AgentScope-Studio is published as the
@agentscope/studiopackage on NPM under the Apache-2.0 license.Understand the AgentScope-Studio directory structure
mainWhen adding or modifying files, follow the established directory structure:
Client (
packages/client/src/):assets/: Static resources (images, icons)components/: React UI componentscontext/: React Context providers for state management and data fetchingi18n/: Internationalization filespages/: Page components for different routesutils/: Utility functions and helpers
Server (
packages/server/src/):dao/: Data Access Objects for database interactionmigrations/: Database migration scriptsmodels/: Database modelsotel/: OpenTelemetry tracing configurationtrpc/: tRPC API route handlersutils/: Utility functions and helpersdatabase.ts: Database connection settingsindex.ts: Server entry point
Understand AgentScope-Studio observability semantic conventions
mainAgentScope-Studio uses observability data that follows the OpenTelemetry semantic conventions. Adhering to these conventions ensures that your trace data is processed and displayed accurately and clearly within the Studio UI.
Note: The native AgentScope library already follows these conventions. If you provide data from other sources that do not follow these conventions, traces will still be displayed, but critical information may not be highlighted or specifically formatted in the UI.
How Run Visualization and Trace data work
mainWhen viewing a Run in AgentScope-Studio, you can monitor execution through two primary lenses:
- Chatbot-style UI: Displays the interaction history. Because a single agent
replycan generate multiple messages (e.g., user prompts and system tool results), Studio allows you to toggle the view betweenreplyId(grouping messages into complete agent replies) ormsg.id(viewing individual messages). - Trace Visualization: The right panel provides OpenTelemetry-based trace data. This allows you to inspect the detailed inputs and outputs of specific agent objects, LLM calls, and tool usage during the run.
Studio also supports User Input Hosting, where the Studio interface acts as a bridge, hosting user inputs and pushing them in real-time to your Python agent application via WebSockets.
- Chatbot-style UI: Displays the interaction history. Because a single agent
How Run Visualization and Replies work
mainIn AgentScope, a single agent
reply(one call to thereplyfunction) can generate multipleMsgobjects (e.g., 'user' role prompts or 'system' role tool results).To make visualization intuitive, AgentScope-Studio introduces the reply concept. A reply groups multiple messages into a single logical unit of an agent's response.
In the Studio UI, developers can toggle between viewing messages by
replyId(grouped by response) or bymsg.id(individual messages).Key features of AgentScope-Studio
mainAgentScope-Studio provides several core capabilities for agent development:
- Project management and chatbot-style visualization: Manage projects and view agent interactions in a chat interface.
- OpenTelemetry-based tracing visualization: Visualize traces generated via OpenTelemetry to debug agent workflows.
- Evaluation-oriented analysis and visualization: Tools for analyzing and visualizing the performance and results of agent evaluations.
- AgentScope-Friday: A built-in agent designed to assist with quick secondary development tasks.
AgentScope-Friday Project Structure
mainIf you are performing secondary development on the Friday agent, the core logic is organized as follows:
main.py: The entry point for the Friday agent.args.py: Parameter parser for the agent.model.py: Handles LLM initialization based on configuration.hook.py: Contains hook functions used to push messages to the AgentScope-Studio frontend.utils/connect.py: Manages the WebSocket connection used for real-time control and interruption.tool/: Directory containing agent tools.requirements.txt: List of dependencies required for the Friday agent.
packages/ app/ friday/ tool/ utils/ connect.py # 用于实时操控/中断的 websocket 连接 ... main.py # Friday 智能体的入口点 args.py # Friday 智能体的参数解析器 hook.py # 用于将消息推送到 AgentScope-Studio 前端的钩子函数 model.py # 基于配置初始化 LLM requirements.txt # Friday 智能体的依赖项How Projects and Runs organize observability data
mainAgentScope-Studio uses a two-tier organizational structure to manage AI application data:
- Projects: High-level containers used to isolate different AI applications or experimental environments.
- Runs: Individual execution instances within a project. A Run represents a single complete running process or session, tracking its own specific execution history and status.
By using this hierarchy, you can separate observability data for different experiments and manage multiple execution instances under a single project umbrella.
Configure data persistence for AgentScope Studio
mainTo ensure user data is preserved across container restarts, you should mount the container's
/app/datadirectory to a host directory. By default, thedocker-compose.ymlmaps the host./datadirectory to the container's/app/datadirectory.volumes: - ./data:/app/data