[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url]
An AI chatbot built with RAG functionality
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
![Product Name Screen Shot][product-screenshot]
Akillah AI is a Retrival Augmented Generation Chatbot that extends OpenAI's text generation and conversational AI functionalities by allowing the models to access and leverage external knowledge bases
Retrieval-augmented generation (RAG) is an AI framework that combines the strengths of pre-trained language models and information retrieval systems to generate responses in a conversational AI system or to create content by leveraging external knowledge. It integrates the retrieval of relevant information from a knowledge source and the generation of responses based on that retrieved information.
Existing LLMs can reason about wide-ranging topics, but their knowledge is limited to the public data up to a specific point in time that they were trained on. This application augments the knowledge of the models with the specific information it needs so it can reason about private data or data introduced after a model's cutoff date.
This application has 3 parts to it:
This is the main part of the application that incorporates the actual RAG chain, which takes the user query at run time and retrieves the relevant data from the index (data source), then passes that to the model. The retrieved documents or snippets or information is then provided to a large language model, which uses them as additional context for generating a more detailed, factual, and relevant response.
This functionality of the chatbot is exposed through REST API calls
This is the part of the application that consumes the REST API created from the Chatmodel in a User Interface
This is the part of the application that exposes the RAG augmented chatbot created to users through a Discord chatbot. Users can query the model through Discord in addition to the UI
Chatbot UI Discord chatbot
To get started with this project, you will need:
- OpenAI API keys
- Discord Token
- Pinecone API Key
Clone the repo
git clone git@github.com:nyangoto/Akilah_AI.git
Create a .env file at the root of the project and define the environmet variables needed:
PINECONE_API_KEY PINECONE_ENV OPENAI_API_KEY DOCKER_IMAGE PORT
Create a virtual environment to run your application and activate it
python3 -m venv <virtual-environment-name> souce <virtual-environment-name>/bin/activate
Install the necessary requirements in the virtual environment
pip install -r requirements.txt
Run the chatbot app
Using python:
python3 chat.py
Or using docker:
sudo docker compose -p <docker-image-name> up --build
You should get a confimation like the one below of the API endpoint of the chatbot. Refer to url/docs for documentation on the API
Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Distributed under the MIT License. See LICENSE.txt for more information.
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!