AgentScope Runtime

repository·main·Indexed 21 days ago

https://github.com/agentscope-ai/agentscope-runtime

A production-ready runtime framework for agent applications (version 1.1.6.post2) providing secure sandboxed execution, Agent-as-a-Service (AaaS) APIs, and scalable deployment. It supports multi-framework deployment options, including local daemon services via LocalDeployManager and cloud deployment to Alibaba Cloud AgentRun using AgentApp, project directories, or Wheel files.

Tokens
135.9K
Snippets
334
Records
460
Agent score
73%

What's inside agentscope-runtime

  1. Overview of the Engine Module

    main

    The engine module is the core component of AgentScope Runtime. It provides the fundamental building blocks for managing agent applications, including execution runners, deployment strategies, service abstractions, and data schemas. It is organized into several functional submodules:

    • App & Runner: Core logic for defining and executing agent applications.
    • Deployers: Tools for deploying applications to various environments (Local, Kubernetes, ModelStudio, etc.).
    • Adapters: Protocol and response adapters to ensure compatibility between different agent communication standards.
    • Services: Core and Sandbox services for managing runtime capabilities.
    • Schemas: Data contracts for agents, sessions, embeddings, and LLM configurations.
    • Tracing: Utilities for monitoring, logging, and metrics.
  2. Overview of AgentScope Runtime Deployment Methods

    main

    AgentScope Runtime supports various deployment methods tailored to different use cases, ranging from local development to enterprise cloud orchestration:

    Deployment TypeUse CaseScalabilityManagementResource Isolation
    Local DaemonDevelopment & TestingSingle ProcessManualProcess-level
    Detached ProcessProduction ServicesSingle NodeAutomatedProcess-level
    KubernetesEnterprise & CloudSingle-node (multi-node coming)OrchestratedContainer-level
    ModelStudioAlibaba Cloud PlatformCloud-managedPlatform-managedContainer-level
    AgentRunAgentRun PlatformCloud-managedPlatform-managedContainer-level
    PAIAlibaba Cloud PAI PlatformCloud-managedPlatform-managedContainer-level
    KnativeEnterprise & CloudSingle-node (multi-node coming)OrchestratedContainer-level
    KruiseEnterprise & CloudSingle-nodeOrchestratedContainer-level / MicroVM-level
    Function Compute (FC)Alibaba Cloud ServerlessCloud-managedPlatform-managedMicroVM-level
  3. Key Features of AgentScope Runtime V1.0

    main

    AgentScope Runtime V1.0 introduces several production-ready features:

    • Unified Dev/Prod Paradigm: Consistent agent functionality across development and production environments.
    • White-box Adapter Pattern: Instead of black-box module replacement, developers use an adapter pattern to preserve native interfaces of existing frameworks while embedding runtime capabilities (state management, session history, tool registration).
    • Protocol Support: OpenAI SDK support and Google A2A protocol compatibility.
    • Visual Web UI: A ready-to-use web chat interface available immediately after deployment.
    • Expanded Sandbox Types: Support for GUI, Browser, FileSystem, Mobile, and Cloud (visualized via VNC).
    • Flexible Deployment: Local (threads/processes), Docker, Kubernetes, or cloud-hosted.
  4. Choose an AgentScope Runtime integration surface

    main

    AgentScope Runtime provides several consumption surfaces depending on your target audience and use case:

    • API Calls (REST/gRPC): Best for backend integrations, production services, or automation. Supports streaming output and tool-call callbacks.
    • Web UI: Best for operations, demos, or debugging. Provides a visual console for chat history, tool invocations, and debugging panels.
    • Tracing & Protocol: Best for developers needing observability (Jaeger, OpenTelemetry) or low-level customization of the messaging protocol.
    • DemoHouse: Best for showcasing, training, or validating deployments using runnable demo scenarios and business case runbooks.
    • A2A Registry: Best for service registration and discovery in Agent-to-Agent (A2A) architectures.
  5. Migrate to AgentScope 2.0

    main

    ⚠️ Important Migration Notice

    With the release of AgentScope 2.0, all core capabilities of AgentScope Runtime—including tool sandboxing, Agent-as-a-Service (AaaS) APIs, and full-stack observability—have been natively integrated into AgentScope 2.0.

    Action Required: It is highly recommended that all users migrate to AgentScope 2.0 to receive continuous updates, new features, and community support. This repository is being maintained in read-only mode for reference and will be archived soon.

  6. Core Capabilities of AgentScope Runtime

    main

    AgentScope Runtime provides a production-grade environment for agent applications with the following core features:

    • Tool Sandboxing: Executes tool calls inside a hardened, isolated sandbox to ensure system safety.
    • Agent-as-a-Service (AaaS) APIs: Exposes agents as streaming, production-ready APIs (e.g., via SSE).
    • Scalable Deployment: Supports local deployment, Kubernetes, or serverless environments for elastic scaling.
    • Full-stack Observability: Provides comprehensive tracking and monitoring of runtime operations, including logs and traces.
    • Framework Compatibility: Designed to be framework-agnostic, currently supporting AgentScope with planned extensions for others (e.g., LangGraph, Microsoft Agent Framework, Agno, AutoGen).
  7. What is AgentBay Sandbox

    main

    AgentBay is a GUI-based sandbox environment provided by Alibaba Cloud. It offers four types of sandbox environments: Code Space, Browser Use, Computer Use, and Mobile Use.

    In AgentScope-Runtime, AgentBay is integrated as a CloudSandbox option. Unlike traditional Docker-based sandboxes, AgentBay is a cloud-native service that does not require local container management; it is accessed directly via APIs using an api_key.

  8. What is AgentScope Runtime?

    main

    AgentScope Runtime is a full-stack runtime designed for AI agents, focusing on efficient deployment, serving, and secure sandboxed execution. It combines the following capabilities:

    • Tool Sandboxing: Secure, isolated environments for code execution, browser control, and file manipulation.
    • AaaS (Agent-as-a-Service) APIs: Standardized APIs for serving agents.
    • Scalable Deployment: Support for local threads/processes, Docker, Kubernetes, or hosted cloud.
    • Full-stack Observability: Integrated logs and traces.
    • Framework Compatibility: Support for existing agent frameworks via an adapter pattern.
  9. What is ModelStudio Memory?

    main

    ModelStudio Memory is a conversation memory tool designed for AI applications to maintain long-term context. It provides three core capabilities:

    1. Memory Storage: Automatically converts conversation history into structured memory nodes with semantic search support.
    2. Smart Retrieval: Performs context-aware semantic searches to find relevant historical conversations.
    3. Profile Extraction: Automatically identifies and extracts user attributes (e.g., age, interests, occupation) from conversations to build user profiles.

    This allows for personalized interactions where the system can recall user preferences or facts from previous sessions.

  10. What is the AgentScope Runtime Sandbox?

    main

    The AgentScope Runtime Sandbox provides a secure and isolated environment for executing agent operations. It is designed to handle tasks such as tool execution, browser automation, and file system operations without compromising the host system.

    It supports multiple backend isolation/runtime options:

    • Local usage: Docker (optionally with gVisor) or BoxLite.
    • Remote/Production usage: Kubernetes (K8s), Function Compute (FC), or Alibaba Cloud ACK.

    You can switch the backend by setting the CONTAINER_DEPLOYMENT environment variable (defaults to docker).

  11. What is AgentApp and how is it used

    main

    The AgentApp is the core application entry point within AgentScope Runtime. It inherits from FastAPI to deploy and expose Agents as externally accessible API services.

    Key Responsibilities:

    • Initializing and binding the Agent and Runner.
    • Providing standardized HTTP API endpoints (including health checks).
    • Supporting Server-Sent Events (SSE) and standard JSON responses.
    • Allowing registration of task queues (e.g., Celery) and custom routes.
    • Managing the application lifecycle via lifespan management and before_start / after_finish hooks.
    • Deploying services via the .deploy() method.