Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Lecture Notes Chatbot

This is a simple interactive chatbot built using Gemini 1.5 Flash, LangChain, and FAISS inside a Jupyter Notebook on Google Colab. It answers student queries using PDF lecture notes.

πŸ“Œ Features

  • πŸ” Retrieval-Augmented Generation (RAG) to answer questions using custom lecture notes
  • πŸ’¬ Real-time question-answering using Gemini 1.5 Flash
  • 🧠 Embedding generation with models/embedding-001
  • ⚑ Fast and low-latency responses ideal for chatbots
  • πŸ“š Vector similarity search with FAISS
  • πŸ›‘οΈ Secure API key usage via Google Colab secrets

πŸš€ How It Works

  1. PDF Upload
    Lecture notes are uploaded as a PDF and parsed into raw text using pdfplumber.

  2. Text Chunking
    The extracted text is split into manageable chunks using CharacterTextSplitter with overlapping context.

  3. Embedding Generation
    Each chunk is embedded using GoogleGenerativeAIEmbeddings for semantic similarity.

  4. Vector Storage
    Embeddings are stored and indexed using FAISS for fast similarity search.

  5. Query Answering
    A custom prompt instructs Gemini to act as a CTSE teaching assistant. LangChain’s RetrievalQA combines retrieval and generation to answer user questions using relevant chunks.

  6. Interactive Chat
    Users ask questions through the notebook and receive clear, formatted answers using Markdown display.

🟒 How to Run This Project

  1. Download the Notebook
    Download the Jupyter notebook (.ipynb) from this GitHub repository.

  2. Open in Google Colab
    Go to Google Colab and upload the notebook.

  3. Set the Gemini API Key in Colab Secrets
    Before running the notebook:

    • Go to Google AI Studio and obtain a Gemini API key by creating a new API key.
    • In Google Colab, open the "Secrets" panel (πŸ—οΈ icon on the left sidebar).
    • Create a new secret named: GOOGLE_API_KEY
    • Paste your Gemini API key as the value.
    • Make sure the notebook has access to the secret (enable notebook access if prompted).
  4. Run All Cells in Order
    The notebook will:

    • Ask you to upload a PDF file of your lecture notes.
    • Automatically process the content, generate embeddings, and prepare the retrieval system.
  5. Ask Questions and Get Answers
    Enter any question related to the lecture notes in the final cell and receive an AI-generated answer based only on the uploaded content.

πŸ™‹β€β™€οΈ Authors

  • Vihangi Rathnayake
  • Developed as part of the SE4010 – Current Trends in Software Engineering course assignment.

About

LLM Development Toolkit: Building a CTSE Lecture Notes Chatbot

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages