AI

Langflow

What is Langflow?

Langflow is a new, visual framework for building multi-agent and RAG applications. It is open-source, Python-powered, fully customizable, and LLM and vector store agnostic.

Install

  1. Install UV
> curl -LsSf https://astral.sh/uv/install.sh | sh

#or

> pip install uv
  1. Install Langflow
> conda create -n langflow python=3.12
> conda activate langflow
> uv pip install langflow
  1. Upgrading Langflow
> pip install --upgrade langflow

Getting Started

Prerequisites

  • Get Langflow API Key here
  • An Astra DB vector database with:
    • AstraDB application token
    • API endpoint
    • A collection in Astra
> uv run langflow run

To make Langflow publicly accessible, execute the following command in place of the previous one:

> uv run langflow run --host 0.0.0.0 --port 7860

System Service

To make Langflow start automatically when it is installed in a Conda virtual environment, you can create a systemd service.

Here’s how to do it:

  1. Locate the Langflow Executable
> conda activate langflow
> which langflow

It returns result like this:

/home/ubuntu/miniconda3/envs/langflow/bin/langflow

  1. Create a Systemd Service
> sudo nano /etc/systemd/system/langflow.service
[Unit]
Description=Langflow Service
After=network.target

[Service]
Type=simple
User=ubuntu
ExecStart=/home/ubuntu/miniconda3/envs/langflow/bin/uv run langflow run
Restart=always
Environment="PATH=/home/ubuntu/miniconda3/envs/langflow/bin/:$PATH"
Environment="DO_NOT_TRACK=true"

[Install]
WantedBy=multi-user.target
  1. Enable the Service
> sudo systemctl daemon-reload
> sudo systemctl enable langflow
> sudo systemctl start langflow
  1. Verify the Service
> sudo systemctl status langflow
  1. Check processes for Langflow
> ps aux | grep langflow

Ngrok

  1. Create or edit the Ngrok config file:
> nano ~/.config/ngrok/ngrok.yml

#or

> ngrok config edit
  1. Place the configurations into the config file:
version: 3
agent:
  authtoken: 2kn*********
tunnels:
  langflow:
    proto: http
    addr: 7860
Previous
Isaac