docs: rename tutorials to sample-flows (#7307)

* builds-and-serves-no-errors

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* update-links

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
This commit is contained in:
Mendon Kissling 2025-04-01 10:04:20 -04:00 • committed by GitHub
commit a04b0b19b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 123 additions and 106 deletions

View file

@ -54,7 +54,7 @@ Point **API Request** to an online rules document, tell your agent `You are a fu
* You need to learn a new software language quickly.
Point **API Request** to some docs, tell your agent `You are a knowledgeable software developer who uses the tools at your disposal`, and start learning.
See what problems you can solve with this flow. As your problem becomes more specialized, add a tool. For example, the [math agent tutorial project](/tutorials-math-agent) adds a Python REPL component to solve math problems that are too challenging for the calculator.
See what problems you can solve with this flow. As your problem becomes more specialized, add a tool. For example, the [math agent project](/math-agent) adds a Python REPL component to solve math problems that are too challenging for the calculator.
### Edit a tool's metadata

View file

@ -30,7 +30,7 @@ Answer the question
{user_question}
```
When variables are added to a prompt template, new fields are automatically created in the component. These fields can be connected to receive text input from other components to automate prompting, or to output instructions to other components. An example of prompts controlling agents behavior is available in the [sequential tasks agent starter flow](/tutorials-sequential-agent).
When variables are added to a prompt template, new fields are automatically created in the component. These fields can be connected to receive text input from other components to automate prompting, or to output instructions to other components. An example of prompts controlling agents behavior is available in the [sequential tasks agent starter flow](/sequential-agent).
### Inputs

View file

@ -29,7 +29,7 @@ To use your uploaded files in flows:
2. To select a document to load, in the **File** component, click the **Select files** button.
3. Select a file to upload, and then click **Select file**. The loaded file name appears in the component.
For an example of using the **File** component in a flow, see the [Document QA tutorial project](/tutorials-document-qa).
For an example of using the **File** component in a flow, see the [Document QA tutorial project](/document-qa).
:::note
If you prefer a one-time upload, the [File](/components-data#file) component still allows one-time uploads directly from your local machine.

View file

@ -41,7 +41,7 @@ To store messages in local Langflow memory, add a [Message store](/components-he
To retrieve messages from local Langflow memory, add a [Message history](/components-helpers#message-history) component to your flow.
For an example of using local chat memory, see the [Memory chatbot](/tutorials-memory-chatbot) starter flow.
For an example of using local chat memory, see the [Memory chatbot](/memory-chatbot) starter flow.
To store or retrieve chat messages from external memory, connect the **External memory** port of the **Message store** or **Message history** component to a **Memory** component, like the [Astra DB chat memory](components-memories#astradbchatmemory-component) component. An example flow looks like this:

View file

@ -19,9 +19,9 @@ Langflow is an intuitive visual flow builder. This drag-and-drop interface allow
Langflow can be used for a wide range of AI applications, including:
* [Craft intelligent chatbots](/tutorials-memory-chatbot)
* [Build document analysis systems](/tutorials-document-qa)
* [Generate compelling content](/tutorials-blog-writer)
* [Craft intelligent chatbots](/memory-chatbot)
* [Build document analysis systems](/document-qa)
* [Generate compelling content](/blog-writer)
* [Orchestrate multi-agent applications](/starter-projects-simple-agent)
## Community and support

View file

@ -110,7 +110,7 @@ MCP clients like Claude for Desktop and Cursor "see" Langflow as a single MCP se
This can confuse agents, who don't know that flow `adbbf8c7-0a34-493b-90ea-5e8b42f78b66` is a Document Q&A flow for a specific text file.
To prevent this behavior, name and describe your flows clearly for agentic use. Imagine your names and descriptions as function names and code comments, with a clear statement of what problem they solve.
For example, you have created a [Document Q&A](/tutorials-document-qa) flow that loads a sample resume for an LLM to chat with, and you want Cursor to use the tool.
For example, you have created a [Document Q&A](/document-qa) flow that loads a sample resume for an LLM to chat with, and you want Cursor to use the tool.
1. Click **Flow name**, and then select **Edit Details**.
2. The **Name** field should make it clear what the flow does, both to a user and to the agent. For example, name it `Document QA for Resume`.

View file

@ -0,0 +1,55 @@
---
title: Blog writer
slug: /blog-writer
---
Build a Blog Writer flow for a one-shot application using OpenAI.
This flow extends the Basic Prompting flow with the **URL** and **Parse data** components that fetch content from multiple URLs and convert the loaded data into plain text.
OpenAI uses this loaded data to generate a blog post, as instructed by the **Text input** component.
## Prerequisites
- [Langflow installed and running](/get-started-installation)
- [OpenAI API key created](https://platform.openai.com/)
## Create the blog writer flow
1. From the Langflow dashboard, click **New Flow**.
2. Select **Blog Writer**.
3. The **Blog Writer** flow is created.
![](/img/starter-flow-blog-writer.png)
This flow creates a one-shot article generator with **Prompt**, **OpenAI**, and **Chat Output** components, augmented with reference content and instructions from the **URL** and **Text Input** components.
The **URL** component extracts raw text and metadata from one or more web links.
The **Parse Data** component converts the data coming from the **URL** component into plain text to feed the prompt.
To examine the flow's prompt, click the **Template** field of the **Prompt** component.
```plain
Reference 1:
{references}
---
{instructions}
Blog:
```
The `{instructions}` value is received from the **Text input** component, and one or more `{references}` are received from a list of URLs parsed from the **URL** component.
### Run the blog writer flow
1. Click the **Playground** button, and then click **Run Flow**.
A blog post about Langflow is generated, with content sourced from `langflow.org` and `docs.langflow.org`.
2. To write about something different, change the values in the **URL** component and adjust the instructions on the left side bar of the **Playground**. Try again and see what the LLM constructs.

View file

@ -1,6 +1,6 @@
---
title: Document QA
slug: /tutorials-document-qa
slug: /document-qa
---
Build a question-and-answer chatbot with a document loaded from local memory.

View file

@ -1,6 +1,6 @@
---
title: Math agent
slug: /tutorials-math-agent
slug: /math-agent
---
import Icon from "@site/src/components/icon";

View file

@ -1,11 +1,11 @@
---
title: Memory chatbot
slug: /tutorials-memory-chatbot
slug: /memory-chatbot
---
import Icon from "@site/src/components/icon";
This flow extends the [basic prompting flow](/starter-projects-basic-prompting) with a **Chat memory** component that stores up to 100 previous chat messages and uses them to provide context for the current conversation.
This flow extends the [basic prompting flow](/starter-projects-basic-prompting) with a **Chat memory** component that stores up to 100 previous chat messages and uses them to provide context for the current conversation.
## Prerequisites
@ -14,14 +14,14 @@ This flow extends the [basic prompting flow](/starter-projects-basic-prompting)
## Create the memory chatbot flow
1. From the Langflow dashboard, click **New Flow**.
2. Select **Memory Chatbot**.
3. The **Memory Chatbot** flow is created.
1. From the Langflow dashboard, click **New Flow**.
2. Select **Memory Chatbot**.
3. The **Memory Chatbot** flow is created.
![](/img/starter-flow-memory-chatbot.png)
This flow adds a **Chat Memory** component to the Basic Prompting flow.
This component retrieves previous messages and sends them to the **Prompt** component to fill a part of the **Template** with context.
This flow adds a **Chat Memory** component to the Basic Prompting flow.
This component retrieves previous messages and sends them to the **Prompt** component to fill a part of the **Template** with context.
To examine the template, click the **Template** field in the **Prompt** component.
The **Prompt** tells the **OpenAI model** component how to respond to input.
@ -39,7 +39,7 @@ History:
The `{memory}` code in the prompt creates a new input port in the component called **memory**.
The **Chat Memory** component is connected to this port to store chat messages from the **Playground**.
This gives the **OpenAI** component a memory of previous chat messages.
This gives the **OpenAI** component a memory of previous chat messages.
## Run the memory chatbot flow
@ -55,19 +55,19 @@ What is the second subject I asked you about?
The chatbot remembers your name and previous questions.
3. To view the **Message Logs** pane, click <Icon name="Ellipsis" aria-label="Horizontal ellipsis" />, and then click **Message Logs**.
3. To view the **Message Logs** pane, click <Icon name="Ellipsis" aria-label="Horizontal ellipsis" />, and then click **Message Logs**.
The **Message Logs** pane displays all previous messages, with each conversation sorted by `session_id`.
![](/img/messages-logs.png)
## Use Session ID with the memory chatbot flow
`session_id` is a unique identifier in Langflow that stores conversation sessions between the AI and a user. A `session_id` is created when a conversation is initiated, and then associated with all subsequent messages during that session.
`session_id` is a unique identifier in Langflow that stores conversation sessions between the AI and a user. A `session_id` is created when a conversation is initiated, and then associated with all subsequent messages during that session.
In the **Memory Chatbot** flow you created, the **Chat Memory** component references past interactions by **Session ID**. You can demonstrate this by modifying the **Session ID** value to switch between conversation histories.
In the **Memory Chatbot** flow you created, the **Chat Memory** component references past interactions by **Session ID**. You can demonstrate this by modifying the **Session ID** value to switch between conversation histories.
1. In the **Session ID** field of the **Chat Memory** and **Chat Input** components, add a **Session ID** value like `MySessionID`.
2. Now, once you send a new message the **Playground**, you should have a new memory created in the **Message Logs** pane.
1. In the **Session ID** field of the **Chat Memory** and **Chat Input** components, add a **Session ID** value like `MySessionID`.
2. Now, once you send a new message the **Playground**, you should have a new memory created in the **Message Logs** pane.
3. Notice how your conversation is being stored in different memory sessions.
Learn more about chat memories in the [Memory](/components-memories) section.

View file

@ -1,6 +1,6 @@
---
title: Sequential tasks agent
slug: /tutorials-sequential-agent
slug: /sequential-agent
---
Build a **Sequential Tasks Agent** flow for a multi-agent application using multiple **Agent** components.

View file

@ -1,6 +1,6 @@
---
title: Travel planning agent
slug: /tutorials-travel-planning-agent
slug: /travel-planning-agent
---
Build a **Travel Planning Agent** flow for an agentic application using the multiple Tool-calling agents.

View file

@ -1,58 +0,0 @@
---
title: Blog writer
slug: /tutorials-blog-writer
---
Build a Blog Writer flow for a one-shot application using OpenAI.
This flow extends the Basic Prompting flow with the **URL** and **Parse data** components that fetch content from multiple URLs and convert the loaded data into plain text.
OpenAI uses this loaded data to generate a blog post, as instructed by the **Text input** component.
## Prerequisites {#899268e6c12c49b59215373a38287507}
---
- [Langflow installed and running](/get-started-installation)
- [OpenAI API key created](https://platform.openai.com/)
## Create the blog writer flow {#0c1a9c65b7d640f693ec3aad963416ff}
1. From the Langflow dashboard, click **New Flow**.
2. Select **Blog Writer**.
3. The **Blog Writer** flow is created.
![](/img/starter-flow-blog-writer.png)
This flow creates a one-shot article generator with **Prompt**, **OpenAI**, and **Chat Output** components, augmented with reference content and instructions from the **URL** and **Text Input** components.
The **URL** component extracts raw text and metadata from one or more web links.
The **Parse Data** component converts the data coming from the **URL** component into plain text to feed the prompt.
To examine the flow's prompt, click the **Template** field of the **Prompt** component.
```plain
Reference 1:
{references}
---
{instructions}
Blog:
```
The `{instructions}` value is received from the **Text input** component, and one or more `{references}` are received from a list of URLs parsed from the **URL** component.
### Run the blog writer flow {#b93be7a567f5400293693b31b8d0f81a}
1. Click the **Playground** button. Here you can chat with the AI that has access to the **URL** content.
2. Click the **Lighting Bolt** icon to run it.
3. To write about something different, change the values in the **URL** component and adjust the instructions on the left side bar of the **Playground**. Try again and see what the LLM constructs.

View file

@ -114,13 +114,6 @@ const config = {
to: "/get-started-quickstart",
from: "/getting-started-quickstart",
},
{
to: "/tutorials-travel-planning-agent",
from: [
"/starter-projects-dynamic-agent/",
"/starter-projects-travel-planning-agent",
],
},
{
to: "concepts-overview",
from: [
@ -137,7 +130,7 @@ const config = {
"/components",
"/components-overview"
],
},
},
{
to: "/configuration-global-variables",
from: "/settings-global-variables",
@ -158,20 +151,47 @@ const config = {
]
},
{
to: "/tutorials-sequential-agent",
from: "/starter-projects-sequential-agent",
to: "/blog-writer",
from: [
"/starter-projects-blog-writer",
"/tutorials-blog-writer"
],
},
{
to: "/tutorials-blog-writer",
from: "/starter-projects-blog-writer",
to: "/memory-chatbot",
from: [
"/starter-projects-memory-chatbot",
"/tutorials-memory-chatbot"
],
},
{
to: "/tutorials-memory-chatbot",
from: "/starter-projects-memory-chatbot",
to: "/document-qa",
from: [
"/starter-projects-document-qa",
"/tutorials-document-qa"
],
},
{
to: "/tutorials-document-qa",
from: "/starter-projects-document-qa",
to: "/math-agent",
from: [
"/starter-projects-math-agent",
"/tutorials-math-agent"
],
},
{
to: "/sequential-agent",
from: [
"/starter-projects-sequential-agent",
"/tutorials-sequential-agent"
],
},
{
to: "/travel-planning-agent",
from: [
"/starter-projects-travel-planning-agent",
"/tutorials-travel-planning-agent",
"/starter-projects-dynamic-agent/",
],
},
{
to: "/components-vector-stores",

View file

@ -20,14 +20,14 @@ module.exports = {
},
{
type: "category",
label: "Tutorials",
label: "Sample flows",
items: [
'Tutorials/tutorials-blog-writer',
'Tutorials/tutorials-document-qa',
'Tutorials/tutorials-memory-chatbot',
'Tutorials/tutorials-math-agent',
'Tutorials/tutorials-sequential-agent',
'Tutorials/tutorials-travel-planning-agent',
'Sample-Flows/blog-writer',
'Sample-Flows/document-qa',
'Sample-Flows/memory-chatbot',
'Sample-Flows/math-agent',
'Sample-Flows/sequential-agent',
'Sample-Flows/travel-planning-agent',
],
},
{