docs: v1.1.2 (#5850)

* docs:add-changelog-to-nav

* docs: add OpenRouter component documentation with detailed inputs and outputs

* docs: add Outputs section to components-models documentation for Cohere and Ollama

* docs: update references from configuration-objects to concepts-objects across multiple components and documentation files

* feat: Add DataFrame operations section to components-processing documentation

* title-case-in-nav

* fix-memories-tab-in-chat-memory

* tool-calling-agent-update

* feat: enhance documentation with icon imports and improved instructions for OpenAI component

* material-icon

* fix: update documentation for tool mode input connection in agent component

* add-loop-component

* add-img-for-loop-summary

* feat: add documentation for using logic components in a flow with examples

* fix: enhance documentation for Loop component with detailed data flow explanation

* redirect-for-config-objects-page

* fix: improve error handling in data processing module

* fix: update documentation for Data objects in Loop component and add import statement in memory chatbot tutorial

* quickstart-screenshots

* docs: update starter flow images

* update-agent-screenshots

* move-repl-agent

* docs: enhance global variables documentation and clarify prerequisites for vector store RAG flow

* docs: update Simple Agent to use URL component

* docs: enhance memory chatbot tutorial with example conversation and clarify session ID terminology

* docs: update visibility icon description in concepts-components.md

* Apply suggestions from code review

Co-authored-by: brian-f <brian.fisher@datastax.com>

* correct-playground-sequence-and-typo

---------

Co-authored-by: brian-f <brian.fisher@datastax.com>
This commit is contained in:
Mendon Kissling 2025-01-24 09:24:57 -05:00 • committed by GitHub
commit 0d11564dea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 917 additions and 1370 deletions

View file

@ -1,62 +1,56 @@
---
title: Basic Prompting
title: Basic prompting
slug: /starter-projects-basic-prompting
---
import Icon from "@site/src/components/icon";
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.
This article demonstrates how to use Langflow's prompt tools to issue basic prompts to an LLM, and how various prompting strategies can affect your outcomes.
## Prerequisites {#20bd7bc51ce04e2fb4922c95f00870d3}
---
## Prerequisites
- [Langflow installed and running](/get-started-installation)
- [OpenAI API key created](https://platform.openai.com/)
## Create the basic prompting flow {#19d5305239c841548a695e2bf7839e7a}
## Create the basic prompting flow
1. From the Langflow dashboard, click **New Flow**.
2. Select **Basic Prompting**.
3. The **Basic Prompting** flow is created.
![](/img/starter-flow-basic-prompting.png)
This flow allows you to chat with the **OpenAI** component through the **Prompt** component.
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.
Examine the **Prompt** component. The **Template** field instructs the LLM to `Answer the user as if you were a pirate.` This should be interesting...
```plain
Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.
```
4. To create an environment variable for the **OpenAI** component, in the **OpenAI API Key** field, click the **Globe** button, and then click **Add New Variable**.
5. To create an environment variable for the **OpenAI** component, in the **OpenAI API Key** field, click the <Icon name="Globe" aria-label="Globe icon" /> **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
## Run the basic prompting flow {#ce52f8e6b491452a9dfb069feb962eed}
1. Click the **Playground** button on the control panel (bottom right side of the workspace). This is where you can interact with your AI.
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 {#3ab045fcbe774c8fb3adc528f9042ba0}
## Modify the prompt for a different result
1. To modify your prompt results, in the **Prompt** template, click the **Template** field. The **Edit Prompt** window opens.
2. Change `Answer the user as if you were a pirate` to a different character, perhaps `Answer the user as if you were Hermione Granger.`
3. Run the workflow again. The response will be markedly different.
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.

View file

@ -3,11 +3,12 @@ title: Simple agent
slug: /starter-projects-simple-agent
---
Build a **Simple Agent** flow for an agentic application using the Tool-calling agent.
Build a **Simple Agent** flow for an agentic application using the **Tool-calling agent** component.
An **agent** uses an LLM as its "brain" to select among the connected tools and complete its tasks.
In this flow, the **Tool-calling agent** reasons using an **Open AI** LLM to solve math problems. It will select the **Calculator** tool for simpler math, and the **Python REPL** tool (with the Python `math` library) for more complex problems.
In this flow, the **Tool-calling agent** reasons using an **Open AI** LLM.
The agent selects the **Calculator** tool for simple math problems and the **URL** tool to search a URL for content.
## Prerequisites
@ -21,12 +22,12 @@ This opens a starter flow with the necessary components to run an agentic applic
## Simple Agent flow
![](/img/starter-flow-simple-agent.png)
<img src="/img/starter-flow-simple-agent.png" alt="Starter flow simple agent" width="75%"/>
The **Simple Agent** flow consists of these components:
* The **Tool calling agent** component uses the connected LLM to reason through the user's input and select among the connected tools to complete its task.
* The **Python REPL tool** component executes Python code in a REPL (Read-Evaluate-Print Loop) interpreter.
* The **URL** tool component searches a list of URLs for content.
* The **Calculator** component performs basic arithmetic operations.
* The **Chat Input** component accepts user input to the chat.
* The **Prompt** component combines the user input with a user-defined prompt.
@ -36,22 +37,30 @@ The **Simple Agent** flow consists of these components:
## Run the Simple Agent flow
1. Add your credentials to the Open AI component.
2. In the **Chat output** component, click ▶️ Play to start the end-to-end application flow.
A **Chat output built successfully** message and a ✅ Check on all components indicate that the flow ran successfully.
3. Click **Playground** to start a chat session.
4. Enter a simple math problem, like `2 + 2`, and then make sure the bot responds with the correct answer.
5. To confirm the REPL interpreter is working, prompt the `math` library directly with `math.sqrt(4)` and see if the bot responds with `4`.
6. The agent will also reason through more complex word problems. For example, prompt the agent with the following math problem:
2. Click **Playground** to start a chat session.
3. To confirm the tools are connected, ask the agent, `What tools are available to you?`
The response is similar to the following:
```plain
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 data 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 will tell 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:
```plain
The equation 24x2+25x−47ax−2=−8x−3−53ax−2 is true for all values of x≠2a, where a is a constant.
What is the value of a?
A) -16
B) -3
C) 3
D) 16
Final Attributes
Strength (STR): 10
Constitution (CON): 12
Size (SIZ): 14
Dexterity (DEX): 9
Intelligence (INT): 11
Power (POW): 13
Charisma (CHA): 8
```
The agent should respond with `B`.
Now that your query has completed the journey from **Chat input** to **Chat output**, you have completed the **Simple Agent** flow.

View file

@ -1,9 +1,9 @@
---
title: Vector Store RAG
title: Vector store RAG
slug: /starter-projects-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.
@ -17,65 +17,55 @@ 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 {#6aa2c6dff6894eccadc39d4903d79e66}
## Prerequisites
* [An OpenAI API key](https://platform.openai.com/)
* [An Astra DB vector database](https://docs.datastax.com/en/astra-db-serverless/get-started/quickstart.html) with:
* An Astra DB application token
* [A collection in Astra](https://docs.datastax.com/en/astra-db-serverless/databases/manage-collections.html#create-collection)
---
- [Langflow installed and running](https://docs.langflow.org/get-started-installation)
- [OpenAI API key](https://platform.openai.com/)
- [An Astra DB vector database created](https://docs.datastax.com/en/astra-db-serverless/get-started/quickstart.html) with:
- Application Token
- API Endpoint
## Create the vector store RAG flow
## 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.
![](/img/starter-flow-vector-rag.png)
## Build the vector RAG flow
The vector store RAG flow is built of two separate flows for ingestion and query.
![](/img/starter-flow-vector-rag.png)
The **ingestion** part (bottom of the screen) populates the vector store with data from a local file. It ingests data from a file (**File**), splits it into chunks (**Split Text**), indexes it in Astra DB (**Astra DB**), and computes embeddings for the chunks using an embedding model (**OpenAI Embeddings**).
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 OpenAI embeddings model.
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.
:::tip
- **Chat Input** receives user input from the **Playground**.
- **OpenAI Embeddings** converts the user query into vector form.
- **Astra DB** performs similarity search using the query vector.
- **Parse Data** processes the retrieved chunks.
- **Prompt** combines the user query with relevant context.
- **OpenAI** generates the response using the prompt.
- **Chat Output** returns the response to the **Playground**.
Embeddings are numerical vectors that represent data meaningfully. They enable efficient similarity searches in vector stores by placing similar items close together in the vector space, enhancing search and recommendation tasks.
:::
This part creates a searchable index to be queried for contextual similarity.
The **query** part (top of the screen) allows users to retrieve embedded vector store data. Components:
- **Chat Input** defines where to send the user input (coming from the Playground).
- **OpenAI Embeddings** is the model used to generate embeddings from the user input.
- **Astra DB** retrieves the most relevant chunks from the Astra DB database (here, used for search, not ingestion).
- **Parse Data** converts chunks coming from the **Astra DB** component into plain text to feed a prompt.
- **Prompt** takes in the user input and the retrieved chunks as text and builds a prompt for the model.
- **OpenAI** takes in the prompt to generate a response.
- **Chat Output** component displays the response in the Playground.
1. To create an environment variable for the **OpenAI** component, in the **OpenAI API Key** field, click the **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**.
1. To create environment variables for the **Astra DB** and **Astra DB Search** components:
1. In the **Token** field, click the **Globe** button, and then click **Add New Variable**.
2. In the **Variable Name** field, enter `astra_token`.
3. In the **Value** field, paste your Astra application token (`AstraCS:WSnyFUhRxsrg…`).
1. Configure the **OpenAI** model component.
1. To create a global variable for the **OpenAI** component, in the **OpenAI API Key** field, click the <Icon name="Globe" aria-label="Globe" /> **Globe** button, 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**.
5. Repeat the above steps for the **API Endpoint** field, pasting your Astra API Endpoint instead (`https://ASTRA_DB_ID-ASTRA_DB_REGION.apps.astra.datastax.com`).
6. Add the global variable to both the **Astra DB** and **Astra DB Search** components.
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**.
3. Select your **Collection**. Collections are created in your [Astra DB deployment](https://astra.datastax.com) for storing vector data.
If you don't have a collection, see the [DataStax Astra DB Serverless documentation](https://docs.datastax.com/en/astra-db-serverless/databases/manage-collections.html#create-collection).
4. Select **Embedding Model** to bring your own embeddings model, which is the connected **OpenAI Embeddings** component.
The **Dimensions** value must match the dimensions of your collection. You can find this value in the **Collection** in your [Astra DB deployment](https://astra.datastax.com).
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