mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 22:15:24 +08:00
docs: agent improvements (#13269)
* docs: add structured output for agents * docs: add structured output note * docs: clarify both agent outputs and add release notes * docs: when langflow sends events to the playground and chat history
This commit is contained in:
@ -130,6 +130,10 @@ By default, the **Agent** component uses your Langflow installation's storage, a
|
||||
The **Message History** component isn't required for default chat memory, but it is required if you want to use external chat memory like Mem0.
|
||||
Additionally, the **Message History** component provides more options for sorting, filtering, and limiting memories. Although, most of these options are built-in to the **Agent** component with default values.
|
||||
|
||||
Langflow sends events to the Playground during each agent run: the input message, each tool call with its input and result, streaming tokens as they arrive, and the final answer.
|
||||
Langflow writes the completed message to chat history when the run finishes.
|
||||
When using the **Structured Response** output, Langflow does not send events to the Playground and does not write to chat history.
|
||||
|
||||
For more information, see [Store chat memory](/memory#store-chat-memory) and [**Message History** component](/message-history).
|
||||
|
||||
### Additional parameters
|
||||
@ -145,10 +149,23 @@ For example:
|
||||
|
||||
## Agent component output
|
||||
|
||||
The **Agent** component outputs a **Response** (`response`) that is [`Message` data](/data-types#message) containing the agent's raw response to the query.
|
||||
The **Agent** component has two outputs:
|
||||
|
||||
Typically, this is passed to a **Chat Output** component to return the response in a human-readable format.
|
||||
It can also be passed to other components if you need to process the response further before, or in addition to, returning it to the user.
|
||||
* **Response** (`response`): The agent's reply as [`Message`](/data-types#message) data, which is typically connected to a **Chat Output** component.
|
||||
* **Structured Response** (`structured_response`): The agent's reply formatted as structured [`Data`](/data-types#data) according to the **Output Schema** you define.
|
||||
|
||||
To configure the agent's **Structured Response** output:
|
||||
|
||||
1. In the **Agent** component, click the output label near the component's output port and select **Structured Response**.
|
||||
2. Select the **Agent** component to open the [component inspection panel](/concepts-components#component-inspection-panel), and then click <Icon name="Table" aria-hidden="true"/> **Open table**.
|
||||
3. Click <Icon name="Plus" aria-hidden="true"/> **+** to add a row for each field you want to extract. For each row, enter a **Name**, **Type**, and optionally a **Description** and **As List** toggle.
|
||||
4. Connect the **Structured Response** port to a downstream component that accepts [`Data`](/data-types#data) input, such as a **Parser** or **JSON Operations** component.
|
||||
|
||||
The **Agent** component uses the connected LLM to extract structured data, and the extraction behavior is configured in the **Output Format Instructions** field.
|
||||
Modify the prompt in the **Output Format Instructions** field to change extraction behavior.
|
||||
This does not modify the schema defined in **Output Schema**.
|
||||
|
||||
Both outputs can be connected at the same time, but each output produces a separate LLM call. If you only need structured data, connect **Structured Response** only.
|
||||
|
||||
## See also
|
||||
|
||||
|
||||
@ -14,6 +14,11 @@ For example, you can extract specific details from documents, like email message
|
||||
|
||||
## Use the Structured Output component in a flow
|
||||
|
||||
:::tip
|
||||
If you're building an agentic flow, the **Agent** component includes a built-in **Structured Response** output that produces structured `Data` without a separate **Structured Output** component.
|
||||
For more information, see [Agent component output](/agents#agent-component-output).
|
||||
:::
|
||||
|
||||
To use the **Structured Output** component in a flow, do the following:
|
||||
|
||||
1. Provide an **Input Message**, which is the source material from which you want to extract structured data.
|
||||
|
||||
@ -69,6 +69,19 @@ For all changes, see the [Changelog](https://github.com/langflow-ai/langflow/rel
|
||||
|
||||
### New features and enhancements
|
||||
|
||||
- **Agent** component: structured response output
|
||||
|
||||
The **Agent** component now includes a **Structured Response** (`structured_response`) output that returns the agent's reply as structured data according to an **Output Schema** you define.
|
||||
|
||||
For more information, see [Agent component output](/agents#agent-component-output).
|
||||
|
||||
- **Agent** component: default system prompt
|
||||
|
||||
The **Agent** component now uses a structured default system prompt that includes the current date and the active model name.
|
||||
Existing flows are not affected.
|
||||
|
||||
For more information, see [Agent instructions and input](/agents#agent-instructions-and-input).
|
||||
|
||||
- Extension bundles
|
||||
|
||||
Langflow 1.10 introduces Extension bundles: component providers that are packaged and versioned as standalone pip packages, independent of the core Langflow server.
|
||||
|
||||
Reference in New Issue
Block a user