Skip to content

csmansour/rag-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 RAG Notes Assistant

This project implements a simple Retrieval-Augmented Generation (RAG) system that lets you query your personal notes using OpenAI GPT models.

It retrieves the most relevant text chunks from your local notes and uses GPT to generate context-aware answers.

✨ Features

  • Local note retrieval: Searches your .txt notes using sentence embeddings.
  • Context-aware GPT answers: Combines retrieved chunks with GPT reasoning.
  • Simple CLI interface: Type questions directly in the terminal.
  • Lightweight & extensible: Built with standard Python libraries and sentence-transformers.

🧩 How It Works

  1. Chunking: Text files are split into small overlapping chunks.
  2. Embedding: Each chunk is converted to a numerical vector using a SentenceTransformer model (all-MiniLM-L6-v2).
  3. Retrieval: When you ask a question, the system finds the most similar chunks via cosine similarity.
  4. Generation: The top chunks are passed to an OpenAI GPT model (gpt-4o) to generate a contextually relevant answer.

⚙️ Setup

Clone the repository

git clone https://github.com/csmansour/rag-notes.git
cd rag-notes

Install dependencies

pip install -r requirements.txt

Add your OpenAI API key by copying the example environment file and filling in your key:

cp .env.example .env

💬 Usage

Run the assistant interactively:

python main.py

Then simply type a question, for example:

Ask GPT: How can I reduce stress in daily life?

Sample output:


Meditation helps reduce stress and improve focus. Start with short daily sessions focusing on your breath.

Type exit or quit to end the session.

🚀 Future Improvements

  • Add persistent vector storage (e.g., FAISS, Chroma, or Qdrant).
  • Support more file types such as PDF, Markdown, and DOCX.
  • Implement a web-based interface for querying notes.
  • Add caching to speed up repeated queries.
  • Enable configurable embedding and GPT models via .env settings.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages