Skip to content

About

Repository for Guidelytics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

Repository files navigation

Guidelytics — AI-Powered RAG Platform for Startup Entrepreneurs

Guidelytics is a full-stack Retrieval-Augmented Generation (RAG) platform designed to help startup entrepreneurs interact with their documents using natural language. Users can upload PDFs, Word documents, text files, and YouTube transcripts into organized collections, then ask questions and receive AI-generated answers grounded in their source material with full citation support.

Features

  • Multi-Collection Document Management — Create and organize multiple document collections with drag-and-drop file uploads (PDF, DOCX, TXT, YouTube transcripts)
  • RAG-Powered Q&A — Ask natural language questions and receive AI-generated answers backed by relevant source passages from your documents
  • Source Citations — Every response includes traceable references to the specific document chunks used, enabling verification and deeper exploration
  • User Authentication — Secure account management with email/password and Google OAuth, ensuring per-user data isolation
  • Real-Time Processing Status — Track document ingestion and embedding generation with live status updates
  • Dark/Light Mode — Full theme support with accessible UI components
  • Responsive Design — Optimized for desktop, tablet, and mobile

Architecture

┌──────────────────────┐     ┌──────────────────────┐     ┌──────────────────────┐
│   Frontend (React)   │────▶│  Backend (Flask API)  │────▶│   Supabase (PostgreSQL)  │
│   GitHub Pages       │     │  Google Cloud Run     │     │   pgvector + Auth + Storage │
└──────────────────────┘     └──────────┬───────────┘     └──────────────────────┘
                                        │
                              ┌─────────┴─────────┐
                              │                   │
                     ┌────────▼───────┐  ┌────────▼───────┐
                     │ Google Gemini  │  │  Cerebras LLM  │
                     │ (Embeddings)   │  │  (Generation)  │
                     └────────────────┘  └────────────────┘

How It Works

  1. Document Upload — Users upload files to a collection via the React frontend
  2. Text Extraction — The Flask backend extracts text from PDFs (PyPDF2), Word documents (python-docx), text files, or YouTube transcripts
  3. Chunking — Documents are split into semantically meaningful chunks using paragraph-based heuristics
  4. Embedding — Each chunk is embedded into a 768-dimensional vector using Google Gemini's embedding model
  5. Vector Storage — Embeddings are stored in Supabase PostgreSQL with the pgvector extension
  6. Query — When a user asks a question, the query is embedded and matched against stored vectors via cosine similarity
  7. Generation — The top-K most relevant chunks are passed as context to the Cerebras LLM, which generates a grounded answer with source attributions

Tech Stack

Layer Technologies
Frontend React 19, TypeScript, Vite, Tailwind CSS, Zustand, Radix UI, React Router
Backend Python 3.12, Flask, Gunicorn, Flask-CORS
AI & Embeddings Google Gemini (embedding-001), Cerebras Cloud SDK (LLM generation)
Database & Storage Supabase (PostgreSQL + pgvector + Auth + Storage)
Deployment Google Cloud Run (backend), GitHub Pages (frontend), Docker
CI/CD GitHub Actions
Document Processing PyPDF2, python-docx, youtube-transcript-api
Local Development Ollama (nomic-embed-text), FAISS

Project Structure

Guidelytics/
├── GuidelyticsReact/          # React + Vite frontend
│   ├── src/
│   │   ├── components/        # RAGChat, FileUploadZone, CollectionTabs, etc.
│   │   ├── pages/             # Home, RAG, Login, Features, etc.
│   │   ├── contexts/          # AuthContext (Supabase), ThemeContext
│   │   ├── stores/            # Zustand state management
│   │   ├── api/               # API client with JWT auth headers
│   │   └── types/             # TypeScript interfaces
│   └── vite.config.ts
├── Scripts/                   # Flask backend
│   ├── production/            # Production modules
│   │   ├── flask_api_production.py    # Main Flask app with auth
│   │   ├── auth_utils.py             # JWT/JWKS verification
│   │   ├── gemini_embeddings.py      # Google Gemini embedding API
│   │   ├── supabase_vector_store.py  # pgvector similarity search
│   │   ├── supabase_collection_manager.py
│   │   └── supabase_storage.py
│   ├── flask_api.py           # Development Flask app
│   ├── document_processor.py  # PDF/DOCX/TXT/YouTube extraction
│   ├── embedding_utils.py     # Text chunking and embedding
│   ├── Dockerfile             # Cloud Run container
│   └── requirements.txt
└── .github/workflows/
    └── deploy.yml             # CI/CD pipeline

Getting Started

Prerequisites

  • Node.js 20+
  • Python 3.12+
  • Ollama (for local development)
  • A Supabase project (free tier) with pgvector enabled
  • Cerebras API key
  • Google API key (for Gemini embeddings in production)

Local Development

Frontend:

cd GuidelyticsReact
npm install
npm run dev

Backend:

cd Scripts
pip install -r requirements.txt

# Pull the local embedding model
ollama pull nomic-embed-text

# Configure environment
cp .env.example .env
# Edit .env with your API keys

python flask_api.py

Production Deployment

  • Frontend deploys automatically to GitHub Pages on push to main via GitHub Actions
  • Backend is containerized with Docker and deployed to Google Cloud Run
  • Database uses Supabase PostgreSQL with pgvector for vector storage, Supabase Auth for authentication, and Supabase Storage for file uploads

API Endpoints

Method Endpoint Description
GET /health Backend health check
GET /api/collections List user's collections
POST /api/collections Create a new collection
GET /api/collections/:id Get collection details
PUT /api/collections/:id Update collection
DELETE /api/collections/:id Delete collection
POST /api/collections/:id/documents Upload documents
DELETE /api/collections/:id/documents/:docId Delete a document
POST /api/query-cerebras Query documents with RAG

All endpoints (except /health) require JWT authentication via Authorization: Bearer <token> header.

License

This project is proprietary. All rights reserved.

About

Repository for Guidelytics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages