Skip to content

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n Workflow Builder

This project is a conversational AI assistant designed to help users build n8n workflows. It uses a retrieval-augmented generation (RAG) approach to provide relevant information from the official n8n documentation.

Features

  • Interactive Chat: A command-line interface for interacting with the assistant.
  • Conversation History: The assistant remembers the context of the conversation.
  • Document Retrieval: The assistant retrieves relevant information from the n8n documentation to answer user questions.
  • Sub-query Generation: The assistant can break down complex questions into smaller, more specific queries to improve retrieval accuracy.

Architecture

The assistant is built using the following technologies:

  • LangChain: A framework for developing applications powered by language models.
  • LangGraph: A library for building stateful, multi-actor applications with LLMs.
  • OpenAI: Used for generating embeddings for the documentation and for sub-query generation.
  • Google Gemini: The primary language model for generating responses.
  • PGVector: A PostgreSQL extension for vector similarity search, used as the vector store for the documentation.
  • Docker: Used to run the PostgreSQL database with the PGVector extension.

Setup and Installation

1. Prerequisites

  • Python 3.x
  • Docker

2. Clone the Repository

git clone <repository-url>
cd <repository-directory>

3. Set up the Environment

Create a .env file in the root of the project and add the following environment variables:

OPENAI_API_KEY="your-openai-api-key"
GOOGLE_API_KEY="your-google-api-key"
DATABASE_URL="postgresql+psycopg://postgres:password@localhost:5432/ragdb"
EMBED_MODEL="text-embedding-3-small"

4. Set up the Database

The project uses a PostgreSQL database with the PGVector extension to store the documentation embeddings. You can use the provided docker-compose.yml file to start a database instance.

docker-compose up -d

5. Install Dependencies

The setup.sh script will create a virtual environment and install the required Python packages.

bash setup.sh

6. Download and Ingest the n8n Documentation

The assistant uses the official n8n documentation to answer questions. You need to download and ingest the documentation into the vector store.

First, activate the virtual environment:

source venv/bin/activate

Then, run the following scripts:

python scripts/download_n8n_docs.py
python scripts/ingest_docs.py

Usage

To start the interactive chat client, run the following command:

python main.py

You can then start asking questions about how to build n8n workflows.

  • To exit the chat, type quit or exit.
  • To save the last assistant response to a PDF, type /save.

About

LangChain implementation of chatting over n8n official documentation.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages