| name | agentscope-developer-framework |
| title | AgentScope 1.0: Developer-Centric Framework for Agentic Applications |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2508.16279 |
| keywords | ["agent-framework","developer-tools","async-design","react-paradigm","agentic-applications"] |
| description | Build agentic applications using unified agent interfaces, asynchronous design patterns, ReAct paradigm grounding, and developer-centric evaluation and deployment tools. |
AgentScope 1.0: Developer-Centric Framework
Core Concept
AgentScope 1.0 provides a comprehensive framework for building production-ready agentic applications. It features unified component architecture for easy model/tool integration, asynchronous design for efficient multi-agent systems, ReAct paradigm grounding combining reasoning and action, built-in agents for common tasks, visual evaluation interfaces, and runtime sandboxes for safe deployment.
Architecture Overview
- Unified Component Interfaces: Extensible abstractions for models, tools, memory
- Asynchronous Design: Event-driven architecture supporting diverse interaction patterns
- ReAct Paradigm: Structured reasoning and action loops
- Built-in Agents: Pre-configured solutions for common scenarios
- Developer Tools: Visualization, evaluation, and sandbox execution
Implementation Steps
1. Implement Core Component Abstraction
Create unified interfaces for models and tools:
from abc import ABC, abstractmethod
from typing import Dict, Any, List, Optional
from dataclasses import dataclass
import asyncio
@dataclass
class Message:
role: str
content: str
class ModelInterface(ABC):
"""Abstract base for LLM integration."""
@abstractmethod
async def generate(
self,
messages: List[Message],
temperature: float = 0.7,
max_tokens: int = 1024,
**kwargs
) -> str:
pass
class Tool(ABC):
"""Abstract base for agent tools."""
@abstractmethod
async def execute(self, input_str: str, **kwargs) -> str:
pass
@property
@abstractmethod
def description(self) -> str:
() -> [, ]:
():
():
.model_name = model_name
.api_key = api_key
() -> :
aiohttp
aiohttp.ClientSession() session:
payload = {
: .model_name,
: [{: m.role, : m.content} m messages],
: temperature,
: max_tokens,
**kwargs
}
session.post(
,
json=payload,
headers={: }
) resp:
data = resp.json()
data[][][][]
():
() -> :
:
result = (expression, {: {}}, {})
(result)
Exception e:
() -> :
() -> [, ]:
{: {: , : }}
2. Implement ReAct Agent Loop
Structure agents around reasoning and acting:
from enum import Enum
class ActionType(Enum):
THINK = "think"
ACT = "act"
CONCLUDE = "conclude"
@dataclass
class ReActTrace:
thoughts: List[str]
actions: List[Dict[str, str]]
observations: List[str]
final_answer: str
success: bool
class ReActAgent:
def __init__(
self,
model: ModelInterface,
tools: Dict[str, Tool],
max_steps: int = 10
):
self.model = model
self.tools = tools
self.max_steps = max_steps
self.trace: Optional[ReActTrace] = None
async def run(self, task: str) -> ReActTrace:
"""Execute ReAct loop."""
self.trace = ReActTrace([], [], [], "", False)
messages = [Message("user", task)]
for step in range(.max_steps):
thought = ._think(messages, task)
.trace.thoughts.append(thought)
messages.append(Message(, thought))
thought.lower() thought.lower():
action_str = ._extract_action(thought)
tool_name, tool_input = ._parse_action(action_str)
tool_name == :
.trace.final_answer = tool_input
.trace.success =
tool_name .tools:
observation = .tools[tool_name].execute(tool_input)
.trace.actions.append({: tool_name, : tool_input})
.trace.observations.append(observation)
messages.append(Message(, ))
.trace
() -> :
system_msg = Message(,
)
full_messages = [system_msg] + messages
.model.generate(full_messages)
() -> :
re
= re.search(, thought, re.IGNORECASE)
.group()
() -> :
re
= re.(, action_str)
:
.group(), .group()
action_str,
3. Implement Asynchronous Multi-Agent Coordination
Enable concurrent agent interactions:
class AgentPool:
"""Manages multiple agents with async execution."""
def __init__(self):
self.agents: Dict[str, ReActAgent] = {}
self.message_queue: asyncio.Queue = asyncio.Queue()
def register_agent(self, name: str, agent: ReActAgent):
"""Register agent in pool."""
self.agents[name] = agent
async def execute_task(
self,
task: str,
primary_agent: str,
parallel_agents: Optional[List[str]] = None
) -> Dict[str, ReActTrace]:
"""
Execute task with primary agent and optional parallel agents.
"""
results = {}
if primary_agent in self.agents:
results[primary_agent] = await self.agents[primary_agent].run(task)
if parallel_agents:
tasks = [
self.agents[agent].run(task)
for agent in parallel_agents
if agent in self.agents
]
parallel_results = asyncio.gather(*tasks)
agent_name, trace (parallel_agents, parallel_results):
results[agent_name] = trace
results
() -> [, ]:
messages = {agent: [Message(, task)] agent agents}
round_idx (max_rounds):
round_results = {}
agent_name agents:
agent = .agents[agent_name]
thought = agent._think(messages[agent_name], task)
messages[agent_name].append(Message(, thought))
round_results[agent_name] = thought
agent_name agents:
other_agent agents:
other_agent != agent_name:
messages[agent_name].append(
Message(, )
)
{agent: messages[agent][-].content agent agents}
4. Implement Evaluation Interface
Create tools for assessing agent performance:
class AgentEvaluator:
"""Evaluate agent performance on tasks."""
async def evaluate_on_dataset(
self,
agent: ReActAgent,
dataset: List[Dict[str, str]]
) -> Dict[str, float]:
"""
Run agent on dataset and compute metrics.
"""
results = []
for example in dataset:
trace = await agent.run(example["task"])
correct = trace.final_answer == example["expected_answer"]
results.append({
"correct": correct,
"steps": len(trace.actions),
"tools_used": [a["tool"] for a in trace.actions]
})
accuracy = sum(1 for r in results if r["correct"]) / len(results)
avg_steps = sum(r["steps"] for r in results) / len(results)
return {
"accuracy": accuracy,
"avg_steps": avg_steps,
"efficiency": accuracy / (avg_steps + 1)
}
def () -> :
viz =
viz += * +
i, (thought, action, obs) ((
trace.thoughts,
trace.actions,
trace.observations
)):
viz +=
viz +=
viz +=
viz +=
viz +=
viz
5. Implement Sandbox Execution Environment
Create safe execution context:
import docker
import json
class SandboxExecutor:
"""Execute agents in isolated containers."""
def __init__(self, image_name: str = "agentscope-runtime"):
self.client = docker.from_env()
self.image_name = image_name
async def run_agent_sandboxed(
self,
agent_code: str,
task: str,
timeout: int = 300
) -> Dict[str, Any]:
"""
Run agent code in isolated sandbox.
"""
container_input = {
"agent_code": agent_code,
"task": task
}
try:
container = self.client.containers.run(
self.image_name,
stdin_open=True,
stdout=True,
stderr=True,
detach=True
)
container.exec_run(
f"python /app/agent.py",
input=json.dumps(container_input).encode()
)
exit_code = container.wait(timeout=timeout)
logs = container.logs().decode()
container.remove()
return {
"success": exit_code == ,
: logs,
: exit_code
}
Exception e:
{
: ,
: (e),
: -
}
Practical Guidance
When to Use AgentScope
- Building production agent applications
- Multi-agent collaboration systems
- Rapid prototyping of agent architectures
- Applications requiring safe sandboxed execution
- Complex workflows mixing reasoning and tools
When NOT to Use
- Simple single-prompt inference
- Real-time low-latency applications (<100ms)
- Scenarios without clear tool definitions
- Extremely resource-constrained environments
Key Hyperparameters
- max_steps: 5-20 per agent task
- async_batch_size: 4-16 parallel agents
- timeout: 30-600 seconds based on task complexity
- temperature: 0.7 for reasoning, 0.0 for determinism
Performance Expectations
- Framework Overhead: <100ms per agent initialization
- Concurrent Agents: 10-100s feasible on single machine
- Tool Latency: Dominated by tool, not framework
Reference
Researchers. (2024). AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications. arXiv preprint arXiv:2508.16279.