Published on

Langflow basics

Some early impressions working with Langflow to build a simple RAG tool.

Langflow RAG canvas

It's super handy for getting something up and running quickly.

You can hook up a vector database to an LLM agent in 60 seconds!

If you want to take it a bit further you run into limitations pretty quickly.

One error I ran into almost immediately:

Multiple tools feeding into an agent

By default a lot of the components name their outputs the same (Data or Dataframe). An agent needs a unique tool name when selecting a tool to use. If you just connect multiple tools to an agent Langflow will error.

Error building Component. Please check if you are importing Component correctly.

To fix this you can manually update the code of one of the input components.

Edit Langflow component

outputs = [
    Output(display_name="Files", name="load_directory", method="load_directory")
    ]

Even more confusing is that the display_name or name fields of the output array are not the fields that need to be unique - it's the method (which is also used to identify what method is called when this tool is used).

Fixing this issue showed me another issue that is a bigger deal if you want to use Langflow for anything more than a hobby project:

Editing code is browser only

The Langflow web app lets you modify code for a component's instance. You can only edit it in the browser though. The data for a flow is stored in a database - there is no folder in the docker image that contains the working code for the flow:

Langflow flow stored in postgres db

This means there's no way to view/edit/manage a flow in an IDE. You must use the browser.

More to come!