Skip to main content
An agent is assembled entirely at initialization: pass the model, toolkit, and config objects to Agent(...) and it is ready to reply. The examples below cover the most common setups.

Parameters

All configuration enters through the Agent(...) constructor. The table below lists every parameter, with the tunable knobs grouped into config objects:

Switch Models

Switching the LLM provider only changes the model argument: every provider follows the same Model(credential=..., model=...) pattern, and the rest of the agent stays untouched.

Support Multi-Entity Conversations

An agent is not limited to one-user-one-agent chat. In an agent team, a group chat, or a game with NPCs, messages from multiple named entities share the same context, and the agent must know who said what. In AgentScope, each speaker is identified by the name field of its Msg. A multi-entity conversation is simply a list of messages with different names fed into the agent:
Whether these identities survive is decided by the formatter, the component that converts Msg objects into the provider’s API format before each model call. The default chat formatter maps messages onto the API’s bare user/assistant roles, which fits one-user-one-agent chat but drops the names, leaving the speakers indistinguishable. For multi-entity conversations, each provider ships a MultiAgentFormatter. It merges the history into a single named transcript (Alice: ..., Bob: ...) carried in a user message, so the LLM sees each speaker’s identity. Switch by passing it to the model:
In multi-entity conversations, state the agent’s own name in its system prompt, so the LLM knows which speaker it is playing.
Each provider has a matching pair:

Next Steps

Tool

How to build tools, and connect MCP servers and skills.

Middleware

How to hook into reply, reasoning, acting, and model calls.

Workspace

How to work in different sandboxes.

Permission System

How to control which tool calls run, ask, or are denied.