A chatbot to answer questions for the Faculty of Engineering community at the National University of Colombia.
Reprebot uses a method called Retrieval Augmented Generation (RAG). This technique involves utilizing a Language Model (LLM) to generate text using a specific context of information stored in a vector database. In this case, the context revolves around information related to the academic processes within the Faculty of Engineering.
Reprebot will initially be a microservice containerized and ready to be incorporated in any architecture. In the future we may implement a user-friendly interface so that the community can access it in the web at any time. Or it may be integrated in any of the other systems of the Faculty of Engineering.
Reprebot has the following main objectives:
-
Quick Help: Provide fast responses to the Faculty of Engineering community whenever they need assistance, eliminating the need for emails or visiting various departments.
-
Student Support: Assist students throughout their academic journey by offering information on processes, events, and career opportunities.
-
Reduce Workload: Ease the workload of Repreisis and other dependencies within the Faculty of Engineering, enabling them to concentrate on more impactful tasks and better address student needs.
There are various ways to contribute to Reprebot:
-
Join the Team: Interested in being part of the project? Express your interest in joining our team of dedicated volunteers by reaching out to Repreisis through any of their communication channels.
-
Contribute: Share your ideas by submitting them to our issues backlog. Check out our contributing guidelines and start collaborating.
-
Provide Feedback: Let us know how Reprebot can be enhanced. Your feedback is valuable, and you can reach out to Repreisis directly or share your ideas in our issues backlog.
-
Spread the Word: Help us broaden Reprebot's impact by telling your friends and peers about its capabilities and benefits within the Faculty of Engineering community.
- Install Python.
- Install Git.
- Install pip.
- Install virtualenv.
- Create a GitHub account if you don't have one.
- Fork the reprebot repository.
- Clone your fork.
- Create a virtual environment
inside your cloned repository:
python3 -m venv env
. - Activate the virtual
environment. On Windows, run
env\Scripts\activate
, and on Linux runsource env/bin/activate
. - Install the dependencies:
pip install -r requirements.txt
. - Run the unit tests:
pytest test/unit/src
. - Now your ready to start sending your contributions. See this guide.
- Navigate to the folder of the script you want to run.
- Execute the
main.py
script.
For example:
cd src/context_builder/faculty_secretary_faq
py main.py
Note
Running these scripts will build the context that will be used by Reprebot to give you accurate responses.
-
Navigate to the
api
module folder. -
Start the web service.
cd src/api uvicorn main:app --reload
-
You can test the API endpoint at
http://127.0.0.1:8000
.
-
Make sure to start the API as explained before.
-
Open another console window.
-
Navigate to the
src
folder. -
Start the
streamlit
application.streamlit run src/app/main.py
-
You can interact with the application at
http://localhost:8501/
.
Here's an example:
The architecture of the system is summarized in the next figure.
The system is made up of a group of modules. Basically, the chatbot (app) calls the [GET] query
endpoint of the API. The API then sends these requests to the LLM Client, which sets up the RAG chain. This is done using the Vector Store and the LLM model. The Vector Store stores embeddings created from Context Files. These Context Files are supposed to be stored locally on your computer. That's why, you'll need to run the context builder scripts first to generate them.
The Vector Store uses an auxiliary Database that stores metadata about the documents. It also includes a submodule called CRUD. which is intended to be used by some kind of UI interface that allows admins to manage the documents. Some API endpoints were already built to manage these documents, but they're not in use yet.
- Python
Reprebot relies on the following dependencies:
beautifulsoup4
chromadb
coverage
cryptography
fastapi
Jinja2
langchain
langchain-openai
pytest
requests
streamlit
transformers
uvicorn
For a comprehensive list of dependencies, including both direct and transitive
dependencies, please refer to the requirements.txt
file.