RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngr
RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngr
RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. It is boilerplate and a reference implementation of Rasa and Telegram utilizing an LLM library like Langchain for indexing, retrieval and context injection.
In their own words:
Rasa is an open source (Python) machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
In my words:
Rasa is a very popular (dare I say de facto?) and easy-enough to use chatbot framework with built in NLU ML pipelines that are obsolete and a conceptual starting point for a reimagined chatbot framework in a world of LLMs.
RasaGPT works out of the box. A lot of the implementing headaches were sorted out so you don’t have to, including:
The backstory is familiar. A friend came to me with a problem. I scoured Google and Github for a decent reference implementation of LLM’s integrated with Rasa but came up empty-handed. I figured this to be a great opportunity to satiate my curiosity and 2 days later I had a proof of concept, and a week later this is what I came up with.
⚠️ Caveat emptor: This is far from production code and rife with prompt injection and general security vulnerabilities. I just hope someone finds this useful
Getting started is easy, just make sure you meet the dependencies below.
⚠️⚠️⚠️ ** ATTENTION NON-MACOS USERS: ** If you are using Linux or Windows, you will need to change the image name from
khalosa/rasa-aarch64:3.5.2torasa/rasa:latestin docker-compose.yml on line #64 and in the actions Dockerfile on line #1 here
# Get the code
git clone https://github.com/paulpierre/RasaGPT.git
cd RasaGPT
## Setup the .env file
cp .env-example .env
# Edit your .env file and add all the necessary credentials
make install
# Type "make" to see more options
makehttps://t.me/yourbotnamegit clone https://github.com/paulpierre/RasaGPT.git
cd RasaGPT
cp .env-example .env
# Edit your .env file and all the credentials
At any point feel free to just type in make and it will display the list of options, mostly useful for debugging:
The easiest way to get started is using the Makefile in the root directory. It will install and run all the services for RasaGPT in the correct order.
make install
# This will automatically install and run RasaGPT
# After installation, to run again you can simply run
make runThis is useful if you wish to focus on developing on top of the API, a separate Makefile was made for this. This will create a local virtual environment for you.
# Assuming you are already in the RasaGPT directory
cd app/api
make install
# This will automatically install and run RasaGPT
# After installation, to run again you can simply run
make runSimilarly, enter make to see a full list of commands
Installation should be automated should look like this:
Full installation log: https://app.warp.dev/block/vflua6Eue29EPk8EVvW8Kd
The installation process for Docker takes the following steps at a high level
.env availablepgvectorseed.pyYou can start chatting with your bot by visiting https://t.me/yourbotsname
You can view all of the log by visiting https://localhost:9999/ which will displaying real-time logs of all the docker containers
View the API endpoint docs by visiting https://localhost:8888/docs
In this page you can create and update entities, as well as upload documents to the knowledge base.
The bot is just a proof-of-concept and has not been optimized for retrieval. It currently uses 1000 character length chunking for indexing and basic euclidean distance for retrieval and quality is hit or miss.
You can view example hits and misses with the bot in the RESULTS.MD file. Overall I estimate index optimization and LLM configuration changes can increase output quality by more than 70%.
Click to see the Q&A results of the demo data in RESULTS.MD
The REST API is straight forward, please visit the documentation http://localhost:8888/docs
The entities below have basic CRUD operations and return JSON
This can be thought of as a company that is your client in a SaaS / multi-tenant world. By default a list of dummy organizations have been provided
…This can be thought of as a product that belongs to a company. You can view the list of projects that belong to an organizations like so:
…This can be thought of as an artifact related to a product, like an FAQ page or a PDF with financial statement earnings. You can view all the Documents associated with an Organization’s Project like so:
…Although this is not exposed in the API, a node is a chunk of a document which embeddings get generated for. Nodes are used for retrieval search as well as context injection. A node belongs to a document.
A user represents the person talking to a bot. Users do not necessarily belong to an org or product, but this relationship is captured in ChatSession below.
Not exposed via API, but this represent a question and answer between the User and a bot. Each of these objects can be flexibly identified by a session_id which gets automatically generated. Chat Sessions contain rich metadata that can be used for training and optimization. ChatSessions via the /chat endpoint ARE in fact associated with organization (for multi-tenant security purposes)
/webhooks/{channel}/webhookFallbackClassifier thresholdrasa-credentials via app/rasa-credentials/main.pyNo open issues yet, or sync has not completed.