Skip to content

ogulcan-dev/notes-rag-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 AI Note Assistant

AI Note Assistant is a powerful, production-ready full-stack application built to manage your notes and chat with them using Retrieval-Augmented Generation (RAG). By combining a FastAPI backend, an SQLite database, FAISS for fast vector search, and an intuitive Streamlit frontend, this application allows you to effortlessly interact with your personal knowledge base.


🚀 Features

  • Notes Management (CRUD): Create, read, update, and delete text notes seamlessly.
  • PDF Upload Support: Quickly ingest PDF documents. The system automatically reads and extracts text.
  • Automated Embedding: Leveraging OpenAI's text-embedding-3-small, all uploaded notes and PDFs are immediately tokenized, chunked, and embedded.
  • Semantic Text Search: Uses FAISS in-memory indexing to find the most contextually relevant information instantly.
  • Context-Aware AI Chat: Talk to your notes! Under the hood, OpenAI's gpt-4o-mini is firmly grounded by the precise context from only your documents, completely minimizing AI hallucinations.
  • Dynamic Math Formatting: Ensures mathematical formulas embedded in your notes are rendered properly on the frontend using KaTeX formatting.

🛠️ Technology Stack

  • Backend: Python, FastAPI, SQLAlchemy, SQLite, Pydantic
  • AI & RAG Engine: OpenAI API, FAISS, tiktoken, pypdf
  • Frontend: Streamlit, requests

⚙️ Installation & Setup

Prerequisites

  • Python 3.9+
  • An OpenAI API Key

1. Clone the repository

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

2. Install dependencies

Install the required packages using pip:

pip install -r requirements.txt

3. Environment Variables

Copy the provided .env.example file and replace the placeholder with your actual OpenAI API key.

cp .env.example .env

Ensure your .env contains:

OPENAI_API_KEY=your_openai_api_key_here

🏃 Running the Application

For the application to function fully, you need to run both the backend and frontend simultaneously.

Start the Backend (FastAPI)

Run the following command in the root of the project to start the API:

uvicorn backend.main:app --reload
  • The backend will be available at http://127.0.0.1:8000
  • Interactive API documentation can be accessed at http://127.0.0.1:8000/docs

Start the Frontend (Streamlit)

Open a new terminal window/tab and run:

streamlit run frontend/app.py
  • The Streamlit interface will open automatically in your browser at http://127.0.0.1:8501

🤝 Contributing

Contributions are always welcome! Feel free to open an issue or submit a Pull Request.


📄 License

This project is licensed under the MIT License.

Copyright (c) 2026 Oğulcan Öztürk. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages