Skip to content
Β 
Β 

Latest commit

Β 

History

65 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Grasp

Upload anything. Understand everything.

Drop a PDF, paste a link, upload an image, or record your meeting.
Get a short, clear summary β€” powered by the right AI model at the right cost.


Python Streamlit FastAPI Claude Gemini Whisper License Stars


πŸš€ Quick Start Β· πŸ”€ LLM Router Β· πŸ“₯ Inputs Β· πŸŽ›οΈ Modes Β· πŸ—οΈ Architecture Β· πŸ—ΊοΈ Roadmap


What is Grasp?

Most people don't have time to read everything thrown at them β€” long PDFs, hour-long YouTube videos, dense articles, meeting recordings.

Grasp solves that. Point it at any content and get back what matters in plain English.

You give Grasp β†’    A YouTube link       A PDF report      A photo of notes      A meeting recording
Grasp gives you β†’   Clear summary        Key findings       Extracted content      Action items

No reading required. No manual highlighting. No copy-paste into ChatGPT.


Quick Start

Prerequisites

1. Clone

git clone https://github.com/harshitboots/grasp-ai.git
cd grasp-ai

2. Create virtual environment

python -m venv venv

# Mac / Linux
source venv/bin/activate

# Windows
venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Add your API keys

cp .env.example .env
# Edit .env and add your keys
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=AIza...
OPENAI_API_KEY=sk-...      # only needed for meeting transcription

5. Run

streamlit run app.py

Open http://localhost:8501

You can also paste API keys directly in the sidebar β€” no .env file needed.

Running the full backend instead? See api/main.py for the FastAPI server (uvicorn api.main:app --reload), which powers auth, payments, and the mobile app.


Input Types

Input What you give it How it works
πŸ”— URL Any web article, blog, or docs page BeautifulSoup scrapes and cleans the text
▢️ YouTube Any YouTube link youtube-transcript-api extracts the transcript
πŸ“„ PDF Upload any PDF file PyMuPDF extracts all text and metadata
πŸ–ΌοΈ Image Photo, screenshot, diagram, handwritten notes Gemini Vision reads and extracts content
πŸŽ™οΈ Meeting MP3, MP4, WAV, M4A, WEBM recording OpenAI Whisper transcribes the audio

Modes

Mode What it gives you Model
Summary TL;DR + key bullet points in plain English Routed (Gemini Flash / Claude Haiku)
Analysis Findings, risks, action items, key data Claude Sonnet 4.6
Q&A Chat with the content, full history kept in context Claude Haiku 4.5
Teaching Socratic AI tutor β€” asks guiding questions, checks understanding Claude Sonnet 4.6
Flashcards Revision cards generated from the content Gemini 3 Flash

LLM Router

The router picks the cheapest model that can do the job β€” no manual selection, no wasted spend.

          Input content + mode
                     ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Router Decision                   β”‚
β”‚                                                β”‚
β”‚  image?          β†’ Gemini 3 Flash (vision)     β”‚
β”‚  audio?          β†’ Whisper β†’ Claude Haiku 4.5  β”‚
β”‚  analysis mode?  β†’ Claude Sonnet 4.6           β”‚
β”‚  words < 2,000?  β†’ Gemini 3 Flash              β”‚
β”‚  words < 8,000?  β†’ Claude Haiku 4.5            β”‚
β”‚  words > 8,000?  β†’ Claude Haiku 4.5 + chunking β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pricing per run

Content Model Estimated cost
Short article summary Gemini 3 Flash ~Β£0.0001
Long PDF summary Claude Haiku 4.5 ~Β£0.0005
Deep document analysis Claude Sonnet 4.6 ~Β£0.003
Meeting transcription + summary Whisper + Haiku ~Β£0.006/min

Cost is shown after every run in the UI.


Architecture

User input (URL / PDF / Image / Audio)
              ↓
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚  URL Detector β”‚  ← youtube or web?
      β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚       Parsers        β”‚
   β”‚  web Β· youtube Β· pdf β”‚
   β”‚  image Β· audio       β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚      LLM Router      β”‚  ← Flash / Haiku / Sonnet
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚     Mode Engine       β”‚
   β”‚  summary Β· analysis   β”‚
   β”‚  qa Β· teaching Β· cardsβ”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ↓
     Output + cost shown

For long documents, Q&A can optionally route through a retrieval pipeline instead of stuffing raw text into context:

Upload β†’ chunk (500 words, 50 overlap) β†’ embed (Azure OpenAI) β†’ Databricks Vector Search β†’ retrieve top-k chunks β†’ Claude

See agent/chunker.py, agent/embedder.py, agent/vector_store.py, and databricks/notebooks/04_agent.py.


Project Structure

grasp-ai/
β”œβ”€β”€ app.py ← Streamlit web UI
β”œβ”€β”€ agent/
β”‚ β”œβ”€β”€ router.py ← YouTube vs web detection
β”‚ β”œβ”€β”€ llm_router.py ← model selection + cost estimation
β”‚ β”œβ”€β”€ chunker.py ← 500-word chunks, 50-word overlap
β”‚ β”œβ”€β”€ embedder.py ← Azure OpenAI embeddings
β”‚ β”œβ”€β”€ vector_store.py ← Databricks Vector Search client
β”‚ β”œβ”€β”€ parsers/
β”‚ β”‚ β”œβ”€β”€ web_parser.py ← BeautifulSoup scraper
β”‚ β”‚ β”œβ”€β”€ youtube_parser.py ← transcript extraction
β”‚ β”‚ β”œβ”€β”€ pdf_parser.py ← PyMuPDF text extraction
β”‚ β”‚ β”œβ”€β”€ image_parser.py ← Gemini Vision
β”‚ β”‚ └── audio_parser.py ← OpenAI Whisper
β”‚ β”œβ”€β”€ modes/
β”‚ β”‚ β”œβ”€β”€ summary.py ← TL;DR + key points
β”‚ β”‚ β”œβ”€β”€ analysis.py ← deep analysis (Claude Sonnet)
β”‚ β”‚ β”œβ”€β”€ qa.py ← chat with content
β”‚ β”‚ β”œβ”€β”€ teaching.py ← Socratic tutor (Claude Sonnet)
β”‚ β”‚ └── flashcards.py ← revision cards
β”‚ └── llms/
β”‚ β”œβ”€β”€ claude.py ← Anthropic SDK wrapper
β”‚ β”œβ”€β”€ gemini.py ← Google Gemini SDK wrapper
β”‚ └── openai.py ← Whisper transcription wrapper
β”œβ”€β”€ api/
β”‚ β”œβ”€β”€ main.py ← FastAPI app entry point
β”‚ β”œβ”€β”€ auth/
β”‚ β”‚ └── dependencies.py ← JWT auth dependency
β”‚ β”œβ”€β”€ routers/
β”‚ β”‚ β”œβ”€β”€ upload.py ← file/URL upload endpoints
β”‚ β”‚ β”œβ”€β”€ agent.py ← summary/analysis/qa/teaching/flashcards
β”‚ β”‚ β”œβ”€β”€ auth.py ← Google OAuth + token refresh
β”‚ β”‚ └── payments.py ← Stripe checkout + webhook
β”‚ β”œβ”€β”€ services/
β”‚ β”‚ β”œβ”€β”€ blob_service.py ← Azure Blob operations
β”‚ β”‚ β”œβ”€β”€ sql_service.py ← Azure SQL operations
β”‚ β”‚ └── session_store.py ← parsed content lookup
β”‚ └── models/
β”‚ └── schemas.py ← Pydantic models
β”œβ”€β”€ auth/
β”‚ β”œβ”€β”€ google_oauth.py ← Google verification + JWT issuance
β”‚ β”œβ”€β”€ usage_tracker.py ← Free tier limit logic
β”‚ └── stripe_webhook.py ← Stripe event handling
β”œβ”€β”€ databricks/notebooks/ ← ingest / embed / vector index / agent
β”œβ”€β”€ .streamlit/config.toml ← dark purple theme
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .cursorrules
β”œβ”€β”€ Dockerfile
└── requirements.txt

Tech Stack

Layer Technology
Web UI Streamlit
Backend API FastAPI
LLM β€” Analysis / Teaching Claude Sonnet (claude-sonnet-4-6)
LLM β€” Summary / Q&A Claude Haiku (claude-haiku-4-5)
LLM β€” Flashcards / Images Gemini Flash (gemini-3-flash)
Meeting Transcription OpenAI Whisper (whisper-1)
Embeddings Azure OpenAI text-embedding-3-small
Vector Store Databricks Vector Search
Document Storage Azure Blob Storage
Metadata Delta Lake (Unity Catalog)
Auth Google OAuth + JWT (access/refresh tokens)
Payments Stripe subscriptions
PDF Parsing PyMuPDF
Web Scraping BeautifulSoup + requests
Language Python 3.10+
Hosting Azure Container Apps
CI/CD GitHub Actions

Roadmap

Web version (current)

  • URL scraping (articles, blogs, docs)
  • YouTube transcript extraction
  • PDF parsing
  • Image reading (Gemini Vision)
  • Meeting / audio transcription (Whisper)
  • Summary mode
  • Deep analysis mode
  • Multi-model router (Flash / Haiku / Sonnet)
  • Q&A mode β€” chat with any content
  • Teaching mode β€” Socratic AI tutor
  • Flashcards mode β€” revision cards from any content
  • Google OAuth + JWT sessions
  • Usage tracking + Free tier (3 uploads/month)
  • Stripe payments (Β£5/month Pro)
  • Retrieval pipeline (chunk β†’ embed β†’ vector search) for scalable Q&A
  • Wire retrieval pipeline into live qa.py (currently in-context only)
  • OCR fallback for scanned PDFs
  • Streamlit Cloud / Azure Container Apps deployment

Mobile app

  • Expo / React Native app
  • Stripe payments in-app
  • App Store + Google Play

Environment Variables

Variable Required for
ANTHROPIC_API_KEY Summary, analysis, teaching, Q&A
GEMINI_API_KEY Images, flashcards, short summaries
OPENAI_API_KEY Meeting / audio transcription (Whisper)
AZURE_OPENAI_KEY Embeddings (retrieval-based Q&A)
AZURE_STORAGE_CONNECTION_STRING Document storage
AZURE_SQL_CONNECTION_STRING Usage tracking, auth
DATABRICKS_HOST / DATABRICKS_TOKEN Vector search
STRIPE_SECRET_KEY / STRIPE_WEBHOOK_SECRET / STRIPE_PRO_PRICE_ID Payments
GOOGLE_CLIENT_ID Auth
JWT_SECRET Session tokens

See .env.example for the full list.


Contributing

git clone https://github.com/harshitboots/grasp-ai.git
cd grasp-ai
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
git checkout -b feature/your-feature
# make changes
streamlit run app.py   # test locally
git push origin feature/your-feature
# open a PR

Good first contributions:

  • New parser β€” Word docs, PowerPoint, audio from URLs
  • Wire retrieval into qa.py β€” swap the in-context approach in agent/modes/qa.py for the chunking + embedding + Vector Search pipeline already built in agent/chunker.py, agent/embedder.py, and agent/vector_store.py
  • OCR fallback β€” pdf_parser.py already flags likely_scanned, but nothing acts on it yet
  • New connector β€” Notion, Google Drive, Confluence
  • Mobile app screens β€” Expo/React Native, matches the dark purple theme in .streamlit/config.toml

License

MIT β€” free to use, modify and distribute.


Built by Harshit Tripathi

GitHub LinkedIn

About

🧠 Grasp - AI learning agent that transforms any document, image, YouTube video or URL into summaries, interactive Q&A, tutoring sessions and flashcards. Built with Claude, GPT-4o, Gemini, FastAPI, Databricks and Azure.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages