Skip to content

kaim-eng/BrainPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BrainPlus

Your AI-powered knowledge assistant - A privacy-first browser extension that captures and organizes your browsing history using ML embeddings for semantic search, local RAG, and Ask Me Anything capabilities.

πŸ” Your data never leaves your device. All browsing history, page content, and ML embeddings stay 100% local in your browser.

🎬 Demo

BrainPlus Demo

πŸ—οΈ Architecture

This is a monorepo containing:

  • /extension: Chromium MV3 extension (Vite + React + TypeScript)
  • /backend: FastAPI backend (Python + PostgreSQL + ClickHouse)

🎯 Key Features

  • πŸ”’ 100% Local & Private: Your data never leaves your device - all processing happens in your browser
  • πŸ€– Ask Me Anything (AMA): Query your browsing history with natural language
  • 🧠 Local RAG: Retrieval-Augmented Generation with passage-level semantic search
  • πŸ” Semantic Search: Find pages by meaning, not just keywords
  • πŸ“± Cross-Device Sync: Sync history between mobile and desktop with end-to-end encryption
  • πŸ’Ύ Local-First Storage: All browsing history stays on your device in IndexedDB
  • 🎯 ML-Powered Embeddings: 512-dimensional vectors using Universal Sentence Encoder (runs locally)
  • πŸ›‘οΈ Privacy-First: Denylist protection for 75+ sensitive domains (banking, healthcare, email)
  • πŸ“ Smart Chunking: Sentence-aware passage generation for long documents
  • πŸ—‘οΈ Quality Eviction: Intelligent storage management based on recency, intent, and access patterns

πŸš€ Quick Start

Extension Development

cd extension
npm install
npm run dev        # Development with hot reload
npm run build      # Production build

Cross-Device Sync (Optional)

1. Start Signaling Server:

cd signaling-server
npm install
npm start          # WebSocket server on ws://localhost:8080

2. Install Native Messaging Host (Desktop only):

cd native-host
npm install
node install-manifest.js YOUR_EXTENSION_ID
# Restart Chrome after installation

3. Usage:

  • Desktop: Click extension β†’ Sync β†’ Generate QR Code
  • Mobile: Click extension β†’ Sync β†’ Scan QR Code β†’ Camera opens
  • Both devices sync automatically with E2E encryption

Backend Development (Optional)

cd backend
docker-compose up -d  # Start PostgreSQL, ClickHouse, Redis
pip install -r requirements.txt
uvicorn app.main:app --reload

πŸ“š Documentation

  • DESIGN_DOC.md: Complete technical design and onboarding document
    • System architecture and component details
    • Feature implementations (Search, Task Continuation, Cross-Device Sync)
    • Testing strategies and troubleshooting guides
    • API specifications and privacy architecture

πŸ”’ Privacy & Security

Your Data Never Leaves Your Device:

  • βœ… 100% Local Storage: All browsing history, page content, and ML embeddings stay on your device in IndexedDB
  • βœ… Zero Data Collection: We never see, store, or have access to your browsing data
  • βœ… No Cloud Sync: Your personal knowledge base is yours alone
  • βœ… Offline-First: Full functionality without internet connection (except optional deals feature)

Additional Privacy Protections:

  • πŸ›‘οΈ Smart Denylist: Automatically blocks scraping of 75+ sensitive domains (banking, healthcare, email, government)
  • πŸ” Encrypted Storage: AES-GCM encryption for sensitive data
  • 🎭 Differential Privacy: Optional aggregated signals (for deals) use Laplace noise and k-anonymity
  • 🚫 No PII: Only anonymous IDs if you choose to use the optional deals feature

πŸ“¦ Tech Stack

Extension

  • Framework: React 18 + TypeScript
  • Build: Vite 5 with MV3 plugin
  • ML: TensorFlow.js + Universal Sentence Encoder
  • Storage: IndexedDB (local page digests) + chrome.storage.local (preferences)
  • Privacy: All data stored locally, differential privacy for signals

Backend (Optional)

  • API: FastAPI with async/await
  • Database: PostgreSQL (deals catalog, points, signals)
  • Deals: Server-side attribution for affiliate tracking
  • Points: Reward system for user engagement

πŸ§ͺ Testing

Extension

cd extension
npm test           # Unit tests
npm run test:e2e   # Brave compatibility tests

Backend

cd backend
pytest             # Unit + integration tests
pytest --brave     # Brave-specific test suite

πŸ“‹ Development Phases

  • βœ… Phase 0: Dead Code Elimination & Foundation
  • βœ… Phase 1: IndexedDB & ML Infrastructure
  • βœ… Phase 2: On-Device Inference (TensorFlow.js + USE)
  • βœ… Phase 3: Semantic Search Feature
  • βœ… Phase 4: Task Continuation Feature
  • βœ… Phase 5: Cross-Device Sync (QR pairing, E2E encryption)
  • 🚧 Phase 6: Testing & QA
  • ⏳ Phase 7: LLM Integration (WebLLM, Streaming)
  • ⏳ Phase 8: Chrome Web Store Deployment

🎯 Critical Success Factors

  • Local-first architecture (IndexedDB)
  • Privacy-first denylist (75+ sensitive domains)
  • Semantic search with hybrid ranking
  • Passage-level chunking and retrieval
  • AMA with extractive answers and citations
  • Quality-aware storage eviction
  • Cross-device sync with E2E encryption
  • QR code pairing (< 30 seconds)
  • Smart merge conflict resolution
  • Vector compatibility validation
  • WebLLM integration (Phase 7)
  • Streaming token generation (Phase 7)

πŸ“„ License

GNU Affero General Public License v3.0 (AGPL-3.0)

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.

Key Points:

  • βœ… Free to use, modify, and distribute
  • βœ… Must disclose source code of modifications
  • βœ… Network use is considered distribution (SaaS clause)
  • βœ… Derivatives must also use AGPL-3.0
  • βœ… Protects user freedom and privacy

🀝 Contributing

Contributions welcome! This is an open-source project focused on privacy-first knowledge management.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors