From c6f09ac1983db42a949fd4364a2f59b1a8049475 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:16:31 +0000 Subject: [PATCH 1/2] docs: update AI agent documentation from messages_context_length to memory - Replace messages_context_length with memory field that supports auto/manual modes - Document auto mode: Windmill handles memory up to N last messages - Document manual mode: user provides message history - Add OpenAI message format documentation for manual mode - Update changelog entry to reflect new memory configuration Co-authored-by: centdix --- .../2025-10-06-ai-agent-chat-mode/index.md | 2 +- docs/core_concepts/54_ai_agents/index.mdx | 25 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/changelog/2025-10-06-ai-agent-chat-mode/index.md b/changelog/2025-10-06-ai-agent-chat-mode/index.md index ce779d9bb..6ab64e00e 100644 --- a/changelog/2025-10-06-ai-agent-chat-mode/index.md +++ b/changelog/2025-10-06-ai-agent-chat-mode/index.md @@ -9,7 +9,7 @@ features: [ 'Chat mode toggle on flow inputs that transforms the flow interface into a chat UI.', 'Support for multiple different conversations within the chat interface.', - 'New messages_context_length configuration option for AI agents to remember past conversations.', + 'New memory configuration option for AI agents with auto and manual modes to manage conversation history.', 'Persistent conversation history across flow executions for continuous interactions.' ] docs: /docs/core_concepts/ai_agents diff --git a/docs/core_concepts/54_ai_agents/index.mdx b/docs/core_concepts/54_ai_agents/index.mdx index 80301099a..ec24b6a62 100644 --- a/docs/core_concepts/54_ai_agents/index.mdx +++ b/docs/core_concepts/54_ai_agents/index.mdx @@ -74,12 +74,25 @@ Specifies the type of output the AI should generate: #### output_schema (json-schema) Define a JSON schema that the AI agent will follow for its response format. This ensures structured, predictable outputs that can be easily processed by subsequent flow steps. -#### messages_context_length (number) -Specifies the number of previous messages to include as context for the AI agent. This enables the agent to maintain conversation history and remember past interactions. When set, the agent will have access to the specified number of previous messages from the conversation, allowing for more contextual and coherent responses across multiple interactions. +#### memory (auto | manual) +Manages the conversation memory for the AI agent: +- `auto`: Windmill automatically handles the memory, maintaining up to the specified number of last messages +- `manual`: User provides the message history directly in the required format -##### Using messages_context_length with webhooks +##### Message format +When using manual memory mode, each message must follow the OpenAI message format: +```json +{ + "role": "string", + "content": "string | null", // optional + "tool_calls": [/* array of tool calls */], // optional + "tool_call_id": "string | null" // optional +} +``` + +##### Using memory with webhooks -When using `messages_context_length` via webhook, you must include a `memory_id` query parameter in your request. The `memory_id` must be a 32-character UUID that uniquely identifies the conversation context. This allows the AI agent to maintain message history across webhook calls. +When using `memory` via webhook with auto mode, you must include a `memory_id` query parameter in your request. The `memory_id` must be a 32-character UUID that uniquely identifies the conversation context. This allows the AI agent to maintain message history across webhook calls. Example webhook URL: ``` @@ -176,11 +189,11 @@ To enable chat mode for a flow: - **Conversational interface**: The flow runs in a chat-like UI where users can send messages and receive responses in a familiar messaging format - **Multiple conversations**: Users can maintain multiple different conversation threads within the same flow - **Conversation history**: Each conversation maintains its own history, allowing users to scroll back through previous messages -- **Persistent context**: When using the `messages_context_length` parameter, the AI agent can remember and reference previous messages in the conversation +- **Persistent context**: When using the `memory` parameter, the AI agent can remember and reference previous messages in the conversation ### Recommended configuration -For optimal chat mode experience, we recommend placing an AI agent step at the end of your flow with both `streaming` and `messages_context_length` enabled. This configuration: +For optimal chat mode experience, we recommend placing an AI agent step at the end of your flow with both `streaming` and `memory` (set to auto mode) enabled. This configuration: - Enables real-time response streaming for a more interactive chat experience - Maintains conversation context across multiple messages From 4946b1d72dbb0452b4f7e27e9636205c5c95d5eb Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:24:17 +0000 Subject: [PATCH 2/2] fix: revert changelog and make content field required - Reverted changelog entry back to messages_context_length - Made content field required in OpenAI message format documentation Co-authored-by: centdix --- changelog/2025-10-06-ai-agent-chat-mode/index.md | 2 +- docs/core_concepts/54_ai_agents/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/2025-10-06-ai-agent-chat-mode/index.md b/changelog/2025-10-06-ai-agent-chat-mode/index.md index 6ab64e00e..ce779d9bb 100644 --- a/changelog/2025-10-06-ai-agent-chat-mode/index.md +++ b/changelog/2025-10-06-ai-agent-chat-mode/index.md @@ -9,7 +9,7 @@ features: [ 'Chat mode toggle on flow inputs that transforms the flow interface into a chat UI.', 'Support for multiple different conversations within the chat interface.', - 'New memory configuration option for AI agents with auto and manual modes to manage conversation history.', + 'New messages_context_length configuration option for AI agents to remember past conversations.', 'Persistent conversation history across flow executions for continuous interactions.' ] docs: /docs/core_concepts/ai_agents diff --git a/docs/core_concepts/54_ai_agents/index.mdx b/docs/core_concepts/54_ai_agents/index.mdx index ec24b6a62..5ee48e542 100644 --- a/docs/core_concepts/54_ai_agents/index.mdx +++ b/docs/core_concepts/54_ai_agents/index.mdx @@ -84,7 +84,7 @@ When using manual memory mode, each message must follow the OpenAI message forma ```json { "role": "string", - "content": "string | null", // optional + "content": "string | null", "tool_calls": [/* array of tool calls */], // optional "tool_call_id": "string | null" // optional }