docs: Remove template pages because templates already include explanatory notes within Langflow (#9235)
* finish template description * remove travel planning and simple agent pages * remove sequential agent and memory chatbot * remove 2 template, finish redirects, sidebar * remove vector store rag page * remove basic prompting page * add bold to template name * fix link
This commit is contained in:
parent
7123c507a7
commit
aa70a15654
39 changed files with 134 additions and 667 deletions
|
|
@ -85,7 +85,7 @@ To change this limit, set the `LANGFLOW_MAX_FILE_SIZE_UPLOAD` [environment varia
|
|||
|
||||
2. Use the returned `file_path` to send the image file to other components that can accept file input. Where you specify the file path depends on the component type.
|
||||
|
||||
The following example runs a [Basic Prompting flow](/basic-prompting), passing the image file and the query `describe this image` as input for the **Chat Input** component.
|
||||
The following example runs the **Basic Prompting** template flow, passing the image file and the query `describe this image` as input for the **Chat Input** component.
|
||||
In this case, the file path is specified in `tweaks`.
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ For more information, see [Generate API code snippets](/concepts-publish#generat
|
|||
Execute a specified flow by ID or name.
|
||||
Flow IDs can be found on the code snippets on the [**API access** pane](/concepts-publish#api-access) or in a flow's URL.
|
||||
|
||||
The following example runs a [Basic Prompting](/basic-prompting) flow with flow parameters passed in the request body.
|
||||
The following example runs the **Basic Prompting** template flow with flow parameters passed in the request body.
|
||||
This flow requires a chat input string (`input_value`), and uses default values for all other parameters.
|
||||
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -25,24 +25,26 @@ Tool names and descriptions can be edited, but the default tool identifiers cann
|
|||
|
||||
## Use an agent as a tool
|
||||
|
||||
The agent component itself also supports **Tool Mode** for creating multi-agent flows.
|
||||
To create multi-agent flows, you can set another **Agent** component to **Tool Mode**, and then attach that agent as a tool for your primary **Agent** component.
|
||||
|
||||
Add an agent to your flow that uses a different OpenAI model for a larger context window.
|
||||
To try this for yourself, add an additional agent to the **Simple Agent** template:
|
||||
|
||||
1. Create the [Simple agent starter flow](/simple-agent).
|
||||
2. Add a second agent component to the flow.
|
||||
3. Add your **OpenAI API Key** to the **Agent** component.
|
||||
4. In the **Model Name** field, select `gpt-4.1`.
|
||||
5. Click **Tool Mode** to use this new agent as a tool.
|
||||
6. Connect the new agent's **Toolset** port to the previously created agent's **Tools** port.
|
||||
The new agent will use `gpt-4.1` for the larger tasks of scraping and searching information that require large context windows.
|
||||
The previously created agent will now use this agent as a tool, with its unique LLM and toolset.
|
||||
1. Create a flow based on the **Simple Agent** template.
|
||||
2. Add a second **Agent** component to the flow.
|
||||
3. Add your **OpenAI API Key** to both **Agent** components.
|
||||
4. In the second **Agent** component, change the model to `gpt-4.1`, and then enable **Tool Mode**.
|
||||
5. Click <Icon name="SlidersHorizontal" aria-hidden="true"/> **Edit Tools** to set tool names and descriptions that help the primary agent understand how to use those tools.
|
||||
|
||||

|
||||
For this example, change the tool name to `Agent-gpt-41` and set the description to `Use the gpt-4.1 model for complex problem solving`.
|
||||
This lets the primary agent know that this tool uses the `gpt-4.1` model, which could be helpful for tasks requiring a larger context window, such as large scrape and search tasks.
|
||||
|
||||
7. The new agent's actions can be edited to help the agent understand how to use it.
|
||||
Click <Icon name="SlidersHorizontal" aria-hidden="true"/> **Edit Tools** to modify its `name`, `description`, or `enabled` metadata.
|
||||
For example, the default tool name is `Agent`. Edit the name to `Agent-gpt-41`, and edit the description to `Use the gpt-4.1 model for complex problem solving`. The connected agent will understand that this is the `gpt-4.1` agent, and will use it for tasks requiring a larger context window.
|
||||
As another example, you could attach several specialized models to a primary agent, such as agents that are trained on certain tasks or domains, and then the primary agent would call each specialized agent as needed to respond to queries.
|
||||
|
||||
You can also enable and disable tools if you want to limit the available toolset.
|
||||
|
||||
6. Connect the new agent's **Toolset** port to the existing agent's **Tools** port.
|
||||
|
||||

|
||||
|
||||
## Add custom components as tools {#components-as-tools}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ This component provides everything you need to create an agent, including multip
|
|||
It simplifies agent configuration so you can focus on application development.
|
||||
|
||||
<details>
|
||||
<summary>How agents work</summary>
|
||||
<summary>How do agents work?</summary>
|
||||
|
||||
Agents extend LLMs by integrating _tools_, which are functions that provide additional context and enable autonomous task execution.
|
||||
These integrations make agents more specialized and powerful than standalone LLMs.
|
||||
|
|
@ -31,7 +31,7 @@ The `Tool` object's description tells the agent what the tool can do so that it
|
|||
## Use the Agent component in a flow
|
||||
|
||||
The following steps explain how to create an agentic flow in Langflow from a blank flow.
|
||||
For a prebuilt example, use the [**Simple Agent** template](/simple-agent) or try the [Langflow quickstart](/get-started-quickstart).
|
||||
For a prebuilt example, use the **Simple Agent** template or try the [Langflow quickstart](/get-started-quickstart).
|
||||
|
||||
1. Click **New Flow**, and then click **Blank Flow**.
|
||||
2. Add an **Agent** component to the **Workspace**.
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ To connect the local Hugging Face model to the **Hugging Face Embeddings Inferen
|
|||
|
||||
1. Run a [local Hugging Face embeddings inference](https://huggingface.co/docs/text-embeddings-inference/local_cpu).
|
||||
|
||||
2. For this example, create a flow from the [**Vector Store RAG** template](/vector-store-rag).
|
||||
2. For this example, create a flow from the **Vector Store RAG** template.
|
||||
|
||||
3. Replace the two **OpenAI Embeddings** components with **Hugging Face Embeddings Inference** components.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Langflow's **Agent** and **MCP Tools** components are critical for building agen
|
|||
These components define the behavior and capabilities of AI agents in your flows.
|
||||
|
||||
<details>
|
||||
<summary>How agents work</summary>
|
||||
<summary>How do agents work?</summary>
|
||||
|
||||
Agents extend Large Language Models (LLMs) by integrating _tools_, which are functions that provide additional context and enable autonomous task execution.
|
||||
These integrations make agents more specialized and powerful than standalone LLMs.
|
||||
|
|
@ -29,10 +29,10 @@ The `Tool` object's description tells the agent what the tool can do so that it
|
|||
|
||||
For examples of agentic flows using the **Agent** and **MCP Tools** components, see the following:
|
||||
|
||||
* [**Simple Agent** template](/simple-agent): Create a basic agentic flow in Langflow with an **Agent** component that can use two other Langflow components as tools.
|
||||
The LLM specified in the **Agent** component's settings can use its own built-in functionality as well as the functionality provided by the connected tools when generating responses.
|
||||
* [Langflow quickstart](/get-started-quickstart): Start with the **Simple Agent** template, modify its tools, and then learn how to use an agentic flow in an application.
|
||||
|
||||
* [Langflow quickstart](/get-started-quickstart): Modify the **Simple Agent** template to use different tools, and then learn how to use an agentic flow in an application.
|
||||
The **Simple Agent** template creates a basic agentic flow with an **Agent** component that can use two other Langflow components as tools.
|
||||
The LLM specified in the **Agent** component's settings can use its own built-in functionality as well as the functionality provided by the connected tools when generating responses.
|
||||
|
||||
* [Use an agent as a tool](/agents-tools#use-an-agent-as-a-tool): Create a multi-agent flow.
|
||||
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ For production use, consider using another search component with more robust API
|
|||
|
||||
The following steps demonstrate one way that you can use a **Web Search** component in a flow:
|
||||
|
||||
1. Create a flow based on the [**Basic Prompting** template](/basic-prompting).
|
||||
1. Create a flow based on the **Basic Prompting** template.
|
||||
|
||||
2. Add a **Web Search** component, and then enter a search query, such as `environmental news`.
|
||||
|
||||
|
|
|
|||
|
|
@ -74,9 +74,21 @@ The following steps explain how to create a chat-based flow that uses **Message
|
|||
3. Add a [**Prompt Template** component](/components-prompts), add a `{memory}` variable to the **Template** field, and then connect the **Message History** output to the **memory** input.
|
||||
|
||||
The **Prompt Template** component supplies instructions and context to LLMs, separate from chat messages passed through a **Chat Input** component.
|
||||
Variables in a **Prompt Template** component dynamically add fields to the **Prompt Template** component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input.
|
||||
The template can include any text and variables that you want to supply to the LLM, for example:
|
||||
|
||||
In this case, the `{memory}` variable is populated by the retrieved chat memories, which are then passed to a **Language Model** or **Agent** component to provide additional context to the LLM.
|
||||
```text
|
||||
You are a helpful assistant that answers questions.
|
||||
|
||||
Use markdown to format your answer, properly embedding images and urls.
|
||||
|
||||
History:
|
||||
|
||||
{memory}
|
||||
```
|
||||
|
||||
Variables (`{variable}`) in the template dynamically add fields to the **Prompt Template** component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input.
|
||||
|
||||
In this example, the `{memory}` variable is populated by the retrieved chat memories, which are then passed to a **Language Model** or **Agent** component to provide additional context to the LLM.
|
||||
|
||||
4. Connect the **Prompt Template** component's output to a **Language Model** component's **System Message** input.
|
||||
|
||||
|
|
@ -119,9 +131,21 @@ The following steps explain how to create a flow that stores and retrieves chat
|
|||
3. Add a [**Prompt Template** component](/components-prompts), add a `{memory}` variable to the **Template** field, and then connect the **Message History** output to the **memory** input.
|
||||
|
||||
The **Prompt Template** component supplies instructions and context to LLMs, separate from chat messages passed through a **Chat Input** component.
|
||||
Variables in a **Prompt Template** component dynamically add fields to the **Prompt Template** component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input.
|
||||
The template can include any text and variables that you want to supply to the LLM, for example:
|
||||
|
||||
In this case, the `{memory}` variable is populated by the retrieved chat memories, which are then passed to a **Language Model** or **Agent** component to provide additional context to the LLM.
|
||||
```text
|
||||
You are a helpful assistant that answers questions.
|
||||
|
||||
Use markdown to format your answer, properly embedding images and urls.
|
||||
|
||||
History:
|
||||
|
||||
{memory}
|
||||
```
|
||||
|
||||
Variables (`{variable}`) in the template dynamically add fields to the **Prompt Template** component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input.
|
||||
|
||||
In this example, the `{memory}` variable is populated by the retrieved chat memories, which are then passed to a **Language Model** or **Agent** component to provide additional context to the LLM.
|
||||
|
||||
4. Connect the **Prompt Template** component's output to a **Language Model** component's **System Message** input.
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ For example, the following flow connects **Chat Input** and **Chat Output** to a
|
|||
For detailed examples of **Chat Input/Output** components in flows, see the following:
|
||||
|
||||
* [Langflow quickstart](/get-started-quickstart): Create and run a basic agent flow.
|
||||
* [**Basic prompting** template](/basic-prompting): Create an LLM-based chat flow that accepts chat input as well as a prompt with additional instructions for the LLM. Many other Langflow templates also use **Chat Input/Output** components.
|
||||
* **Basic Prompting** template: Create an LLM-based chat flow that accepts chat input as well as a prompt with additional instructions for the LLM. Many other Langflow templates also use **Chat Input/Output** components.
|
||||
* [Connect applications to agents](/agent-tutorial): Explore more advanced concepts around agentic flows and prompting, including triggering agent flows from external applications.
|
||||
:::
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ These components accept inputs like chat messages, files, and instructions in or
|
|||
The flow must include [**Chat Input/Output** component](/components-io#chat-io) to allow chat-based interactions with the LLM.
|
||||
However, you can also use the **Language Model** component for actions that don't emit chat output directly, such as the **Smart Function** component.
|
||||
|
||||
The following example uses the core **Language Model** component and a built-in LLM to create a chatbot flow similar to the [**Basic Prompting** template](/basic-prompting).
|
||||
The following example uses the core **Language Model** component and a built-in LLM to create a chatbot flow similar to the **Basic Prompting** template.
|
||||
The example focuses on using the built-in models, but it also indicates where you can integrate another model.
|
||||
|
||||
1. Add the **Language Model** component to your flow.
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ Keys are columns, and each dictionary (a collection of key-value pairs) in the l
|
|||
|
||||
To use this component in a flow, do the following:
|
||||
|
||||
1. Add the **Web search** component to the [Basic prompting](/basic-prompting) flow. In the **Search Query** field, enter a query, such as `environmental news`.
|
||||
1. Add the **Web search** component to the **Basic Prompting** template. In the **Search Query** field, enter a query, such as `environmental news`.
|
||||
2. Connect the **Web search** component's output to a component that accepts the DataFrame input.
|
||||
This example uses a **Prompt** component to give the chatbot context, so you must convert the **Web search** component's DataFrame output to a Message type.
|
||||
3. Connect a **Type Convert** component to convert the DataFrame to a Message.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ For example, with the [**Message History**](/components-helpers#message-history)
|
|||
|
||||
The following steps demonstrate how to add variables to a **Prompt Template** component:
|
||||
|
||||
1. Create a flow based on the [**Basic prompting** template](/basic-prompting).
|
||||
1. Create a flow based on the **Basic prompting** template.
|
||||
|
||||
This template already has a **Prompt Template** component, but the template only contains natural language instructions: `Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.`
|
||||
|
||||
|
|
@ -42,9 +42,12 @@ The following steps demonstrate how to add variables to a **Prompt Template** co
|
|||
For example, the following template creates `context` and `user_question` variables:
|
||||
|
||||
```text
|
||||
Given the context
|
||||
Given the context:
|
||||
|
||||
{context}
|
||||
Answer the question
|
||||
|
||||
Answer the question:
|
||||
|
||||
{user_question}
|
||||
```
|
||||
|
||||
|
|
@ -58,6 +61,9 @@ The following steps demonstrate how to add variables to a **Prompt Template** co
|
|||
* Use Langflow global variables.
|
||||
* Enter fixed values directly into the fields.
|
||||
|
||||
You can add as many variables as you like in your template.
|
||||
For example, you could add variables for `{references}` and `{instructions}`, and then feed that information in from other components, such as **Text Input**, **URL**, or **File** components.
|
||||
|
||||
## See also
|
||||
|
||||
* [LangChain Prompt Hub](/bundles-langchain#prompt-hub)
|
||||
|
|
|
|||
|
|
@ -50,14 +50,14 @@ This component implements an [Astra DB Serverless vector store](https://docs.dat
|
|||
|
||||
| Name | Display Name | Info |
|
||||
|------|--------------|------|
|
||||
| token | Astra DB Application Token | The authentication token for accessing Astra DB. |
|
||||
| token | Astra DB Application Token | An Astra application token with permission to access your vector database. Once the connection is verified, additional fields are populated with your existing databases and collections. |
|
||||
| environment | Environment | The environment for the Astra DB API Endpoint. For example, `dev` or `prod`. |
|
||||
| database_name | Database | The database name for the Astra DB instance. |
|
||||
| database_name | Database | The name of the database that you want this component to connect to, or select **New Database** to create a new database. To create a new database, you must provide the database details, and then wait for the database to initialize. |
|
||||
| api_endpoint | Astra DB API Endpoint | The API endpoint for the Astra DB instance. This supersedes the database selection. |
|
||||
| collection_name | Collection | The name of the collection within Astra DB where the vectors are stored. |
|
||||
| collection_name | Collection | The name of the collection that you want to use with this flow, or click **New Collection** to create a new collection. |
|
||||
| keyspace | Keyspace | An optional keyspace within Astra DB to use for the collection. |
|
||||
| embedding_choice | Embedding Model or Astra Vectorize | Choose an embedding model or use Astra vectorize. |
|
||||
| embedding_model | Embedding Model | Specify the embedding model. Not required for Astra vectorize collections. |
|
||||
| embedding_choice | Embedding Model or Astra Vectorize | Choose an embedding model or use Astra vectorize. If the collection has a vectorize integration, **Astra Vectorize** can be selected automatically. |
|
||||
| embedding_model | Embedding Model | Specify the embedding model. Not required if the embedding choice is **Astra Vectorize** because the component automatically uses the integrated model. |
|
||||
| number_of_results | Number of Search Results | The number of search results to return. Default:`4`. |
|
||||
| search_type | Search Type | The search type to use. The options are `Similarity`, `Similarity with score threshold`, and `MMR (Max Marginal Relevance)`. |
|
||||
| search_score_threshold | Search Score Threshold | The minimum similarity score threshold for search results when using the `Similarity with score threshold` option. |
|
||||
|
|
@ -90,7 +90,7 @@ For more information, see the [Astra DB Serverless documentation](https://docs.d
|
|||
With vectorize, the embedding model you choose when you create a collection cannot be changed later.
|
||||
:::
|
||||
|
||||
For an example of using the **Astra DB** component with an embedding model, see the [**Vector Store RAG** template](/vector-store-rag).
|
||||
For an example of using the **Astra DB** component with an embedding model, see the **Vector Store RAG** template.
|
||||
|
||||
### Hybrid search
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ You can upload images to the **Playground** chat interface and as runtime input
|
|||
|
||||
* In the **Playground**, you can drag-and-drop images into the chat input area, or you can click the **Attach image** icon to select an image to upload.
|
||||
|
||||
* When you trigger a flow with the `/api/v1/run/$FLOW_ID` endpoint, you can use the `files` parameter to attach the base64-encoded image data to the request payload:
|
||||
* When you trigger a flow with the `/api/v1/run/$FLOW_ID` endpoint, you can use the `files` parameter to attach image data as a base64-encoded string:
|
||||
|
||||
```bash
|
||||
curl -X POST "http://$LANGFLOW_SERVER_ADDRESS/api/v1/run/$FLOW_ID" \
|
||||
|
|
|
|||
|
|
@ -20,11 +20,27 @@ To try building and running a flow in a few minutes, see the [Langflow quickstar
|
|||
|
||||
## Create a flow
|
||||
|
||||
There are four ways to create a flow in the Langflow UI:
|
||||
From the [**Projects** page](#projects), there are four ways to create a flow in the Langflow UI:
|
||||
|
||||
* **Create a blank flow**: Select a project, click **New Flow**, and then click **Blank Flow**.
|
||||
|
||||
* **Create a flow from a template**: Select a project, click **New Flow**, and then click the template that you want to use.
|
||||
|
||||
<details>
|
||||
<summary>What are templates?</summary>
|
||||
|
||||
Templates are pre-built flows that you can use as a starting point for your own flow.
|
||||
They range from basic flows with a few components to complex flows with many components and sub-flows.
|
||||
|
||||
For example, the **Basic Prompting** template demonstrates a small flow that passes both chat input and pre-defined instructions (as a prompt) to an LLM.
|
||||
In contrast, the **Vector Store RAG** template consists of two sub-flows that demonstrate how to create a Retrieval Augmented Generation (RAG) chatbot. One sub-flow populates the vector store with contextually relevant data and embeddings, and the other sub-flow queries the vector store for similar data to answer user questions.
|
||||
|
||||
You can also [contribute templates](/contributing-templates) to the Langflow codebase.
|
||||
|
||||
</details>
|
||||
|
||||
* **Duplicate an existing flow**: Locate the flow you want to copy, click <Icon name="Ellipsis" aria-hidden="true" /> **More**, and then select **Duplicate**.
|
||||
|
||||
* **Create a blank flow**: From the [**Projects** page](#projects), select a project, and then click **New Flow**.
|
||||
* **Create a flow from a template**: From the [**Projects** page](#projects), select a project, and then click **New Flow**.
|
||||
* **Duplicate an existing flow**: From the [**Projects** page](#projects), locate the flow you want to copy, click <Icon name="Ellipsis" aria-hidden="true" /> **More**, and then select **Duplicate**.
|
||||
* **Import a flow**: See [Import and export flows](/concepts-flows-import).
|
||||
|
||||
You can also create a flow with the [Langflow API](/api-flows), but the Langflow team recommends using the visual editor until you are familiar with flow creation.
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ From the **Workspace**, you can also access the [**Playground**](#playground), [
|
|||
|
||||
If your flow has a **Chat Input** component, you can use the **Playground** to run your flow, chat with your flow, view inputs and outputs, and modify the LLM's memories to tune the flow's responses in real time.
|
||||
|
||||
To try this for yourself, create a flow with the [**Basic Prompting** template](/basic-prompting), and then click <Icon name="Play" aria-hidden="true"/> **Playground** when editing the flow in the **Workspace**.
|
||||
To try this for yourself, create a flow based on the **Basic Prompting** template, and then click <Icon name="Play" aria-hidden="true"/> **Playground** when editing the flow in the **Workspace**.
|
||||
|
||||

|
||||
|
||||
If you have an **Agent** component in your flow, the **Playground** displays its tool calls and outputs so you can monitor the agent's tool use and understand the reasoning behind its responses.
|
||||
To try an agentic flow in the **Playground**, use the [**Simple Agent** template](/simple-agent).
|
||||
To try an agentic flow in the **Playground**, use the **Simple Agent** template or see the [Langflow quickstart](/get-started-quickstart).
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ For more information about managing sessions and chat memory in Langflow, see [U
|
|||
|
||||
## Set custom session IDs {#session-ids}
|
||||
|
||||
Chat sessions are identified by session ID (`session_id`).
|
||||
Chat sessions are identified by session ID (`session_id`), which is a unique identifier for a flow run.
|
||||
|
||||
The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one enormous chat session.
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ For more information, see [Embed the chat widget with React, Angular, or HTML](#
|
|||
|
||||
The chat widget is implemented as a web component called `langflow-chat` that is loaded from a CDN. For more information, see the [langflow-embedded-chat repository](https://github.com/langflow-ai/langflow-embedded-chat).
|
||||
|
||||
For example, the following HTML embeds a chat widget for a [Basic prompting flow](/basic-prompting) hosted on a Langflow server deployed on ngrok:
|
||||
For example, the following HTML embeds a chat widget for a **Basic Prompting** template flow hosted on a Langflow server deployed on ngrok:
|
||||
|
||||
```html
|
||||
<html>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Voice mode requires the following:
|
|||
|
||||
In the **Playground**, click the <Icon name="Mic" aria-hidden="true"/> **Microphone** to enable voice mode and verbally interact with your flows through a microphone and speakers.
|
||||
|
||||
The following steps use the [**Simple Agent** template](/simple-agent) to demonstrate how to enable voice mode:
|
||||
The following steps use the **Simple Agent** template to demonstrate how to enable voice mode:
|
||||
|
||||
1. Create a flow based on the **Simple Agent** template.
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ Alternatively, you can quickly access the **MCP Server** tab from within any flo
|
|||
|
||||
It's helpful to think of the names and descriptions as function names and code comments, using clear statements describing the problems your flows solve.
|
||||
|
||||
For example, assume you have a [Document Q&A flow](/document-qa) that uses an LLM to chat about resumes, and you give the flow the following name and description:
|
||||
For example, assume you create a flow based on the **Document Q&A** template that uses an LLM to chat about resumes, and then you give the flow the following name and description:
|
||||
|
||||
- **Tool Name**: `document_qa_for_resume`
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ For information about publishing your image on Docker Hub and running a Langflow
|
|||
<details>
|
||||
<summary>About this example</summary>
|
||||
|
||||
This command runs the Pokédex template flow.
|
||||
This command runs the **Pokédex** template flow.
|
||||
It provides chat input about a specific Pokémon, uses an optional custom `session_id`, and enables response streaming with `?stream=true`.
|
||||
|
||||
The default [session ID](/session-id) is the flow ID.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ Build and run your first flow in minutes: [Install Langflow](/get-started-instal
|
|||
|
||||
## Application development and prototyping
|
||||
|
||||
Langflow can help you develop a wide variety of AI applications, such as [chatbots](/memory-chatbot), [document analysis systems](/document-qa), [content generators](/blog-writer), and [agentic applications](/simple-agent).
|
||||
Langflow can help you develop a wide variety of AI applications, such as chatbots, document analysis systems, content generators, and agentic applications.
|
||||
|
||||
Langflow includes several pre-built templates that are ready to use or customize to your needs.
|
||||
|
||||
### Create flows in minutes
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ Instructions for integrating Langflow and Arize are also available in the Arize
|
|||
1. In Langflow, run a flow that has an **Agent** or **Language Model** component.
|
||||
You must chat with the flow or trigger the LLM to produce traffic for Arize to trace.
|
||||
|
||||
For example, you can create a flow from the [**Simple Agent** template](/simple-agent), add your OpenAI API key to the **Agent** component, and then click **Playground** to chat with the flow and generate traffic.
|
||||
For example, you can create a flow with the **Simple Agent** template, add your OpenAI API key to the **Agent** component, and then click **Playground** to chat with the flow and generate traffic.
|
||||
|
||||
2. In Arize, open your project dashboard, and then wait for Arize to process the data.
|
||||
This can take a few minutes.
|
||||
|
|
|
|||
|
|
@ -127,13 +127,12 @@ To hide untrustworthy responses, configure the **CleanlabRemediator** component
|
|||
|
||||
### Evaluate RAG pipeline
|
||||
|
||||
This example flow includes the [Vector Store RAG](/vector-store-rag) template with the **CleanlabRAGEvaluator** component added to evaluate the flow's context, query, and response.
|
||||
|
||||
To use the **CleanlabRAGEvaluator** component in a flow, connect the `context`, `query`, and `response` outputs from any RAG pipeline to the **CleanlabRAGEvaluator** component.
|
||||
As an example, create a flow based on the **Vector Store RAG** template, and then add the **CleanlabRAGEvaluator** component to evaluate the flow's context, query, and response.
|
||||
Connect the **context**, **query**, and **response** outputs from the other components in the RAG flow to the **CleanlabRAGEvaluator** component.
|
||||
|
||||

|
||||
|
||||
Here is an example of the `Evaluation Summary` output from the **CleanlabRAGEvaluator** component.
|
||||
Here is an example of the `Evaluation Summary` output from the **CleanlabRAGEvaluator** component:
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ This guide demonstrates how to [use Langflow as an MCP client](/mcp-client) by u
|
|||
|
||||
4. Get your database's Astra DB API endpoint and an Astra application token with the **Database Administrator** role. For more information, see [Generate an application token for a database](https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html#database-token).
|
||||
|
||||
5. To follow along with this guide, create a flow based on the [**Simple Agent** template](/simple-agent).
|
||||
5. To follow along with this guide, create a flow based on the **Simple Agent** template.
|
||||
|
||||
You can also use an existing flow or create a blank flow.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
---
|
||||
title: Basic prompting
|
||||
slug: /basic-prompting
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow is a starting point for understanding Langflow.
|
||||
The flow demonstrates how to chat with an LLM, and how modifying the prompt can affect your outcomes.
|
||||
|
||||
Prompts serve as the inputs to a large language model (LLM), acting as the interface between human instructions and computational tasks.
|
||||
|
||||
By submitting natural language requests in a prompt to an LLM, you can obtain answers, generate text, and solve problems.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Create the basic prompting flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
|
||||
2. Select **Basic Prompting**.
|
||||
|
||||
3. The **Basic Prompting** flow is created.
|
||||
|
||||

|
||||
|
||||
This flow allows you to chat with the **OpenAI model** component.
|
||||
The model will respond according to the prompt constructed in the **Prompt** component.
|
||||
|
||||
4. To examine the **Template**, in the **Prompt** component, click the **Template** field.
|
||||
```text
|
||||
Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.
|
||||
```
|
||||
|
||||
5. To create an environment variable for the **OpenAI** component, in the **OpenAI API Key** field, click the <Icon name="Globe" aria-hidden="true"/> **Globe** button, and then click **Add New Variable**.
|
||||
|
||||
1. In the **Variable Name** field, enter `openai_api_key`.
|
||||
2. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
3. Click **Save Variable**.
|
||||
|
||||
## Run the basic prompting flow
|
||||
|
||||
1. Click the **Playground** button.
|
||||
2. Type a message and press Enter. The bot should respond in a markedly piratical manner!
|
||||
|
||||
## Modify the prompt for a different result
|
||||
|
||||
1. To modify your prompt results, in the **Prompt** component, click the **Template** field. The **Edit Prompt** window opens.
|
||||
2. Change the existing prompt to a different character, perhaps `Answer the user as if you were Hermione Granger.`
|
||||
3. Run the workflow again and notice how the prompt changes the model's response.
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
---
|
||||
title: Blog writer
|
||||
slug: /blog-writer
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow demonstrates adding an additional `{references}` input to the [Prompt](/components-prompts) component to capture input from the [URL](/components-data#url) and [Parser](/components-processing#parser) components.
|
||||
|
||||
The [Language model](/components-models) component uses this input to generate a blog post according to the `{instructions}` received by the [Prompt](/components-prompts) component.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Create the blog writer flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
2. Select **Blog Writer**.
|
||||
3. The **Blog Writer** flow is created.
|
||||
|
||||

|
||||
|
||||
This flow creates a blog article generator with **Prompt**, **Language Model**, 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 **Parser** 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.
|
||||
|
||||
```text
|
||||
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. Add your **OpenAI API key** to the **Language model** model component.
|
||||
Optionally, create a [global variable](/configuration-global-variables) for the **OpenAI API key**.
|
||||
|
||||
1. In the **OpenAI API Key** field, click <Icon name="Globe" aria-hidden="True" /> **Globe**, and then click **Add New Variable**.
|
||||
2. In the **Variable Name** field, enter `openai_api_key`.
|
||||
3. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
4. Click **Save Variable**.
|
||||
|
||||
2. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**, and then click **Run Flow**.
|
||||
A blog post about Langflow is generated, with content sourced from `langflow.org` and `docs.langflow.org`.
|
||||
3. To write about something different, change the values in the **URL** component and adjust the instructions in the **Text input** component. Try again and see what the LLM constructs.
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
title: Document QA
|
||||
slug: /document-qa
|
||||
description: Build a question-and-answer chatbot with document analysis capabilities using a document loaded from local memory.
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow demonstrates adding a file to the [File](/components-data#file) component to load a document from your local machine into your flow.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Create the document QA flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
2. Select **Document QA**.
|
||||
3. The **Document QA** flow is created.
|
||||
|
||||

|
||||
|
||||
This flow is composed of a chatbot with the **Chat Input**, **Prompt**, **Language model**, and **Chat Output** components, but also incorporates a **File** component, which loads a file from your local machine. The **Parser** component converts the data from the **File** component into the **Prompt** component as `{Document}`.
|
||||
|
||||
The **Prompt** component is instructed to answer questions based on the contents of `{Document}`. This gives the **OpenAI** component context it would not otherwise have access to.
|
||||
|
||||
### Run the document QA flow
|
||||
|
||||
1. Add your **OpenAI API key** to the **Language model** model component.
|
||||
Optionally, create a [global variable](/configuration-global-variables) for the **OpenAI API key**.
|
||||
|
||||
1. In the **OpenAI API Key** field, click <Icon name="Globe" aria-hidden="True" /> **Globe**, and then click **Add New Variable**.
|
||||
2. In the **Variable Name** field, enter `openai_api_key`.
|
||||
3. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
4. Click **Save Variable**.
|
||||
|
||||
2. To select a document to load, in the **File** component, click the **Select files** button. Select a local file or a file loaded with [File management](/concepts-file-management), and then click **Select file**. The file name appears in the component.
|
||||
|
||||
3. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**. Enter a question about the loaded document's content. You should receive a contextual response indicating that the LLM has read your document.
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
---
|
||||
title: Financial report parser
|
||||
slug: /financial-report-parser
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow demonstrates how to parse LLM responses into a structured format.
|
||||
|
||||
In this example, the [Chat Input](/components-io#chat-input) component is pre-loaded with a sample financial report to demonstrate extracting `Gross Profit`, `EBITDA`, and `Net Income`.
|
||||
The [Structured output](/components-processing#structured-output) component is used to extract the financial data from the report, and the [Parser](/components-processing#parser) component is used to convert the extracted data into a structured format.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Create the financial report parser flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
2. Select **Financial Report Parser**.
|
||||
|
||||
The **Financial Report Parser** flow is created.
|
||||
|
||||

|
||||
|
||||
## Run the financial report parser flow
|
||||
|
||||
1. Add your **OpenAI API key** to the **Language model** model component.
|
||||
Optionally, create a [global variable](/configuration-global-variables) for the **OpenAI API key**.
|
||||
|
||||
1. In the **OpenAI API Key** field, click <Icon name="Globe" aria-hidden="True" /> **Globe**, and then click **Add New Variable**.
|
||||
2. In the **Variable Name** field, enter `openai_api_key`.
|
||||
3. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
4. Click **Save Variable**.
|
||||
2. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**, and then click **Send**.
|
||||
The **Chat Input** component is pre-loaded with a sample financial report for demonstration purposes.
|
||||
The **Playground** returns a structured response:
|
||||
|
||||
```text
|
||||
EBITDA: $900 million , Net Income: $500 million , GROSS_PROFIT: $1.2 billion
|
||||
```
|
||||
|
||||
Inspect the flow to understand how this information was extracted.
|
||||
|
||||
3. To inspect the output schema table, in the **Structured Output** component, click **Open table**.
|
||||
The **Structured Output** component uses the attached **OpenAI** model component as its "brain" to extract financial data into a [DataFrame](/data-types#dataframe) with this defined schema.
|
||||
```text
|
||||
| Name | Description | Type | Multiple |
|
||||
|--------------|-----------------------|------|----------|
|
||||
| EBITDA | description of field | text | False |
|
||||
| NET_INCOME | description of field | text | False |
|
||||
| GROSS_PROFIT | description of field | text | False |
|
||||
```
|
||||
|
||||
4. To inspect the template that contains the extracted data, in the **Parser** component, click <Icon name="Scan" aria-hidden="true"/> **Scan** in the **Template** field.
|
||||
The **Parser** component converts the extracted data into formatted messages for chat consumption.
|
||||
Each variable receives its value from the structured outputs.
|
||||
```text
|
||||
EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
---
|
||||
title: Memory chatbot
|
||||
slug: /memory-chatbot
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow extends the [**Basic Prompting** flow template](/basic-prompting) with a [**Message History** component](/components-helpers#message-history) that stores previous chat messages and uses them to provide context for the current conversation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Create the memory chatbot flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
2. Select **Memory Chatbot**.
|
||||
3. The **Memory Chatbot** flow is created.
|
||||
|
||||

|
||||
|
||||
This flow adds a **Message History** 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** instructs the **Language model** component how to respond to input.
|
||||
|
||||
```text
|
||||
You are a helpful assistant that answers questions.
|
||||
|
||||
Use markdown to format your answer, properly embedding images and urls.
|
||||
|
||||
History:
|
||||
|
||||
{memory}
|
||||
```
|
||||
|
||||
The `{memory}` code in the prompt creates a new input port in the component called **memory**.
|
||||
The **Message history** component is connected to this port to store chat messages from the **Playground**, and provide the **Language model** component with a memory of previous chat messages.
|
||||
|
||||
## Run the memory chatbot flow
|
||||
|
||||
1. Open the **Playground**.
|
||||
2. Enter multiple questions. For example, try entering this conversation:
|
||||
|
||||
```text
|
||||
Hi, my name is Luca.
|
||||
Please tell me about PostgreSQL.
|
||||
What is my name?
|
||||
What is the second subject I asked you about?
|
||||
```
|
||||
|
||||
The chatbot remembers your name and previous questions.
|
||||
|
||||
3. To view the **Message Logs** pane, in the **Playground** pane, click <Icon name="Ellipsis" aria-hidden="true"/> **Options**, and then click **Message logs**.
|
||||
The **Message Logs** pane displays all previous messages.
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
|
||||
In the **Memory Chatbot** flow you created, the **Message history** 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 **Message history** 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 session created in the **Message Logs** pane.
|
||||
3. Note how your conversation is being stored in different memory sessions.
|
||||
|
||||
To learn more about memory in Langflow, see [Memory](/memory).
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
---
|
||||
title: Sequential tasks agent
|
||||
slug: /sequential-agent
|
||||
---
|
||||
|
||||
This flow demonstrates using multiple [Agent](/agents) components in a single flow.
|
||||
|
||||
Each agent is connected to a unique tool, with **Prompt** components connected to the **Agent Instructions** fields to control the agent's behavior.
|
||||
|
||||
Each successive agent in the flow builds on the work of the previous agent, creating a chain of reasoning for solving complex problems.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
* Create a [Tavily AI API key](https://www.tavily.com/)
|
||||
|
||||
## Open Langflow and create a new flow
|
||||
|
||||
1. Click **New Flow**, and then select **Sequential Tasks Agent**.
|
||||
This opens a starter template with the necessary components to run the flow.
|
||||
|
||||

|
||||
|
||||
The Sequential Tasks Agent flow consists of these components:
|
||||
|
||||
* The **Agent** components use the connected LLM to analyze the user's input and select among the connected tools to complete the tasks.
|
||||
* The **Chat Input** component accepts user input to the chat.
|
||||
* The **Prompt** component combines the user input with a user-defined prompt.
|
||||
* The **Chat Output** component prints the flow's output to the chat.
|
||||
* The **YFinance** tool component provides access to financial data from Yahoo Finance.
|
||||
* The **Tavily AI Search** tool component performs AI-powered web searches.
|
||||
* The **Calculator** tool component performs mathematical calculations.
|
||||
|
||||
## Run the Sequential Tasks Agent flow
|
||||
|
||||
1. Add your OpenAI API key to the **Agent** components.
|
||||
2. Add your Tavily API key to the **Tavily** component.
|
||||
3. Click **Playground** to start a chat session with the template's default question.
|
||||
|
||||
```text
|
||||
Should I invest in Tesla (TSLA) stock right now?
|
||||
Please analyze the company's current position, market trends,
|
||||
financial health, and provide a clear investment recommendation.
|
||||
```
|
||||
|
||||
This question provides clear instructions to the agents about how to proceed and what question to answer.
|
||||
|
||||
4. In the **Playground**, inspect the answers to see how the agents use the **Tavily AI Search** tool to research the query, the **YFinance** tool to analyze the stock data, and the **Calculator** to determine if the stock is a wise investment.
|
||||
5. Ask similar questions to see how the agents use the tools to answer your queries.
|
||||
|
||||
## Next steps
|
||||
|
||||
To create your own multi-agent flow, see [Create a problem solving agent](/agents).
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
---
|
||||
title: Simple agent
|
||||
slug: /simple-agent
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow demonstrates using an [Agent](/agents) in a flow.
|
||||
An **Agent** uses an LLM as its "brain" to select among the connected tools and complete its tasks.
|
||||
|
||||
In this flow, the **Agent** reasons using a connected [Language model](/components-models) component.
|
||||
The **Agent** selects the [Calculator](/components-helpers#calculator) tool for simple math problems, and the [URL](/components-data#url) tool to search a URL for content.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Open Langflow and start a new flow
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
|
||||
2. Select **Simple Agent**.
|
||||
|
||||
The **Simple Agent** flow is created.
|
||||
|
||||

|
||||
|
||||
## Run the simple agent flow
|
||||
|
||||
1. Add your **OpenAI API key** to the **Agent** component.
|
||||
|
||||
Optionally, create a [global variable](/configuration-global-variables) for the **OpenAI API key**.
|
||||
|
||||
1. In the **OpenAI API Key** field, click <Icon name="Globe" aria-hidden="True" /> **Globe**, and then click **Add New Variable**.
|
||||
2. In the **Variable Name** field, enter `openai_api_key`.
|
||||
3. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
4. Click **Save Variable**.
|
||||
|
||||
2. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**.
|
||||
3. To confirm the tools are connected, ask the agent, `What tools are available to you?`
|
||||
The response is similar to the following:
|
||||
```text
|
||||
I have access to the following tools:
|
||||
Calculator: Perform basic arithmetic operations.
|
||||
fetch_content: Load and retrieve data from specified URLs.
|
||||
fetch_content_text: Load and retrieve text from specified URLs.
|
||||
as_dataframe: Load and retrieve data in a structured format (dataframe) from specified URLs.
|
||||
get_current_date: Returns the current date and time in a selected timezone.
|
||||
```
|
||||
4. Ask the agent a question. For example, ask it to create a tabletop character using your favorite rules set.
|
||||
The agent tells you when it's using the `URL-fetch_content_text` tool to search for rules information, and when it's using `CalculatorComponent-evaluate_expression` to generate attributes with dice rolls.
|
||||
The final output should be similar to this:
|
||||
|
||||
```text
|
||||
Final Attributes
|
||||
Strength (STR): 10
|
||||
Constitution (CON): 12
|
||||
Size (SIZ): 14
|
||||
Dexterity (DEX): 9
|
||||
Intelligence (INT): 11
|
||||
Power (POW): 13
|
||||
Charisma (CHA): 8
|
||||
```
|
||||
|
||||
Now that your query has completed the journey from **Chat input** to **Chat output**, you have completed the **Simple Agent** flow.
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
---
|
||||
title: Travel planning agent
|
||||
slug: /travel-planning-agent
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
This flow demonstrates using multiple [Agent](/agents) components in a single flow.
|
||||
|
||||
In this flow, multiple **Agents** plan a travel journey.
|
||||
Each agent is given a different responsibility defined by its **System Prompt** field.
|
||||
The **Chat input** defines where the user wants to go, and passes the result to the **City Selection** agent. The **Local Expert** agent then adds information based on the selected cities, and the **Travel Concierge** assembles a seven day travel plan in Markdown.
|
||||
|
||||
All agents have access to the **Search API** and **URL Content Fetcher** components, while only the **Travel Concierge** agent can use the **Calculator** for computing the trip costs.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
* Create a [Search API key](https://www.searchapi.io/)
|
||||
|
||||
## Open Langflow and start a new flow
|
||||
|
||||
Click **New Flow**, and then select the **Travel Planning Agent** flow.
|
||||
|
||||
This opens a starter flow with the necessary components to run an agentic application using multiple Tool-calling agents.
|
||||
|
||||
## Create the travel planning agent flow
|
||||
|
||||

|
||||
|
||||
The **Travel Planning Agent** flow consists of these components:
|
||||
|
||||
* Multiple **Tool calling agent** components that use the connected LLM to reason through the user's input and select among the connected tools to complete their tasks.
|
||||
* The **Calculator** component performs basic arithmetic operations.
|
||||
* The **URL Content Fetcher** component scrapes content from a given URL.
|
||||
* The **Chat Input** component accepts user input to the chat.
|
||||
* The **Chat Output** component prints the flow's output to the chat.
|
||||
* The **OpenAI** model component sends the user input and prompt to the OpenAI API and receives a response.
|
||||
|
||||
## Run the travel planning agent flow
|
||||
|
||||
1. Add your credentials to the OpenAI and Search API components.
|
||||
2. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**.
|
||||
You should receive a detailed, helpful answer to the journey defined in the **Chat input** component.
|
||||
|
||||
Now that your query has completed the journey from **Chat input** to **Chat output**, you have completed the **Travel Planning Agent** flow.
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
---
|
||||
title: Vector store RAG
|
||||
slug: /vector-store-rag
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
Retrieval Augmented Generation, or RAG, is a pattern for training LLMs on your data and querying it.
|
||||
|
||||
RAG is backed by a **vector store**, a vector database which stores embeddings of the ingested data.
|
||||
|
||||
This enables **vector search**, a more powerful and context-aware search.
|
||||
|
||||
We've chosen [Astra DB](https://astra.datastax.com/signup?utm_source=langflow-pre-release&utm_medium=referral&utm_campaign=langflow-announcement&utm_content=create-a-free-astra-db-account) as the vector database for this starter flow, but you can follow along with any of Langflow's vector database options.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Install and start Langflow](/get-started-installation)
|
||||
* Create an [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
* Create an [Astra DB vector database](https://docs.datastax.com/en/astra-db-serverless/get-started/quickstart.html)
|
||||
* Create an [Astra application token scoped to your database](https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html#database-token)
|
||||
|
||||
You can use an existing [collection](https://docs.datastax.com/en/astra-db-serverless/databases/manage-collections.html#create-collection) or create a new collection through the **Astra DB** component.
|
||||
|
||||
## Open Langflow and start a new project
|
||||
|
||||
1. From the Langflow dashboard, click **New Flow**.
|
||||
2. Select **Vector Store RAG**.
|
||||
3. The **Vector Store RAG** flow is created.
|
||||
|
||||
## Build the vector RAG flow
|
||||
|
||||
The vector store RAG flow is built of two separate flows for ingestion and query.
|
||||
|
||||

|
||||
|
||||
The **Load Data Flow** (bottom of the screen) creates a searchable index to be queried for contextual similarity.
|
||||
This flow populates the vector store with data from a local file.
|
||||
It ingests data from a local file, splits it into chunks, indexes it in Astra DB, and computes embeddings for the chunks using the **Embeddings model** component.
|
||||
|
||||
The **Retriever Flow** (top of the screen) embeds the user's queries into vectors, which are compared to the vector store data from the **Load Data Flow** for contextual similarity.
|
||||
|
||||
- **Chat Input** receives user input from the **Playground**.
|
||||
- **Embeddings model** converts the user query into vector form.
|
||||
- **Astra DB** performs similarity search using the query vector.
|
||||
- **Parser** processes the retrieved chunks.
|
||||
- **Prompt** combines the user query with relevant context.
|
||||
- **Language model** generates the response using the prompt and the OpenAI LLM.
|
||||
- **Chat Output** returns the response to the **Playground**.
|
||||
|
||||
1. Add your **OpenAI API key** to the **Language model** component.
|
||||
|
||||
Optionally, create a [global variable](/configuration-global-variables) for the **OpenAI API key**.
|
||||
|
||||
1. In the **OpenAI API Key** field, click <Icon name="Globe" aria-hidden="True" /> **Globe**, and then click **Add New Variable**.
|
||||
2. In the **Variable Name** field, enter `openai_api_key`.
|
||||
3. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
4. Click **Save Variable**.
|
||||
2. Configure the **Astra DB** component.
|
||||
1. In the **Astra DB Application Token** field, add your **Astra DB** application token.
|
||||
The component connects to your database and populates the menus with existing databases and collections.
|
||||
2. Select your **Database**.
|
||||
If you don't have a collection, select **New database**.
|
||||
Complete the **Name**, **Cloud provider**, and **Region** fields, and then click **Create**. **Database creation takes a few minutes**.
|
||||
3. Select your **Collection**. Collections are created in your [Astra DB deployment](https://astra.datastax.com) for storing vector data.
|
||||
:::info
|
||||
If your collection use the Astra vectorize NVIDIA integration, the **Embedding Model** port is removed, because the collection already generates embeddings with the integrated NVIDIA model. The component fetches the data from the collection, and uses the same model to generate embeddings for queries.
|
||||
:::
|
||||
|
||||
3. If you don't have a collection, create a new one within the component.
|
||||
1. Select **New collection**.
|
||||
2. Complete the **Name**, **Embedding generation method**, **Embedding model**, and **Dimensions** fields, and then click **Create**.
|
||||
|
||||
Your choice for the **Embedding generation method** and **Embedding model** depends on whether you want to use embeddings generated by a provider through Astra's vectorize service, or generated by a component in Langflow.
|
||||
|
||||
* To use embeddings generated by a provider through Astra's vectorize service, select the model from the **Embedding generation method** dropdown menu, and then select the model from the **Embedding model** dropdown menu.
|
||||
* To use embeddings generated by a component in Langflow, select **Bring your own** for both the **Embedding generation method** and **Embedding model** fields. In this starter project, the option for the embeddings method and model is the **OpenAI Embeddings** component connected to the **Astra DB** component.
|
||||
* The **Dimensions** value must match the dimensions of your collection. This field is **not required** if you use embeddings generated through Astra's vectorize service. You can find this value in the **Collection** in your [Astra DB deployment](https://astra.datastax.com).
|
||||
|
||||
For more information, see the [DataStax Astra DB Serverless documentation](https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html).
|
||||
|
||||
|
||||
If you used Langflow's **Global Variables** feature, the RAG application flow components are already configured with the necessary credentials.
|
||||
|
||||
## Run the Vector Store RAG flow
|
||||
|
||||
1. To run the flow, click <Icon name="Play" aria-hidden="true"/> **Playground**.
|
||||
In the **Playground**, you can chat with the LLM that uses context from the database you created.
|
||||
2. Enter a message and press <kbd>Enter</kbd>. Try something like, "What topics do you know about?"
|
||||
3. The bot will respond with a summary of the data you've embedded.
|
||||
|
|
@ -22,11 +22,11 @@ This tutorial uses an OpenAI LLM. If you want to use a different provider, you n
|
|||
|
||||
## Create an agentic flow
|
||||
|
||||
The following steps modify the [**Simple agent**](/simple-agent) template to connect [**Directory**](/components-data#directory) and [**Web search**](/components-data#web-search) components as tools for an **Agent** component.
|
||||
The following steps modify the **Simple Agent** template to connect [**Directory**](/components-data#directory) and [**Web search**](/components-data#web-search) components as tools for an **Agent** component.
|
||||
The **Directory** component loads all files of a given type from a target directory on your local machine, and the **Web search** component performs a DuckDuckGo search.
|
||||
When connected to an **Agent** component as tools, the agent has the option to use these components when handling requests.
|
||||
|
||||
1. In Langflow, click **New Flow**, and then select the **Simple agent** template.
|
||||
1. In Langflow, click **New Flow**, and then select the **Simple Agent** template.
|
||||
2. Remove the **URL** and **Calculator** tools, and then drag the [**Directory**](/components-data#directory) and [**Web search**](/components-data#web-search) components into your workspace.
|
||||
3. In the **Directory** component's **Path** field, enter the directory path and file types that you want to make available to the **Agent** component.
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ This tutorial uses an OpenAI LLM. If you want to use a different provider, you n
|
|||
|
||||
To ingest files, your flow must have a **File** component attached to a component that receives input, such as a **Prompt Template** or **Agent** component.
|
||||
|
||||
The following steps modify the [**Basic prompting**](/basic-prompting) template to accept file input:
|
||||
The following steps modify the **Basic Prompting** template to accept file input:
|
||||
|
||||
1. In Langflow, click **New Flow**, and then select the **Basic prompting** template.
|
||||
1. In Langflow, click **New Flow**, and then select the **Basic Prompting** template.
|
||||
2. In the **Language Model** component, enter your OpenAI API key.
|
||||
|
||||
If you want to use a different provider or model, edit the **Model Provider**, **Model Name**, and **API Key** fields accordingly.
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ This tutorial uses an OpenAI LLM. If you want to use a different provider, you n
|
|||
|
||||
## Create an agentic flow
|
||||
|
||||
1. In Langflow, click **New Flow**, and then select the [**Simple agent**](/simple-agent) template.
|
||||
1. In Langflow, click **New Flow**, and then select the **Simple Agent** template.
|
||||
|
||||
2. In the **Agent** component, enter your OpenAI API key.
|
||||
|
||||
|
|
|
|||
|
|
@ -207,48 +207,34 @@ const config = {
|
|||
from: ["/guides-data-message", "/configuration-objects"],
|
||||
},
|
||||
{
|
||||
to: "/blog-writer",
|
||||
from: [
|
||||
"/starter-projects-blog-writer",
|
||||
"/tutorials-blog-writer",
|
||||
],
|
||||
},
|
||||
{
|
||||
to: "/memory-chatbot",
|
||||
from: [
|
||||
"/starter-projects-memory-chatbot",
|
||||
"/tutorials-memory-chatbot",
|
||||
],
|
||||
},
|
||||
{
|
||||
to: "/document-qa",
|
||||
from: [
|
||||
"/starter-projects-document-qa",
|
||||
"/tutorials-document-qa",
|
||||
],
|
||||
},
|
||||
{
|
||||
to: "/simple-agent",
|
||||
to: "/concepts-flows",
|
||||
from: [
|
||||
"/travel-planning-agent",
|
||||
"/starter-projects-travel-planning-agent",
|
||||
"/tutorials-travel-planning-agent",
|
||||
"/starter-projects-dynamic-agent/",
|
||||
"/simple-agent",
|
||||
"/math-agent",
|
||||
"/starter-projects-simple-agent",
|
||||
"/starter-projects-math-agent",
|
||||
"/tutorials-math-agent",
|
||||
],
|
||||
},
|
||||
{
|
||||
to: "/sequential-agent",
|
||||
from: [
|
||||
"/sequential-agent",
|
||||
"/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/",
|
||||
"/memory-chatbot",
|
||||
"/starter-projects-memory-chatbot",
|
||||
"/tutorials-memory-chatbot",
|
||||
"/financial-report-parser",
|
||||
"/document-qa",
|
||||
"/starter-projects-document-qa",
|
||||
"/tutorials-document-qa",
|
||||
"/blog-writer",
|
||||
"/starter-projects-blog-writer",
|
||||
"/tutorials-blog-writer",
|
||||
"/basic-prompting",
|
||||
"/starter-projects-basic-prompting",
|
||||
"/vector-store-rag",
|
||||
"/starter-projects-vector-store-rag",
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -300,14 +286,6 @@ const config = {
|
|||
to: "/deployment-kubernetes-dev",
|
||||
from: "/deployment-kubernetes",
|
||||
},
|
||||
{
|
||||
to: "/basic-prompting",
|
||||
from: "/starter-projects-basic-prompting",
|
||||
},
|
||||
{
|
||||
to: "/vector-store-rag",
|
||||
from: "/starter-projects-vector-store-rag",
|
||||
},
|
||||
{
|
||||
to: "/contributing-github-issues",
|
||||
from: "/contributing-github-discussions",
|
||||
|
|
|
|||
|
|
@ -46,21 +46,6 @@ module.exports = {
|
|||
id: "Concepts/concepts-flows",
|
||||
label: "Build flows"
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Flow templates",
|
||||
items: [
|
||||
'Templates/basic-prompting',
|
||||
'Templates/simple-agent',
|
||||
'Templates/blog-writer',
|
||||
'Templates/document-qa',
|
||||
'Templates/memory-chatbot',
|
||||
'Templates/vector-store-rag',
|
||||
'Templates/financial-report-parser',
|
||||
'Templates/sequential-agent',
|
||||
'Templates/travel-planning-agent',
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Run flows",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue