Skip to content

Piyu242005/RAG-Based-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Typing SVG

Aurora Theme Production Ready Lightning Fast

Python FastAPI Ollama ChromaDB License


๐Ÿ’Ž Experience the Future of Learning

Transform your video library into an interactive, intelligent knowledge base with our stunning Glassmorphism Aurora interface.


๐Ÿš€ Quick Start โ€ข โœจ Features โ€ข ๐ŸŽจ Live Demo โ€ข โš™๏ธ Architecture โ€ข ๐Ÿ“– Documentation



๐ŸŽจ Live Interface Preview

๐ŸŒŸ Main Dashboard - Aurora Welcome Screen

Aurora Dashboard - Main Interface

Beautiful gradient-based UI with glassmorphism effects and pre-built example prompts


๐Ÿ’ฌ Interactive Chat Interface

Aurora Chat Interface

Real-time streaming responses with context-aware answers and video timestamps


๐ŸŒŸ What is Aurora RAG?



Aurora RAG transforms your video course library into an intelligent, AI-powered knowledge base

Production-ready conversational assistant with stunning Glassmorphism UI


๐Ÿ—๏ธ Built With

FastAPI Backend
โšก High-performance async

Vanilla JS/CSS Frontend
๐ŸŽจ Zero dependencies

Ollama AI Models
๐Ÿค– Local & private

๐ŸŽฏ Core Technology

Hybrid RAG Pipeline
๐Ÿ” BM25 + Embeddings

Cross-Encoder Reranking
๐ŸŽฏ Precision results

Streaming Responses
โšก Real-time feedback

๐Ÿ’Ž Design Philosophy

Glassmorphism UI
โœจ Premium aesthetics

Aurora Theme
๐ŸŒŒ Purple-cyan gradients

Mobile-First
๐Ÿ“ฑ Fully responsive



๐ŸŽญ Why Choose Aurora?


๐Ÿ’ก "It's not just about finding answers; it's about the experience."


๐Ÿง  Context-Aware Intelligence

Remembers your entire conversation history for coherent, multi-turn dialogues. Ask follow-up questions naturally without repeating context.

โœ… Multi-turn conversations
โœ… Context retention
โœ… Smart reference resolution
โœ… Conversation branching


โšก Real-Time Streaming

ChatGPT-style token-by-token streaming for instant feedback. See responses as they're generated, not after completion.

โšก Token streaming
โšก Progress indicators
โšก Stop generation control
โšก Sub-second first token


๐ŸŽฏ Precision Retrieval

Hybrid search combining BM25 keyword matching with semantic embeddings, followed by cross-encoder reranking for maximum accuracy.

๐Ÿ” Hybrid search (BM25 + Vector)
๐ŸŽฏ Cross-encoder reranking
๐Ÿ“Š Relevance scoring
๐Ÿ“‘ Source attribution


๐Ÿ“Š How Aurora Works

graph TD
    Q[๐ŸŽ“ User Question] -->|Hybrid Search| S[๐Ÿ” Retrieval]
    S -->|BM25 + Vector| R[๐ŸŽฏ Reranking]
    R -->|Cross-Encoder| C[๐Ÿ“š Context]
    C -->|Prompt| L[๐Ÿค– LLM Generation]
    L -->|Stream| A[๐Ÿ’ฌ Final Answer]
    
    style Q fill:#7F00FF,color:#fff
    style A fill:#00D9FF,color:#fff
Loading


๐ŸŽฌ Smart Deep Linking

Jump directly to exact timestamps in source videos. Every answer includes clickable timestamps that take you to the relevant moment.

โฑ๏ธ Precise timestamp extraction
๐Ÿ”— Clickable video links
๐Ÿ“ฝ๏ธ Multiple source references
๐Ÿ’ฏ Confidence scoring


๐ŸŽจ Premium UI/UX

Beautiful Aurora theme with purple-cyan gradients, glassmorphism effects, smooth animations, and dark mode optimization.

โœจ Glassmorphism design
๐ŸŒŠ Smooth transitions
โŒจ๏ธ Typing animations
๐Ÿ“‹ Copy to clipboard


โšก Performance Highlights

~200ms

Hybrid Search

~150ms

Reranking

~500ms

First Token

100%

Local & Private

โœจ Core Features


Everything you need for a premium RAG experience, out of the box


๐Ÿค– Intelligent Backend Architecture

๐Ÿ—๏ธ FastAPI Core

High-Performance Server

โ€ข async/await for high concurrency โ€ข Type-safe with Pydantic models โ€ข Auto-generated OpenAPI docs โ€ข CORS-enabled REST API โ€ข Health check endpoints


๐Ÿง  RAG Pipeline

Advanced Retrieval System

โ€ข Multi-stage retrieval pipeline โ€ข Context-aware generation โ€ข Smart chunk selection โ€ข Prompt engineering โ€ข Source attribution


๐Ÿ“ก Streaming

Real-Time Responses

โ€ข Token-by-token streaming โ€ข Newline-delimited JSON โ€ข Graceful error handling โ€ข Stop generation control โ€ข Progress feedback


๐Ÿ’พ Sessions

Persistent History

โ€ข SQLite-based storage โ€ข Multi-session support โ€ข Conversation history โ€ข Context retention โ€ข Export capabilities



๐ŸŽจ Premium Frontend Experience

๐ŸŒŒ Aurora Theme

Stunning Visuals

โ€ข Purple-cyan gradient palette โ€ข Smooth color transitions โ€ข Dark mode optimized โ€ข Custom CSS variables โ€ข Consistent branding


๐Ÿ’Ž Glassmorphism

Modern Design Language

โ€ข Translucent card effects โ€ข Backdrop blur filters โ€ข Elevated shadows โ€ข Frosted glass aesthetics โ€ข Layered depth


๐Ÿ“ฑ Responsive

Works Everywhere

โ€ข Mobile-first architecture โ€ข Adaptive layouts โ€ข Touch-optimized controls โ€ข Tablet support โ€ข Cross-browser compatible


โšก Interactive

Rich User Experience

โ€ข Typing animations โ€ข Stop generation button โ€ข Copy to clipboard โ€ข Markdown rendering โ€ข Syntax highlighting



๐Ÿ” Search & Retrieval Features

Hybrid Search

๐Ÿ”ค BM25 Keyword Search
Traditional TF-IDF ranking

โž•

๐Ÿงฎ Semantic Vector Search
Deep learning embeddings

=

โœจ Best of Both Worlds

Cross-Encoder Reranking

๐Ÿ“Š Initial Retrieval
Get top-100 candidates

โฌ‡๏ธ

๐ŸŽฏ Precise Scoring
Rerank with transformer model

โฌ‡๏ธ

๐Ÿ† Top-K Results
Return best 5-10 chunks

Source Attribution

๐Ÿ“น Video References
Exact timestamps

โž•

๐Ÿ“„ Chunk Metadata
Course & module info

=

๐Ÿ”— Clickable Links


๐Ÿ› ๏ธ Technology Stack


Frontend

Backend

LLM Engine

Vector DB

Database

Models: llama3.2:latest โ€ข bge-m3:latest โ€ข nomic-embed-text โ€ข gemma3:4b


๐Ÿš€ Quick Start Guide

Get Aurora RAG running in under 5 minutes!


๐Ÿ“‹ Prerequisites

โœ… Python 3.8 or higher
โœ… Ollama installed with models: llama3.2, bge-m3
โœ… Modern web browser (Chrome, Firefox, Edge)

โšก Installation Steps

1๏ธโƒฃ

Clone the Repository

git clone <repository-url>
cd RAG-Based-AI

2๏ธโƒฃ

Install Dependencies

cd project/backend
pip install -r requirements.txt

3๏ธโƒฃ

Start the Backend Server

# From project/backend directory
uvicorn main:app --port 8000 --host 0.0.0.0

Or use the convenient startup script:

# Windows
.\start_aurora.bat

# Linux/Mac
./start_aurora.sh

โœจ API Documentation: http://localhost:8000/docs

4๏ธโƒฃ

Launch the Frontend

Simply open project/frontend/index.html in your browser!

# Or serve it locally
cd project/frontend
python -m http.server 3000

๐ŸŒ Open: http://localhost:3000


๐ŸŽ‰ That's it! Start chatting with your video courses!


โš™๏ธ System Architecture

graph TB
    User[๐Ÿ‘ค User] -->|HTTPS| Frontend[๐ŸŽจ Aurora Frontend UI]
    Frontend -->|REST API| Backend[โšก FastAPI Backend Server]
    
    Backend --> Pipeline[๐Ÿง  RAG Pipeline Orchestrator]
    
    Pipeline --> Search[๐Ÿ” Hybrid Search Engine]
    Search --> Vector[๐Ÿ“Š Semantic Search<br/>ChromaDB + Embeddings]
    Search --> Keyword[๐Ÿ“ Keyword Search<br/>BM25 Index]
    
    Pipeline --> Rerank[๐ŸŽฏ Cross-Encoder Reranking<br/>Score & Sort Results]
    
    Pipeline --> Context[๐Ÿ“š Context Builder<br/>Prompt Engineering]
    
    Context --> LLM[๐Ÿฆ™ Ollama LLM<br/>llama3.2:latest]
    
    LLM -->|Streaming Tokens| Backend
    Backend -->|JSON Stream| Frontend
    
    Backend --> DB[(๐Ÿ’พ SQLite Database<br/>Chat History)]
    
    style Frontend fill:#7F00FF,color:#fff
    style Backend fill:#00D9FF,color:#fff
    style Pipeline fill:#FFD700,color:#000
    style LLM fill:#00FF88,color:#000
Loading

๐Ÿ”„ How It Works

1๏ธโƒฃ
๐ŸŽค
User Query
Submit question via chat

2๏ธโƒฃ
๐Ÿ”
Search
BM25 + Vector similarity

3๏ธโƒฃ
๐ŸŽฏ
Rerank
Cross-encoder scoring

4๏ธโƒฃ
๐Ÿ“š
Context
Build RAG prompt

5๏ธโƒฃ
๐Ÿค–
Generate
LLM produces answer

6๏ธโƒฃ
๐Ÿ’ฌ
Stream
Display in real-time


๐Ÿ“‚ Project Structure

RAG-Based-AI/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ project/
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ backend/                    # โšก FastAPI Backend Application
โ”‚   โ”‚   โ”œโ”€โ”€ main.py                    # ๐Ÿš€ API entry point & endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ rag_pipeline.py            # ๐Ÿง  Core RAG orchestration logic
โ”‚   โ”‚   โ”œโ”€โ”€ search.py                  # ๐Ÿ” Hybrid search engine
โ”‚   โ”‚   โ”œโ”€โ”€ models.py                  # ๐Ÿ“‹ Pydantic request/response models
โ”‚   โ”‚   โ”œโ”€โ”€ config.py                  # โš™๏ธ  Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ prompts.py                 # ๐Ÿ’ฌ Prompt templates
โ”‚   โ”‚   โ”œโ”€โ”€ utils.py                   # ๐Ÿ› ๏ธ  Helper utilities
โ”‚   โ”‚   โ”œโ”€โ”€ database.py                # ๐Ÿ’พ SQLite operations
โ”‚   โ”‚   โ”œโ”€โ”€ requirements.txt           # ๐Ÿ“ฆ Python dependencies
โ”‚   โ”‚   โ”œโ”€โ”€ embeddings.joblib          # ๐Ÿ“Š Pre-computed embeddings (7MB)
โ”‚   โ”‚   โ”œโ”€โ”€ bm25_index.joblib          # ๐Ÿ“ BM25 search index (8MB)
โ”‚   โ”‚   โ””โ”€โ”€ chat_history.db            # ๐Ÿ’ฌ Chat session database
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ frontend/                   # ๐ŸŽจ Aurora UI (Vanilla JS)
โ”‚       โ”œโ”€โ”€ index.html                 # ๐ŸŒ Single Page Application
โ”‚       โ”œโ”€โ”€ style.css                  # ๐Ÿ’Ž Glassmorphism styling
โ”‚       โ”œโ”€โ”€ script.js                  # โšก Chat logic & API calls
โ”‚       โ””โ”€โ”€ ๐Ÿ“ assets/                 # ๐Ÿ–ผ๏ธ  Images & resources
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ legacy/                         # ๐Ÿ“ฆ Legacy/Archived Scripts
โ”‚   โ”œโ”€โ”€ app.py                         # Old Streamlit prototype
โ”‚   โ”œโ”€โ”€ video_to_mp3.py                # Video ingestion pipeline
โ”‚   โ”œโ”€โ”€ preprocess_json.py             # Data preprocessing
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ jsons/                          # ๐Ÿ“„ Transcription JSON files
โ”‚   โ”œโ”€โ”€ 01_Installing VS Code.json
โ”‚   โ”œโ”€โ”€ 02_Your First HTML.json
โ”‚   โ””โ”€โ”€ ... (18 course transcripts)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ tests/                          # ๐Ÿงช Testing & Evaluation
โ”‚   โ”œโ”€โ”€ evaluate.py                    # RAG evaluation metrics
โ”‚   โ””โ”€โ”€ eval_dataset.json              # Test dataset
โ”‚
โ”œโ”€โ”€ README.md                          # ๐Ÿ“– This file
โ”œโ”€โ”€ .env                               # ๐Ÿ” Environment variables
โ”œโ”€โ”€ start_aurora.bat                   # ๐ŸชŸ Windows startup script
โ””โ”€โ”€ start_aurora.sh                    # ๐Ÿง Linux/Mac startup script

๐Ÿ”ฎ Future Roadmap

๐Ÿšง In Development

  • ๐ŸŽ™๏ธ Voice Input/Output
    Speak to the assistant, hear responses

  • ๐Ÿ“Š Analytics Dashboard
    Query statistics and usage metrics

  • ๐Ÿ”„ Auto-Refresh Index
    Watch folder for new videos

  • ๐ŸŒ Multi-Language Support
    i18n for global users

๐Ÿ’ก Planned Features

  • ๐Ÿค– Multi-Model Switching
    DeepSeek, Mistral, GPT-4, Claude

  • ๐Ÿ“ค File Upload
    Drag & drop PDFs, DOCX, TXT

  • ๐Ÿณ Docker Compose
    One-command deployment

  • ๐Ÿ” Authentication
    User accounts and permissions


๐Ÿ’ฌ Have a feature request? Open an issue!


๐Ÿ“– Documentation

๐Ÿ”Œ API Endpoints

Method Endpoint Description
GET / API information and health status
POST /chat Send a query and receive streaming response
GET /sessions List all chat sessions
GET /sessions/{id} Get specific session history
GET /models List available Ollama models
GET /health Backend health check

๐Ÿ“š Full API Docs: Visit http://localhost:8000/docs after starting the backend



โšก Performance Metrics

๐Ÿ” Search Speed

~200ms

Hybrid retrieval time

๐ŸŽฏ Reranking

~150ms

Cross-encoder scoring

๐Ÿค– First Token

~500ms

Time to first response

๐Ÿ“Š Index Size

720 chunks

From 18 video courses

Tested on: Intel i7-12700K, 32GB RAM, RTX 3080


๐Ÿค Contributing

We welcome contributions from the community!

1. Fork the repository
2. Create your feature branch (git checkout -b feature/AmazingFeature)
3. Commit your changes (git commit -m 'Add some AmazingFeature')
4. Push to the branch (git push origin feature/AmazingFeature)
5. Open a Pull Request

Read CONTRIBUTING.md for detailed guidelines

Follow our CODE_OF_CONDUCT.md


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

Built with amazing open-source tools:

FastAPI โ€ข Ollama โ€ข ChromaDB โ€ข Sentence-Transformers โ€ข BM25



๐Ÿ’œ Built with passion by

Piyush Ramteke


LinkedIn GitHub Portfolio Email




โญ If you found this helpful, please consider giving it a star!


ยฉ 2026 Aurora RAG Assistant. All rights reserved.

About

A RAG-based AI combines a language model with external information retrieval. It first fetches relevant documents from a knowledge source, then generates answers using that context. This improves accuracy, keeps responses grounded in real data, and allows dynamic updates without retraining.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors