From 58bdabf5a371f1d159a15152737203e9e23af97e Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Thu, 15 May 2025 13:55:14 -0400 Subject: [PATCH] docs: langflow docs review (#8032) * quickstart * message-history * concepts-components * data * helpers * logic-and-memories * models * agent-descriptions * langsmith-more-env-vars * use-kbd * modify-descriptions * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> Co-authored-by: Victor-w-Madeira * remove-duplicate-periods * remove-str-no-longer-used-in-ports --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> Co-authored-by: Victor-w-Madeira --- .../agent-tool-calling-agent-component.md | 18 +-- docs/docs/Components/components-data.md | 23 ++-- docs/docs/Components/components-helpers.md | 9 +- docs/docs/Components/components-logic.md | 6 +- docs/docs/Components/components-memories.md | 4 +- docs/docs/Components/components-models.md | 10 +- docs/docs/Concepts/concepts-components.md | 105 ++++++++++-------- .../Get-Started/get-started-quickstart.md | 63 +++++------ .../Integrations/integrations-langsmith.md | 28 +++-- docs/docs/Sample-Flows/memory-chatbot.md | 14 ++- 10 files changed, 146 insertions(+), 134 deletions(-) diff --git a/docs/docs/Agents/agent-tool-calling-agent-component.md b/docs/docs/Agents/agent-tool-calling-agent-component.md index c34ea7cd2..26b6719a9 100644 --- a/docs/docs/Agents/agent-tool-calling-agent-component.md +++ b/docs/docs/Agents/agent-tool-calling-agent-component.md @@ -10,7 +10,7 @@ The `AgentComponent` is a component for easily creating an AI agent capable of a The component contains all of the elements you'll need for creating an agent. Instead of managing LLM models and providers, pick your model and enter your API key. Instead of connecting a **Prompt** component, enter instructions in the component's **Agent Instruction** fields. -![Tool calling agentcomponent](/img/tool-calling-agent-component.png) +![Tool calling agent component](/img/tool-calling-agent-component.png) Learn how to build a flow starting with the **Tool calling agent** component, and see how it can help you solve problems. @@ -19,7 +19,7 @@ Learn how to build a flow starting with the **Tool calling agent** component, an - [An OpenAI API key](https://platform.openai.com/) - [A Search API key](https://www.searchapi.io/) -## Create a problem-solving agent with AgentComponent +## Create a problem-solving agent with the Agent component Create a problem-solving agent in Langflow, starting with the **Tool calling agent**. @@ -58,17 +58,17 @@ See what problems you can solve with this flow. As your problem becomes more spe ### Edit a tool's metadata -To edit a tool's metadata, click the **Edit Tools** button in the tool to modify its `name` or `description` metadata. These fields help connected agents understand how to use the tool, without having to modify the agent's prompt instructions. +To edit a tool's metadata, click the **Edit Tools** button in the tool to modify its `name`, `description`, or `enabled` metadata. These fields help connected agents understand how to use the tool, without having to modify the agent's prompt instructions. For example, the [URL](/components-data#url) component has three tools available when **Tool Mode** is enabled. -| Tool Name | Description | -|-----------|-------------| -| `URL-fetch_content` | Use this tool to fetch and retrieve raw content from a URL, including HTML and other structured data. The full response content is returned. | -| `URL-fetch_content_text` | Use this tool to fetch and extract clean, readable text content from a webpage. Only plain text content is returned. | -| `URL-as_dataframe` | Use this tool to fetch structured data from a URL and convert it into a tabular format. Data is returned in a structured DataFrame table format. | +| Tool Name | Description | Enabled | +|-----------|-------------|---------| +| `URL-fetch_content` | Use this tool to fetch and retrieve raw content from a URL, including HTML and other structured data. The full response content is returned. | true | +| `URL-fetch_content_text` | Use this tool to fetch and extract clean, readable text content from a webpage. Only plain text content is returned. | true | +| `URL-as_dataframe` | Use this tool to fetch structured data from a URL and convert it into a tabular format. Data is returned in a structured DataFrame table format. | true | -A connected agent will have a clear idea of each tool's capabilities based on the `name` and `description` metadata. If you think the agent is using a tool incorrectly, edit a tool's metadata to help it understand the tool better. +A connected agent will have a clear idea of each tool's capabilities based on the `name` and `description` metadata. The `enabled` boolean controls the tool's availability to the agent. If you think an agent is using a tool incorrectly, edit a tool's metadata to help the agent better understand the tool. Tool names and descriptions can be edited, but the default tool identifiers cannot be changed. If you want to change the tool identifier, create a custom component. diff --git a/docs/docs/Components/components-data.md b/docs/docs/Components/components-data.md index cb28bdbc6..5823c919b 100644 --- a/docs/docs/Components/components-data.md +++ b/docs/docs/Components/components-data.md @@ -15,10 +15,9 @@ They may perform some processing or type checking, like converting raw HTML data The **URL** data component loads content from a list of URLs. -In the component's **URLs** field, enter a comma-separated list of URLs you want to load. Alternatively, connect a component that outputs the `Message` type, like the **Chat Input** component, to supply your URLs with a component. +In the component's **URLs** field, enter the URL you want to load. To add multiple URL fields, click . -To output a `Data` type, in the **Output Format** dropdown, select **Raw HTML**. -To output a `Message` type, in the **Output Format** dropdown, select **Text**. This option applies postprocessing with the `data_to_text` helper function. +Alternatively, connect a component that outputs the `Message` type, like the **Chat Input** component, to supply your URLs from a component. In this example of a document ingestion pipeline, the URL component outputs raw HTML to a text splitter, which splits the raw content into chunks for a vector database to ingest. @@ -99,6 +98,7 @@ This component recursively loads files from a directory, with options for file t | Output | Type | Description | | ------ | ---------- | ----------------------------------- | | data | List[Data] | The loaded file data from the directory. | +| dataframe | DataFrame | The loaded file data in tabular DataFrame format. | @@ -195,7 +195,9 @@ This component executes SQL queries on a specified database. ## URL -This component fetches content from one or more URLs, processes the content, and returns it in various formats. It supports output in plain text, raw HTML, or JSON, with options for cleaning and separating multiple outputs. +This component fetches content from one or more URLs, processes the content, and returns it in various formats. It supports output in plain text or raw HTML. + +In the component's **URLs** field, enter the URL you want to load. To add multiple URL fields, click . 1. To use this component in a flow, connect the **DataFrame** output to a component that accepts the input. For example, connect the **URL** component to a **Chat Output** component. @@ -238,17 +240,20 @@ Peruvian writer and Nobel Prize in Literature laureate Mario Vargas Llosa (pictu | Name | Display Name | Info | |------|--------------|------| -| urls | URLs | Enter one or more URLs. URLs are automatically validated and cleaned. | -| format | Output Format | The output format. Use **Text** to extract text from the HTML, **Raw HTML** for the raw HTML content, or **JSON** to extract JSON from the HTML. | -| separator | Separator | The separator to use between multiple outputs. Default for **Text** is `\n\n`. Default for **Raw HTML** is `\n\n`. | -| clean_extra_whitespace | Clean Extra Whitespace | Whether to clean excessive blank lines in the text output. Only applies to `Text` format. | +| urls | URLs | Click the '+' button to enter one or more URLs to crawl recursively. | +| max_depth | Max Depth | Controls how many 'clicks' away from the initial page the crawler will go. | +| prevent_outside | Prevent Outside | If enabled, only crawls URLs within the same domain as the root URL. | +| use_async | Use Async | If enabled, uses asynchronous loading which can be significantly faster but might use more system resources. | +| format | Output Format | Output Format. Use `Text` to extract the text from the HTML or `HTML` for the raw HTML content. | +| timeout | Timeout | Timeout for the request in seconds. | +| headers | Headers | The headers to send with the request. | **Outputs** | Name | Display Name | Info | |------|--------------|------| | data | Data | A list of [Data](/concepts-objects) objects containing fetched content and metadata. | -| text | Text | The fetched content as formatted text, with applied separators and cleaning. | +| text | Message | The fetched content as formatted text. | | dataframe | DataFrame | The content formatted as a [DataFrame](/concepts-objects#dataframe-object) object. | diff --git a/docs/docs/Components/components-helpers.md b/docs/docs/Components/components-helpers.md index 928d06524..a95818bef 100644 --- a/docs/docs/Components/components-helpers.md +++ b/docs/docs/Components/components-helpers.md @@ -62,14 +62,15 @@ record_number: {batch_index}, name: {text_input}, summary: {model_response} | model | HandleInput | Connect the 'Language Model' output from your LLM component here. Required. | | system_message | MultilineInput | A multi-line system instruction for all rows in the DataFrame. | | df | DataFrameInput | The DataFrame whose column is treated as text messages, as specified by 'column_name'. Required. | -| column_name | MessageTextInput | The name of the DataFrame column to treat as text messages. Default='text'. Required. | +| column_name | MessageTextInput | The name of the DataFrame column to treat as text messages. If empty, all columns are formatted in TOML. | +| output_column_name | MessageTextInput | Name of the column where the model's response is stored. Default=`model_response`. | | enable_metadata | BoolInput | If True, add metadata to the output DataFrame. | **Outputs** | Name | Type | Description | |------|------|-------------| -| batch_results | DataFrame | A DataFrame with columns: 'text_input', 'model_response', 'batch_index', and optional 'metadata' containing processing information. | +| batch_results | DataFrame | A DataFrame with all original columns plus the model's response column. | @@ -149,8 +150,8 @@ For more information on configuring memory in Langflow, see [Memory](/memory). | Name | Type | Description | |------|------|-------------| | messages | Data | The retrieved messages as Data objects. | -| messages_text | String | The retrieved messages formatted as text. | -| lc_memory | Memory | A constructed Langchain [ConversationBufferMemory](https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer.ConversationBufferMemory.html) object. | +| messages_text | Message | The retrieved messages formatted as text. | +| dataframe | DataFrame | A DataFrame containing the message data. | diff --git a/docs/docs/Components/components-logic.md b/docs/docs/Components/components-logic.md index 448ab2543..ae1cad73b 100644 --- a/docs/docs/Components/components-logic.md +++ b/docs/docs/Components/components-logic.md @@ -13,11 +13,11 @@ This flow creates a summarizing "for each" loop with the [Loop](/components-logi The component iterates over a list of [Data](/concepts-objects#data-object) objects until it's completed, and then the **Done** loop aggregates the results. -The **File** component loads text files from your local machine, and then the **Parse Data** component parses them into a list of structured `Data` objects. +The **File** component loads text files from your local machine, and then the **Parser** component parses them into a list of structured `Data` objects. The **Loop** component passes each `Data` object to a **Prompt** to be summarized. When the **Loop** component runs out of `Data`, the **Done** loop activates, which counts the number of pages and summarizes their tone with another **Prompt**. -This is represented in Langflow by connecting the Parse Data component's **Data List** output to the Loop component's `Data` loop input. +This is represented in Langflow by connecting the Parser component's **Data List** output to the Loop component's `Data` loop input. ![Sample Flow looping summarizer](/img/loop-text-summarizer.png) @@ -202,7 +202,7 @@ This component generates a notification for the Listen component to use. -## Pass message +## Pass This component forwards the input message, unchanged. diff --git a/docs/docs/Components/components-memories.md b/docs/docs/Components/components-memories.md index c06bcdba3..ade9d8a26 100644 --- a/docs/docs/Components/components-memories.md +++ b/docs/docs/Components/components-memories.md @@ -13,11 +13,11 @@ Memory components provide access to their respective external databases **as mem ## Use a memory component in a flow -This example flow stores and retrieves chat history from an **Astra DB Chat Memory** component with **Store Message** and **Chat Memory** components. +This example flow stores and retrieves chat history from an **Astra DB Chat Memory** component with **Store Message** and **Message history** components. The **Store Message** helper component stores chat memories as [Data](/concepts-objects) objects, and the **Message History** helper component retrieves chat messages as [Data](/concepts-objects) objects or strings. -![Sample Flow storing Chat Memory in AstraDB](/img/astra_db_chat_memory_rounded.png) +![Sample Flow storing Message history in AstraDB](/img/astra_db_chat_memory_rounded.png) ## AstraDBChatMemory Component diff --git a/docs/docs/Components/components-models.md b/docs/docs/Components/components-models.md index fb76589c5..f234ca991 100644 --- a/docs/docs/Components/components-models.md +++ b/docs/docs/Components/components-models.md @@ -21,7 +21,7 @@ This example has the OpenAI model in a chatbot flow. For more information, see t ![](/img/starter-flow-basic-prompting.png) -## AI/ML API +## AIML This component creates a ChatOpenAI model instance using the AIML API. @@ -40,7 +40,6 @@ For more information, see [AIML documentation](https://docs.aimlapi.com/). | aiml_api_base | String | The base URL of the AIML API. Defaults to `https://api.aimlapi.com`. | | api_key | SecretString | The AIML API Key to use for the model. | | temperature | Float | Controls randomness in the output. Default: `0.1`. | -| seed | Integer | Controls reproducibility of the job. | **Outputs** @@ -66,10 +65,11 @@ For more information, see [Amazon Bedrock documentation](https://docs.aws.amazon | model_id | String | The ID of the Amazon Bedrock model to use. Options include various models. | | aws_access_key | SecretString | AWS Access Key for authentication. | | aws_secret_key | SecretString | AWS Secret Key for authentication. | -| credentials_profile_name | String | Name of the AWS credentials profile to use (advanced). | +| aws_session_token | SecretString | The session key for your AWS account. +| credentials_profile_name | String | Name of the AWS credentials profile to use. | | region_name | String | AWS region name. Default: `us-east-1`. | -| model_kwargs | Dictionary | Additional keyword arguments for the model (advanced). | -| endpoint_url | String | Custom endpoint URL for the Bedrock service (advanced). | +| model_kwargs | Dictionary | Additional keyword arguments for the model. | +| endpoint_url | String | Custom endpoint URL for the Bedrock service. | **Outputs** diff --git a/docs/docs/Concepts/concepts-components.md b/docs/docs/Concepts/concepts-components.md index 13a589ae7..a20e54ddb 100644 --- a/docs/docs/Concepts/concepts-components.md +++ b/docs/docs/Concepts/concepts-components.md @@ -7,7 +7,7 @@ import Icon from "@site/src/components/icon"; # Langflow components overview -A component is a single building block within a flow with inputs, outputs, functions, and parameters that define its functionality. A single component is like a class within a larger application. +A component is a single building block within a flow with inputs, outputs, functions, and parameters that define its functionality. A single component is like a class within a larger application. To add a component to a flow, drag it from the **Component** menu to the **Workspace**. @@ -21,13 +21,13 @@ Each component is unique, but all have a menu bar at the top that looks somethin Use the component controls to do the following: -- **Code** — Modify the component's Python code and save your changes. -- **Controls** — Adjust all component parameters. -- **Freeze** — After a component runs, lock its previous output state to prevent it from re-running. +- **Code** — Modify the component's Python code and save your changes. +- **Controls** — Adjust all component parameters. +- **Freeze** — After a component runs, lock its previous output state to prevent it from re-running. -Click  **All** to see additional options for a component. +Click **All** to see additional options for a component. -To view a component’s output and logs, click the icon. +To view a component's output and logs, click the icon. To run a single component, click **Play**. @@ -47,15 +47,14 @@ The following table lists the handle colors and their corresponding data types: | Data type | Handle color | Handle | |-----------|--------------|----------| -| BaseLanguageModel | Fuchsia | | | Data | Red | | -| Document | Lime | | +| DataFrame | Pink | | | Embeddings | Emerald | | | LanguageModel | Fuchsia | | +| Memory | Orange | | | Message | Indigo | | -| Prompt | Violet | | -| str | Indigo | | -| Text | Indigo | | +| Text | Indigo | | +| Tool | Cyan | | | unknown | Gray | | ## Component code @@ -149,15 +148,15 @@ When used in a flow, this component: After a component runs, **Freeze** locks the component's previous output state to prevent it from re-running. -If you’re expecting consistent output from a component and don’t need to re-run it, click **Freeze**. +If you're expecting consistent output from a component and don't need to re-run it, click **Freeze**. Enabling **Freeze** freezes all components upstream of the selected component. ## Additional component options -Click  **All** to see additional options for a component. +Click **All** to see additional options for a component. -To modify a component's name or description, double-click in the **Name** or **Description** fields. Component descriptions accept Markdown syntax. +To modify a component's name or description, click the icon. Component descriptions accept Markdown syntax. ### Component shortcuts @@ -165,43 +164,44 @@ The following keyboard shortcuts are available when a component is selected. | Menu item | Windows shortcut | Mac shortcut | Description | |-----------|-----------------|--------------|-------------| -| Code | Space | Space | Opens the code editor for the component. | -| Advanced Settings | Ctrl + Shift + A | ⌘ + Shift + A | Opens advanced settings for the component. | -| Save Changes | Ctrl + S | ⌘ + S | Saves changes to the current flow. | -| Save Component | Ctrl + Alt + S | ⌘ + Alt + S | Saves the current component to Saved components. | -| Duplicate | Ctrl + D | ⌘ + D | Creates a duplicate of the component. | -| Copy | Ctrl + C | ⌘ + C | Copies the selected component. | -| Cut | Ctrl + X | ⌘ + X | Cuts the selected component. | -| Paste | Ctrl + V | ⌘ + V | Pastes the copied/cut component. | -| Docs | Ctrl + Shift + D | ⌘ + Shift + D | Opens related documentation. | -| Minimize | Ctrl + . | ⌘ + . | Minimizes the current component. | -| Freeze| Ctrl + Shift + F | ⌘ + Shift + F | Freezes component state and upstream components. | -| Download | Ctrl + J | ⌘ + J | Downloads the component as JSON. | -| Delete | Backspace | Backspace | Deletes the component. | -| Group | Ctrl + G | ⌘ + G | Groups selected components. | -| Undo | Ctrl + Z | ⌘ + Z | Undoes the last action. | -| Redo | Ctrl + Y | ⌘ + Y | Redoes the last undone action. | -| Redo (alternative) | Ctrl + Shift + Z | ⌘ + Shift + Z | Alternative shortcut for redo. | -| Share Component | Ctrl + Shift + S | ⌘ + Shift + S | Shares the component. | -| Share Flow | Ctrl + Shift + B | ⌘ + Shift + B | Shares the entire flow. | -| Toggle Sidebar | Ctrl + B | ⌘ + B | Shows/hides the sidebar. | -| Search Components | / | / | Focuses the component search bar. | -| Tool Mode | Ctrl + Shift + M | ⌘ + Shift + M | Toggles tool mode. | -| Update | Ctrl + U | ⌘ + U | Updates the component. | -| Open Playground | Ctrl + K | ⌘ + K | Opens the playground. | -| Output Inspection | O | O | Opens output inspection. | -| Play | P | P | Plays/executes the flow. | -| API | R | R | Opens the API view. | +| Code | Space | Space | Opens the code editor for the component. | +| Advanced Settings | Ctrl + Shift + A | + Shift + A | Opens advanced settings for the component. | +| Save Changes | Ctrl + S | + S | Saves changes to the current flow. | +| Save Component | Ctrl + Alt + S | + Alt + S | Saves the current component to Saved components. | +| Duplicate | Ctrl + D | + D | Creates a duplicate of the component. | +| Copy | Ctrl + C | + C | Copies the selected component. | +| Cut | Ctrl + X | + X | Cuts the selected component. | +| Paste | Ctrl + V | + V | Pastes the copied/cut component. | +| Docs | Ctrl + Shift + D | + Shift + D | Opens related documentation. | +| Minimize | Ctrl + . | + . | Minimizes the current component. | +| Freeze| Ctrl + Shift + F | + Shift + F | Freezes component state and upstream components. | +| Download | Ctrl + J | + J | Downloads the component as JSON. | +| Delete | Backspace | Backspace | Deletes the component. | +| Group | Ctrl + G | + G | Groups selected components. | +| Undo | Ctrl + Z | + Z | Undoes the last action. | +| Redo | Ctrl + Y | + Y | Redoes the last undone action. | +| Redo (alternative) | Ctrl + Shift + Z | + Shift + Z | Alternative shortcut for redo. | +| Share Component | Ctrl + Shift + S | + Shift + S | Shares the component. | +| Share Flow | Ctrl + Shift + B | + Shift + B | Shares the entire flow. | +| Toggle Sidebar | Ctrl + B | + B | Shows/hides the sidebar. | +| Search Components | / | / | Focuses the component search bar. | +| Tool Mode | Ctrl + Shift + M | + Shift + M | Toggles tool mode. | +| Update | Ctrl + U | + U | Updates the component. | +| Open Playground | Ctrl + K | + K | Opens the playground. | +| Output Inspection | O | O | Opens output inspection. | +| Play | P | P | Plays/executes the flow. | +| API | R | R | Opens the API view. | ## Group components in the workspace Multiple components can be grouped into a single component for reuse. This is useful when combining large flows into single components, for example RAG with a vector database, and saving space. -1. Hold **Shift** and drag to select components. -2. Select **Group**. +1. Hold Shift and drag to select components. + The components merge into a single component. -3. Double-click the name and description to change them. -4. Save your grouped component to the sidebar for later use. + +2. To modify the name and description of the single grouped component, in the grouped component, click the icon. +3. Save your grouped component to the sidebar for later use. ## Component version @@ -209,6 +209,8 @@ A component's initial state is stored in a database. As soon as you drag a compo A component keeps the version number it is initialized to the workspace with. If a component is at version `1.0` when it is dragged to the workspace, it will stay at version `1.0` until you update it. +Langflow notifies you when a component's workspace version is behind the database version and an update is available. + ### Review and update components When a component's workspace version is behind the database version and an update is available, the component displays a notification. @@ -232,10 +234,15 @@ If you created a backup flow, it's available in the same project folder as the o Components are listed in the sidebar by component type. -Component **bundles** are components grouped by provider. For example, Langchain modules like **RunnableExecutor** and **CharacterTextSplitter** are grouped under the **Langchain** bundle. - -The sidebar includes a component **Search** bar, and includes flags for showing or hiding **Beta** and **Legacy** components. +**Bundles** are components grouped by provider. For example, Langchain modules like **RunnableExecutor** and **CharacterTextSplitter** are grouped under the **Langchain** bundle. **Beta** components are still being tested and are not suitable for production workloads. -Legacy components are available for use but are no longer supported. \ No newline at end of file +**Legacy** components are available for use but are no longer supported. By default, legacy components are hidden in the sidebar. + +The sidebar includes a component **Search** bar with options for showing or hiding **Beta** and **Legacy** components. +To change the sidebar's behavior, click the