Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

RasaGPT

> 后端框架
Open source

RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngr

2.5K stars0 likes0 views
WebsiteGitHub

About

RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngr



Overview

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.


  • Resources: https://rasagpt.dev
  • ‍ Github: https://github.com/paulpierre/RasaGPT
  • Author: @paulpierre





What is Rasa?

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.



‍♀️ Why RasaGPT?

RasaGPT works out of the box. A lot of the implementing headaches were sorted out so you don’t have to, including:

  • Creating your own proprietary bot end-point using FastAPI, document upload and “training” 'pipeline included
  • How to integrate Langchain/LlamaIndex and Rasa
  • Library conflicts with LLM libraries and passing metadata
  • Dockerized support on MacOS for running Rasa
  • Reverse proxy with chatbots via ngrok
  • Implementing pgvector with your own custom schema instead of using Langchain’s highly opinionated PGVector class
  • Adding multi-tenancy (Rasa doesn't natively support this), sessions and metadata between Rasa and your own backend / application

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



✨ Quick start

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.2 to rasa/rasa:latest in docker-compose.yml on line #64 and in the actions Dockerfile on line #1 here


bash
# 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
make



Features

Full Application and API

  • LLM “learns” on an arbitrary corpus of data using Langchain
  • Upload documents and “train” all via FastAPI
  • Document versioning and automatic “re-training” implemented on upload
  • Customize your own async end-points and database models via FastAPI and SQLModel
  • Bot determines whether human handoff is necessary
  • Bot generates tags based on user questions and response automatically
  • Full API documentation via Swagger and Redoc included
  • PGAdmin included so you can browser your database
  • Ngrok end-points are automatically generated for you on startup so your bot can always be accessed via https://t.me/yourbotname
  • Embedding similarity search built into Postgres via pgvector and Postgres functions
  • Dummy data included for you to test and experiment
  • Unlimited use cases from help desk, customer support, quiz, e-learning, dungeon and dragons, and more



Rasa integration

  • Built on top of Rasa, the open source gold-standard for chat platforms
  • Supports MacOS M1/M2 via Docker (canonical Rasa image lacks MacOS arch. support)
  • Supports Telegram, easily integrate Slack, Whatsapp, Line, SMS, etc.
  • Setup complex dialog pipelines using NLU models form Huggingface like BERT or libraries/frameworks like Keras, Tensorflow with OpenAI GPT as fallback



Flexibility

  • Extend agentic, memory, etc. capabilities with Langchain
  • Schema supports multi-tenancy, sessions, data storage
  • Customize agent personalities
  • Saves all of chat history and creating embeddings from all interactions future-proofing your retrieval strategy
  • Automatically generate embeddings from knowledge base corpus and client feedback



‍ Installing

Requirements

  • Python 3.9
  • Docker & Docker compose (Docker desktop MacOS)
  • Open AI API key
  • Telegram bot credentials
  • Ngrok auth token
  • Make (MacOS/Windows)
  • SQLModel

Setup

bash
git 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:



Docker-compose

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.

bash
make install

# This will automatically install and run RasaGPT
# After installation, to run again you can simply run

make run

Local Python Environment

This 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.

bash
# 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 run

Similarly, enter make to see a full list of commands


Installation process

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

  1. Check to make sure you have .env available
  2. Database is initialized with pgvector
  3. Database models create the database schema
  4. Trains the Rasa model so it is ready to run
  5. Sets up ngrok with Rasa so Telegram has a webhook back to your API server
  6. Sets up the Rasa actions server so Rasa can talk to the RasaGPT API
  7. Database is populated with dummy data via seed.py



☑️ Next steps


Start chatting

You can start chatting with your bot by visiting https://t.me/yourbotsname



View logs

You can view all of the log by visiting https://localhost:9999/ which will displaying real-time logs of all the docker containers



API documentation

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.



✏️ Examples

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



API Architecture and Usage

The REST API is straight forward, please visit the documentation  http://localhost:8888/docs

The entities below have basic CRUD operations and return JSON



Organization

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

…

Project

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:

…

Document

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:

…

Node

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.


User

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.


ChatSession

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)



** How it works**


Rasa

  1. Rasa handles integration with the communication channel, in this case Telegram.
    • It specifically handles submitting the target webhook user feedback should go through. In our case it is our FastAPI server via /webhooks/{channel}/webhook
  2. Rasa has two components, the core Rasa app and an Rasa actions server that runs separately
  3. Rasa must be configured (done already) via a few yaml files:
    • config.yml - contains NLU pipeline and policy configuration. What matters is setting the FallbackClassifier threshold
    • credentials.yml - contains the path to our webhook and Telegram credentials. This will get updated by the helper service rasa-credentials via app/rasa-credentials/main.py
    • domain.yml - This contains

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonaichatbotchatgptfastapi

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架