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.
π Quick Start Β· π LLM Router Β· π₯ Inputs Β· ποΈ Modes Β· ποΈ Architecture Β· πΊοΈ Roadmap
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.
git clone https://github.com/harshitboots/grasp-ai.git
cd grasp-aipython -m venv venv
# Mac / Linux
source venv/bin/activate
# Windows
venv\Scripts\activatepip install -r requirements.txtcp .env.example .env
# Edit .env and add your keysANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=AIza...
OPENAI_API_KEY=sk-... # only needed for meeting transcriptionstreamlit run app.pyYou can also paste API keys directly in the sidebar β no
.envfile needed.
Running the full backend instead? See
api/main.pyfor the FastAPI server (uvicorn api.main:app --reload), which powers auth, payments, and the mobile app.
| Input | What you give it | How it works |
|---|---|---|
| π URL | Any web article, blog, or docs page | BeautifulSoup scrapes and cleans the text |
| 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 |
| 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 |
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 β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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.
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.
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
| 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 |
- 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
- Expo / React Native app
- Stripe payments in-app
- App Store + Google Play
| 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.
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 PRGood first contributions:
- New parser β Word docs, PowerPoint, audio from URLs
- Wire retrieval into qa.py β swap the in-context approach in
agent/modes/qa.pyfor the chunking + embedding + Vector Search pipeline already built inagent/chunker.py,agent/embedder.py, andagent/vector_store.py - OCR fallback β
pdf_parser.pyalready flagslikely_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
MIT β free to use, modify and distribute.