- New Agent is a separate app type from the Agent app (
agent-chat) covered on Chatbot and Agent. - The New Agent is in beta, available in Dify 1.16.0-rc1.
agent mode: you send a message, stream the reply as it generates, and keep multi-turn context in conversations.
The model reasons and calls tools autonomously, and the stream shows that work: the reply text streams incrementally as agent_message events, with agent_thought events carrying each reasoning step and tool call alongside.
The turn closes with a single message event carrying the complete answer, then message_end. Render the agent_message deltas live and treat the closing message as the final answer rather than appending it.
Each agent_thought event carries the step’s thought, the tool it called with its tool_input, and the tool’s observation. The full stream shape is on Send Chat Message.
Authentication, the base URL, and the
user field that scopes end-user data are covered in Get Started and End User Identity.Send Messages and Stream Replies
-
Send Chat Message: send a query to your New Agent app. Streaming mode only; blocking mode returns a 400
bad_requesterror. The closingmessage_endevent reports token usage; it never includes knowledge-retrieval citations (retriever_resources). - Stop Chat Message Generation: interrupt a streaming reply before it finishes.
Manage Conversations
- List Conversations: the current user’s conversations, ordered by most recent activity.
- List Conversation Messages: one conversation’s message history, for a scrolling chat UI. Each message’s
agent_thoughtsarray carries the reasoning steps for that turn.
Upload Files
- Upload File: upload an image, document, audio, or video file, scoped to the uploading end user. Files passed to Send Chat Message are surfaced to the agent as downloadable references it can fetch and inspect in its sandbox.
Retrieve App Info and Settings
- Get App Info: the app’s name, description, tags, and mode.
- Get App Parameters: the fields your calls send in
inputs(names, types, defaults) plus the app’s feature switches—the basis for building requests or a client UI. - Get App Meta: app metadata; the
tool_iconsmap is empty for New Agent apps.