Skip to content

Chat with the book "Developer Relations" : a simple local RAG AI chatbot using ollama

License

Notifications You must be signed in to change notification settings

thibs0/rag-devrel-ollama

Repository files navigation

Chat with the book "Developer Relations" RAG ollama

This Retrieval Augmented Generation (RAG) AI embeds the excellent book Developer Relations from my colleagues Caroline Lewko and James Parton at DevRel.Agency. It runs locally on your own computer.

This project is for you whether:

  • you want to talk to the book itself. It's fun, free, and fast to seek information -- and a good complement to the paper version of the book too;
  • you want to learn how to code a very simple local RAG AI project in python using ollama, based on PDF files. Instructions are given at the end to wipe out the database and embed your own PDF files instead;
  • you'd like to contribute, for example with more DevRel content (PDF or other formats), or with other embeddings methods or other LLM, etc. (reach out to me!).

Dependencies: ollama nomic-embed-text mistral langchain chromadb streamlit

For any question, reach out to thibs(at)devrel.agency or thibault(at)cantegrel.com

Requirements

This project requires the following software to be installed on your machine first (Windows, Mac, Linux):

Install

  • Download Mistral AI & Nomic Text Embedding for Ollama:
ollama pull mistral
ollama pull nomic-embed-text
  • Clone this repository -- from GitHub interface or with Github desktop or with Git command line:
git clone https://github.com/thibs0/rag-devrel-ollama.git
cd rag-devrel-ollama
  • Install Python packages from requirements.txt:
pip install -r requirements.txt

Run

  • Launch Ollama application or use the command:
ollama serve &
  • Launch the Streamlit web app:
streamlit run streamlit_app.py

Enjoy!

screenshot

Work with your own PDF files

  • Reset the dadabase
python3 populate_database.py --reset
  • Add PDF files into /data folder
  • Run populate_database.py each time a new file is added or updated:
python3 populate_database.py

Work with other types of content

Coming soon...

Dependencies

This project has been tested on MacOS (AppleSilicon, integrated GPUs) & Windows 11 (x64, RTX GPUs) with the following versions:

Python 3.12.9

  • ollama-0.4.7
  • langchain-0.3.18
  • chromadb-0.6.3
  • streamlit-1.42.0

License

This is an open-source project provided under the MIT License

Releases

No releases published

Packages

No packages published

Languages