A Chrome extension and Next.js web app for reading, summarizing, and querying web content using local LLM (Ollama) and RAG. Built entirely with TypeScript and LangChain.js.
- Chrome Extension: Capture and scrape webpages
- Local LLM Integration: Uses Ollama for summarization and chat
- Knowledge Base: Stores scraped content in local SQLite database
- RAG System: Semantic search and retrieval using LangChain.js
- Local Chat Interface: Accessible over local network (including mobile devices)
- Full TypeScript: Entire stack built with TypeScript/Next.js
readscribe/
├── app/ # Next.js application (API routes + frontend)
│ ├── app/ # Next.js app router
│ │ ├── api/ # API routes
│ │ └── page.tsx # Chat UI
│ └── lib/ # Shared utilities
├── chrome-extension/ # Chrome extension (React/TypeScript)
└── shared/ # Shared types and utilities
# Install Ollama from https://ollama.ai/
# Then pull required models:
ollama pull llama3.2
ollama pull nomic-embed-textcd app
# Install dependencies
npm install
# Copy environment variables
cp .env.local.example .env.local
# Edit .env.local if needed (defaults should work)# Start Next.js dev server (accessible from local network)
npm run dev -- -H 0.0.0.0The app will run on http://localhost:3000 (accessible from your local network at http://YOUR_IP:3000)
cd chrome-extension
# Install dependencies
npm install
# Build the extension
npm run buildThen in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
chrome-extension/distfolder
- Capture Pages: Browse the web and click the extension icon, then click "Capture & Summarize Page"
- Chat: Open
http://localhost:3000(or your local IP) and ask questions about your reading - Access from Phone: Use your computer's local IP address (e.g.,
http://192.168.1.100:3000) to access the chat from your phone on the same network - Telegram Bot (optional): Send links to your Telegram bot and it will ingest them into the same database
- Next.js 16 - Full-stack React framework
- TypeScript - Type-safe development
- LangChain.js - LLM orchestration and RAG
- Ollama - Local LLM inference
- SQLite (better-sqlite3) - Local database
- Cheerio - Web scraping
- Tailwind CSS - Styling
POST /api/scrape- Scrape and summarize a webpagePOST /api/chat- Chat with RAG-powered responsesGET /api/pages- Get all scraped pagesGET /api/pages/[id]- Get a specific pageGET/POST /api/config- View/update local configuration (Ollama + Telegram)
Edit app/.env.local to customize:
- Ollama base URL
- Model names
- Other settings
- Create a bot via BotFather and get a token
- Open
http://localhost:3000/configand set:- Bot Token
- Allowed Chat IDs (optional)
- Run the bot worker:
cd app
npm run telegram:bot- Make sure Ollama is running:
ollama list - Check if port 3000 is available
- Verify Node.js dependencies are installed
- Check browser console for errors
- Verify Next.js app is running on port 3000
- Check
manifest.jsonhost_permissions match your Next.js URL
- Ensure
nomic-embed-textmodel is installed:ollama pull nomic-embed-text - Check Next.js server logs for embedding errors
- Verify database has pages with embeddings stored
- Make sure Next.js is running with
-H 0.0.0.0flag - Verify phone and computer are on the same WiFi network
- Check firewall settings on your computer