Skip to content

harshitboots/grasp-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 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.


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 Flash 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 (Flash / Haiku)
Analysis Findings, risks, action items, key data Claude Sonnet
Q&A Chat with the content, full history kept in context Claude Haiku
Flashcards Revision cards generated from the content Gemini Flash
Teaching (coming soon) AI tutor that asks you questions and gives feedback Claude Sonnet

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 Flash  (vision)      β”‚
β”‚  audio?          β†’ Whisper β†’ Claude Haiku      β”‚
β”‚  analysis mode?  β†’ Claude Sonnet               β”‚
β”‚  words < 2,000?  β†’ Gemini Flash                β”‚
β”‚  words < 8,000?  β†’ Claude Haiku                β”‚
β”‚  words > 8,000?  β†’ Claude Haiku + chunking     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pricing per run

Content Model Estimated cost
Short article summary Gemini Flash ~Β£0.0001
Long PDF summary Claude Haiku ~Β£0.0005
Deep document analysis Claude Sonnet ~Β£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

Project Structure

grasp-ai/
β”œβ”€β”€ app.py                          ← Streamlit web UI
β”œβ”€β”€ agent/
β”‚   β”œβ”€β”€ router.py                   ← YouTube vs web detection
β”‚   β”œβ”€β”€ llm_router.py               ← model selection (Flash / Haiku / Sonnet)
β”‚   β”œβ”€β”€ 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
β”‚   β”‚   └── flashcards.py           ← revision cards
β”‚   └── llms/
β”‚       β”œβ”€β”€ claude.py               ← Anthropic SDK wrapper
β”‚       β”œβ”€β”€ gemini.py               ← Google Gemini SDK wrapper
β”‚       └── openai.py               ← OpenAI SDK wrapper
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ main.py                     ← FastAPI backend (in progress)
β”‚   β”œβ”€β”€ routers/                    ← upload / agent / auth / payments
β”‚   └── services/                   ← blob storage / SQL
β”œβ”€β”€ auth/
β”‚   β”œβ”€β”€ google_oauth.py
β”‚   β”œβ”€β”€ usage_tracker.py
β”‚   └── stripe_webhook.py
β”œβ”€β”€ databricks/notebooks/           ← ingest / embed / vector index / agent
β”œβ”€β”€ .streamlit/config.toml          ← dark purple theme
β”œβ”€β”€ .env.example
β”œβ”€β”€ 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-1.5-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
Payments Stripe
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
  • Flashcards mode β€” revision cards from any content
  • Teaching mode β€” Socratic AI tutor
  • Google OAuth + usage tracking
  • Free tier (3 uploads/month) + Pro (Β£5/month)
  • Streamlit Cloud deployment

Mobile app

  • Expo / React Native app
  • FastAPI backend
  • Stripe payments
  • 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 (Q&A mode)
AZURE_STORAGE_CONNECTION_STRING Document storage
AZURE_SQL_CONNECTION_STRING Usage tracking
DATABRICKS_HOST Vector search
DATABRICKS_TOKEN Vector search
STRIPE_SECRET_KEY Payments
GOOGLE_CLIENT_ID Auth

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
  • Teaching mode β€” agent/modes/teaching.py, Socratic-style prompting on top of Claude Sonnet
  • Vector search for Q&A β€” swap the in-context approach in agent/modes/qa.py for chunking + retrieval once documents get long
  • New connector β€” Notion, Google Drive, Confluence

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

Watchers

Forks

Releases

Packages

Contributors

Languages