-
Notifications
You must be signed in to change notification settings - Fork 137
feat: langflow ai integration docs #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b378040
initial version
MQ37 c755777
Merge branch 'master' into feat/langflow-integration
MQ37 9750cdd
lint
MQ37 c7bdb40
white theme screens, use openai in example run
MQ37 bdb3568
add langflow vale exception
MQ37 019ca47
improve text to align with guidelines
MQ37 27e2b4f
add section on how to call the actors, improve docs
MQ37 6c494a5
Merge branch 'master' into feat/langflow-integration
MQ37 5237737
Update sources/platform/integrations/ai/langflow.md
MQ37 7bcfd2c
Update sources/platform/integrations/ai/langflow.md
MQ37 bb8e2f8
Update sources/platform/integrations/ai/langflow.md
MQ37 c17648d
Update sources/platform/integrations/ai/langflow.md
MQ37 fa0caf7
Update sources/platform/integrations/ai/langflow.md
MQ37 457a7e3
remove the separator
MQ37 b27947f
Merge branch 'master' into feat/langflow-integration
MQ37 dea7c21
Update sources/platform/integrations/ai/langflow.md
MQ37 cf05aca
Update sources/platform/integrations/ai/langflow.md
MQ37 605ac2e
remove new flow screen, split use cases into bullet points, implement…
MQ37 98360ca
simplify, remove obvious ui steps screens
MQ37 4be4887
lint
MQ37 18ca140
add prerequisites section
MQ37 2b3ded8
rework screens with flatten output wihout question mark, simplify and…
MQ37 c46739b
fix typos
MQ37 ed57fa6
unify agent keyword caps, agent -> AI agent, Agent -> component
MQ37 66275c2
Merge branch 'master' into feat/langflow-integration
MQ37 b7c2ffb
Update sources/platform/integrations/ai/langflow.md
MQ37 7653ab2
convert Prerequisites to unordered list
MQ37 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,10 @@ preconfigured | |
| asyncio | ||
| parallelization | ||
| IMDb | ||
|
|
||
|
|
||
| Langflow | ||
|
|
||
| iPhone | ||
| iPhones | ||
| iPad | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| --- | ||
| title: Langflow integration | ||
| sidebar_label: Langflow | ||
| description: Learn how to integrate Apify with Langflow low-code tool to build powerful AI agents and workflows that can use any API, model, or database. | ||
| sidebar_position: 1 | ||
| slug: /integrations/langflow | ||
| --- | ||
|
|
||
| **Learn how to integrate Apify with Langflow to run complex AI agent workflows.** | ||
|
|
||
| --- | ||
|
|
||
| ## What is Langflow | ||
|
|
||
| [Langflow](https://langflow.org/) is a low-code, visual tool that enables developers to build powerful AI agents and workflows that can use any API, models, or databases. | ||
|
|
||
| :::note Explore Langflow | ||
|
|
||
| For more information on Langflow, visit its [documentation](https://docs.langflow.org/). | ||
|
|
||
| ::: | ||
|
|
||
| ## How to use Apify with Langflow | ||
|
|
||
| This guide will demonstrate two different ways to use Apify Actors with Langflow: | ||
|
|
||
| - **Calling Apify Actors in Langflow**: We will use the [RAG Web Browser](https://apify.com/apify/rag-web-browser) Actor to search Google for a query and extract the search results. | ||
| - **Building a flow to search for a company's social media profiles**: We will use the [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) Actor to search the web for social media profiles of a given company. Then, we will use the [TikTok Data Extractor](https://apify.com/clockworks/free-tiktok-scraper) Actor to extract data from the TikTok profiles. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| #### Apify API token | ||
|
|
||
| To use Apify Actors in Langflow, you need an Apify API token. If you don't have one, you can learn how to obtain it in the [Apify documentation](https://docs.apify.com/platform/integrations/api). | ||
|
|
||
| #### OpenAI API key | ||
|
|
||
| In order to work with agents in Langflow, you need an OpenAI API key. If you don't have one, you can get it from the [OpenAI platform](https://platform.openai.com/account/api-keys). | ||
|
|
||
| #### Langflow | ||
|
|
||
| :::note Cloud vs local setup | ||
|
|
||
| Langflow can either be installed locally or used in the cloud. The cloud version is available on the [Langflow](http://langflow.org/) website. If you are using the cloud version, you can skip the installation step, and go straight to [Creating a new flow](#creating-a-new-flow) | ||
|
|
||
| ::: | ||
|
|
||
| First, we need to install the Langflow platform using python package and project manager [uv](https://docs.astral.sh/uv/): | ||
|
|
||
| ```bash | ||
| uv pip install langflow | ||
| ``` | ||
|
|
||
| After successfully installing Langflow, we can start the platform: | ||
|
|
||
| ```bash | ||
| uv run langflow run | ||
| ``` | ||
|
|
||
| When the platform is started, open the [Langflow UI](http://127.0.0.1:7860) in your browser. | ||
|
|
||
| > Other installation methods can be found in the [Langflow documentation](https://docs.langflow.org/get-started-installation). | ||
|
|
||
| ### Creating a new flow | ||
|
|
||
| On the Langflow welcome screen, click the **New Flow** button and then create **Blank Flow**: | ||
|  | ||
|
|
||
| Now, we can start building our flow. | ||
|
|
||
| ### Calling Apify Actors in Langflow | ||
|
|
||
| To call Apify Actors in Langflow, we need to add the **Apify Actors** component to the flow. | ||
| From the bundle menu, add **Apify Actors** component: | ||
|  | ||
|
|
||
| Next, we need to configure the Apify Actors components. First, input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)). Then, set the Actor ID of the component to `apify/rag-web-browser` to use the [RAG Web Browser](https://apify.com/apify/rag-web-browser). Set the **Run input** field to pass arguments to the Actor run, allowing it to search Google with the query `"what is monero?"` (full Actor input schema can be found [here](https://apify.com/apify/rag-web-browser/input-schema)): | ||
|
|
||
| ```json | ||
| {"query": "what is monero?", "maxResults": 3} | ||
| ``` | ||
|
|
||
| Now, we can run the component by clicking the **Run** button. | ||
|  | ||
|
|
||
| Once the run is finished, we can view the output by clicking the **Output** button. | ||
|  | ||
|
|
||
| The output should look similar to this: | ||
|  | ||
|
|
||
| To filter only the `metadata` and `markdown` fields, set **Output fields** to `metadata,markdown`. Additionally, enable **Flatten output** by setting it to `true`. This will output only the metadata and text content from the search results. | ||
| > Flattening is necessary when you need to access nested dictionary fields in the output data object; they cannot be accessed directly otherwise in the Data object. | ||
|
|
||
|  | ||
|
|
||
| When you run the component again, the output contains only the `markdown` and flattened `metadata` fields: | ||
|
|
||
|  | ||
|
|
||
| Now that we understand how to call Apify Actors, let's build a practical example where we search for a company's social media profiles and extract data from them. | ||
|
|
||
| ### Building a flow to search for a company's social media profiles | ||
|
|
||
| Create a new flow and add two **Apify Actors** components from the menu. | ||
|
|
||
| Input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)) and set the Actor ID of the first component to `apify/google-search-scraper` and the second one to `clockworks/free-tiktok-scraper`: | ||
|  | ||
|
|
||
| Add the **Agent** component from the menu and set your OpenAI API key (get it [here](https://platform.openai.com/account/api-keys)): | ||
| :::tip Optimize Agent results | ||
|
|
||
| For better results, switch the model to `gpt-4o` instead of `gpt-4o-mini` in the Agent configuration | ||
|
|
||
| ::: | ||
|  | ||
MQ37 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| To be able to interact with the agent, add **Chat Input** and **Chat Output** components from the menu and connect them to the Agent component **Input** and **Response**. | ||
| Then connect both Apify Actor components **Tool** outputs to the Agent component **Tools** input so that the agent can call the Apify Actors. The final flow that can search the web for a company's social media profiles and extract data from them should look like this: | ||
|  | ||
|
|
||
| Click the **Playground** button and chat with the agent to test the flow: | ||
|  | ||
|
|
||
| Here is an example agent output for the following query: | ||
|
|
||
| ```text | ||
| find tiktok profile of company openai using google search and then show me the profile bio and their latest video | ||
| ``` | ||
|
|
||
|  | ||
Binary file added
BIN
+21.8 KB
sources/platform/integrations/images/langflow/agent_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.4 KB
sources/platform/integrations/images/langflow/apify_actors_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.9 KB
sources/platform/integrations/images/langflow/apify_actors_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.5 KB
sources/platform/integrations/images/langflow/apify_actors_output_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.7 KB
...ces/platform/integrations/images/langflow/apify_actors_output_data_filtered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
sources/platform/integrations/images/langflow/apify_actors_output_filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.4 KB
sources/platform/integrations/images/langflow/chat_message_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.