How agentscope-ai/agentscope works
AgentScope is a Python framework for building and operating tool-using, multimodal agents, with an application layer for deploying them. The principal SDK workflow is an agent receiving messages, calling a configured model, optionally invoking tools under middleware and permission controls, then emitting replies and events. The repository also provides RAG, memory, pipelines, realtime and remote-agent support, plus application services for chat, channels, persistence, scheduling, and workspaces. Paths and edges reflect the tree, README, and sampled excerpts; unsampled wiring is not asserted.
Main entry points: _agent.py Agent Loop · _base.py LLM Models · _chat.py Chat Service · _app.py Application API
Components 24
Agent SDK
- Agent Loop
src/agentscope/agent/_agent.py - Messages
src/agentscope/message/_base.py - Event Stream
src/agentscope/event/_event.py - LLM Models
src/agentscope/model/_base.py - Provider Formatters
src/agentscope/formatter/_formatter_base.py - Tool Toolkit
src/agentscope/tool/_toolkit.py - Built-in Tools
src/agentscope/tool/_builtin/_backend.py
Agent Control
- Middleware
src/agentscope/middleware/_base.py - Permission Engine
src/agentscope/permission/_engine.py - Goal Pipeline
src/agentscope/pipeline/_goal_pipeline.py - SOP Engine
src/agentscope/sop/_engine.py
Knowledge and Media
- RAG
src/agentscope/rag/_knowledge.py - Embedding Models
src/agentscope/embedding/_embedding_base.py - Vector Stores
src/agentscope/rag/_vdb/_vector_store.py - Realtime Agents
src/agentscope/agent/_realtime/_agent.py
Application Platform
- Application API
src/agentscope/app/_app.py - Chat Service
src/agentscope/app/_service/_chat.py - Chat Channels
src/agentscope/app/channel/_base.py - Application Storage
src/agentscope/app/storage/_base.py - Scheduler
src/agentscope/app/_manager/_scheduler/_scheduler_manager.py - Workspace Managers
src/agentscope/app/workspace_manager/_base.py
Runtime Integrations
- Model Providers
Other components
- Application Developer
- End User
Connections 22
- Application Developer → Agent Loop: configures
- End User → Agent Loop: sends message
- Agent Loop → Messages: reads and emits
- Agent Loop → LLM Models: calls
- LLM Models → Provider Formatters: formats requests
- LLM Models → Model Providers: sends requests
- Agent Loop → Tool Toolkit: invokes tools
- Tool Toolkit → Built-in Tools: dispatches
- Agent Loop → Middleware: runs hooks
- Agent Loop → Permission Engine: checks access
- Agent Loop → Event Stream: streams
- Goal Pipeline → Agent Loop: runs executor
- SOP Engine → Event Stream: yields steps
- RAG → Embedding Models: creates embeddings
- RAG → Vector Stores: queries
- Realtime Agents → Event Stream: streams
- End User → Application API: uses service
- Application API → Chat Service: serves chat
- Chat Service → Application Storage: persists state
- Chat Service → Workspace Managers: obtains workspace
- Chat Channels → Application API: connects channels
- Scheduler → Application Storage: reconciles schedules