AlgoBot is an interactive Retrieval-Augmented Generation (RAG) powered chatbot that helps you understand algorithms directly from the CLRS textbook. Introduction to Algorithms is a book on computer programming by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The book is described by its publisher as "the leading algorithms text in universities worldwide as well as the standard reference for professionals". Ask algorithmic questions, and AlgoBot retrieves relevant sections from the book and explains them clearly using AI.
Built with Streamlit, LangChain, ChromaDB, HuggingFace embeddings, and Google Gemini.
- 📘 CLRS-powered Q&A – Answers are grounded in textbook content
- 🔍 Semantic Search using vector embeddings
- 🧠 Context-aware conversations (uses recent chat history)
- 🔁 Regenerate answers for better explanations
- ⌨️ Typing animation for a ChatGPT-like experience
- 💾 Persistent Vector Store (ChromaDB)
- 🧹 Clear chat anytime from the sidebar
-
CLRS PDF is loaded and split into chunks
-
Chunks are converted into vector embeddings
-
Stored locally in ChromaDB
-
On user query:
- Relevant chunks are retrieved
- Passed to Gemini LLM with a structured prompt
- AI generates a grounded, textbook-based answer
- Frontend: Streamlit
- LLM: Google Gemini (
gemini-2.5-pro) - Framework: LangChain
- Embeddings:
BAAI/bge-base-en-v1.5 - Vector Database: ChromaDB
- PDF Loader: PyMuPDF
- Language: Python
.
├── app.py # Streamlit UI & chat logic
├── rag.py # RAG pipeline (vectorstore + chain)
├── chroma_db/ # Persistent Chroma vector database
├── .env # Environment variables
├── requirements.txt
└── README.md
git clone https://github.com/your-username/algobot.git
cd algobotpython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file:
GOOGLE_API_KEY=your_google_gemini_api_keystreamlit run app.pyOpen in browser:
👉 http://localhost:8501
- What is the difference between Divide and Conquer and Dynamic Programming?
- Explain Quick Sort with time complexity
- What is amortized analysis?
- Why is Red-Black Tree height bounded?
- Introduction to Algorithms – CLRS
- LangChain
- Google Gemini
- HuggingFace
- Streamlit
If you like this project, consider giving it a ⭐ on GitHub! Feel free to fork, improve, and experiment 🚀