Skip to content

eulogik/buffbrain

Repository files navigation

BuffBrain

🧠 BuffBrain

The clipboard manager with a brain.
On-device semantic search. AI-powered classification. Blazingly fast native performance.

Semantic search finds what you meant, not just what you typed. All AI runs offline on your machine β€” zero data leaves your Mac.

Features β€’ Semantic Search β€’ vs Competition β€’ Architecture β€’ Build

MIT License macOS 10.15+ Linux .deb Windows .exe + NSIS Rust 1.85+ React 19 Tauri 2 Built by Eulogik



✦ Features

Capability BuffBrain
Semantic Search βœ… On-device MiniLM-L6 (~22MB), 384-dim vectors, cosine similarity ranking
Text Classification βœ… 30+ heuristics: code (JS/Python/Rust/Go/SQL/etc), links (URLs/email/IPs), plain text
OpenRouter AI Tagger βœ… Optional Llama 3.1 8B via API key β€” refines classification + auto-detect
Image Clipboard Support βœ… Thumbnail previews stored in SQLite
Pin / Favorites βœ… Toggle pin per clip, sorted to top
Global Shortcut βœ… Cmd+Shift+V toggles window anywhere
Tray Icon βœ… Menu bar icon with Show/Hide/Quit + click toggle
Auto-start βœ… Launch at login (configurable)
System Tray Toggle βœ… Show/hide tray icon from Settings
Frameless Glass UI βœ… Transparent, always-on-top, blur backdrop, 720Γ—460
Auto-hide on blur βœ… Window disappears when focus is lost
Secure API Key Storage βœ… macOS Keychain via keyring v3
Dark/Light/System Theme βœ… Three-way toggle
Adjustable Max Clips βœ… Configurable history limit
No Telemetry βœ… Zero analytics, zero external calls (unless you opt into OpenRouter)

✦ Semantic Search

BuffBrain embeds every clip into a 384-dimensional vector using a quantized MiniLM-L6-v2 ONNX model running locally via ort (ONNX Runtime).

How it works:

Clip text β†’ Tokenizer (WordPiece) β†’ MiniLM-L6 ONNX β†’ Mean pooling β†’ L2 normalize β†’ 384-dim vector
  • Model: sentence-transformers/all-MiniLM-L6-v2 β€” quantized to ~22MB
  • Runtime: ort (ONNX Runtime) β€” no Python, no PyTorch, no GPU required
  • Search: Cosine similarity over all stored embeddings, ranked + sorted by relevance
  • Speed: Sub-10ms inference per clip on Apple Silicon (M-series)

Toggle between Lexical (πŸ”) and Semantic (✨) search modes in the search bar:

Mode Behavior
πŸ” Lexical Classic text match β€” finds what you typed
✨ Semantic AI meaning match β€” finds what you meant

Example: searching "fruit" finds "apple", "banana", "orange" clips even though none contain the word "fruit."


✦ On-Device AI, No Compromises

No cloud dependency. No API key required. No data leaves your Mac.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  BuffBrain                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚  ONNX Runtime (ort)                                    β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚     β”‚
β”‚  β”‚  β”‚  MiniLM-L6-v2 (quantized, 22MB)                  β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  β€’ Tokenizer β†’ Embed β†’ Normalize β†’ Store          β”‚  β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚     β”‚
β”‚  β”‚  β”‚  Heuristic Classifier (30+ rules)                 β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  β€’ Code detection: JS/TS, Python, Rust, Go, SQL   β”‚  β”‚     β”‚
β”‚  β”‚  β”‚    HTML/XML, CSS, JSON, YAML, TOML, Makefiles     β”‚  β”‚     β”‚
β”‚  β”‚  β”‚    Shell scripts, stack traces, git diffs, etc.   β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  β€’ Link detection: URLs, email, IPs, file paths   β”‚  β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚     β”‚
β”‚  β”‚  β”‚  OpenRouter AI (optional) β€” Llama 3.1 8B         β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  β€’ Refines classification via API                β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  β€’ Only enabled if user provides API key          β”‚  β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚  Storage: SQLite + macOS Keychain                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✦ vs The Competition

| Feature | BuffBrain 🧠 | Alfred | Raycast | Maccy | Ditto | PastePilot | |---|---|---|---|---|---|---|---| | Semantic search | βœ… On-device MiniLM-L6 | ❌ | ❌ | ❌ | ❌ | ❌ | | AI classification | βœ… Heuristic 30+ rules + optional LLM | ❌ | ❌ | ❌ | ❌ | βœ… GPT-powered | | Local AI only | βœ… Zero cloud (by default) | ❌ | ❌ | ❌ | ❌ | ❌ Cloud-only | | Free & open source | βœ… MIT | ❌ Β£49+ | ❌ Freemium | βœ… Free | βœ… Free | ⚠️ Freemium | | Cross-platform | βœ… macOS, Linux, Windows | βœ… Mac | βœ… Mac | βœ… Mac | βœ… Windows | βœ… Mac | | Image clips | βœ… Thumbnails in SQLite | ❌ Premium only | βœ… | ❌ | βœ… | βœ… | | Global shortcut | βœ… Cmd+Shift+V | βœ… | βœ… | βœ… | βœ… | βœ… | | Frameless UI | βœ… Glass, always-on-top | ❌ | ❌ | ❌ | ❌ | ❌ | | Clipboard types (code/link/text) | βœ… Auto-detected | βœ… Tags | βœ… Tags | ❌ | ❌ | ❌ | | Auto-start | βœ… Configurable | βœ… | βœ… | βœ… | βœ… | βœ… | | macOS Keychain | βœ… API keys secured | ❌ | ❌ | ❌ | ❌ | ❌ | | Privacy | βœ… No telemetry | ⚠️ Some | ⚠️ Some | βœ… Clean | βœ… Clean | ⚠️ Some | | Platform | macOS, Linux, Windows | macOS | macOS | macOS | Windows | macOS |

Key differentiators:

  • Only clipboard manager with on-device semantic search β€” no competitor offers meaning-based retrieval
  • True privacy β€” heuristics + bundled ONNX model mean zero external calls unless you add an API key
  • Free and open source β€” MIT license, no paid tiers, no data mining
  • Modern tech stack β€” Rust backend, React 19 + TypeScript frontend, Tauri 2 framework

✦ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Frontend (React 19 + TypeScript)    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ SearchBar β”‚ β”‚   Settings       β”‚ β”‚
β”‚  β”‚ β€’ Lexical β”‚ β”‚ β€’ Theme toggle   β”‚ β”‚
β”‚  β”‚ β€’ Semanticβ”‚ β”‚ β€’ AI on/off      β”‚ β”‚
β”‚  β”‚ β€’ Tabs    β”‚ β”‚ β€’ Tray toggle    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β€’ Auto-start     β”‚ β”‚
β”‚        β”‚       β”‚ β€’ API key mgmt   β”‚ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”‚  ClipList  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  β€’ Cards   β”‚  β”‚   Icons       β”‚  β”‚
β”‚  β”‚  β€’ Preview β”‚  β”‚   (SVG React) β”‚  β”‚
β”‚  β”‚  β€’ Pin/Delete               β”‚  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚        β”‚ IPC (invoke / events)      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Backend (Rust + Tauri 2)           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  commands   β”‚ β”‚  clipboard   β”‚  β”‚
β”‚  β”‚  β€’ CRUD     β”‚ β”‚  β€’ Polling   β”‚  β”‚
β”‚  β”‚  β€’ Search   β”‚ β”‚  β€’ Auto-type β”‚  β”‚
β”‚  β”‚  β€’ Config   β”‚ β”‚  β€’ Watcher   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚               β”‚           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚         db (SQLite)           β”‚  β”‚
β”‚  β”‚  β€’ clips (content, type,      β”‚  β”‚
β”‚  β”‚    source, embedding, pinned) β”‚  β”‚
β”‚  β”‚  β€’ config (key-value store)   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                 β”‚                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚    embed (ONNX Runtime)       β”‚  β”‚
β”‚  β”‚  β€’ MiniLM-L6-v2 quantized     β”‚  β”‚
β”‚  β”‚  β€’ tokenizer β†’ inference β†’    β”‚  β”‚
β”‚  β”‚    mean-pool β†’ normalize      β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                     β”‚
β”‚  Storage:                           β”‚
β”‚  β€’ SQLite: ~/Library/Application    β”‚
β”‚    Support/com.buffbrain.app/       β”‚
β”‚  β€’ Keychain: OpenAI/OpenRouter key  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
Desktop Framework Tauri 2 (Rust + WebView)
Frontend React 19, TypeScript, Vite 7
Backend Rust with tokio, serde, anyhow
Storage rusqlite (bundled SQLite) with WAL mode
AI Runtime ort (ONNX Runtime) v2.0.0-rc.12
AI Model MiniLM-L6-v2 quantized (~22MB)
Tokenization tokenizers (Rust), WordPiece
Secrets keyring v3 (macOS Keychain)
Clipboard tauri-plugin-clipboard-manager v2
Shortcuts tauri-plugin-global-shortcut v2
Auto-start tauri-plugin-autostart v2
Window Frameless, transparent, macos-private-api

✦ Install

Download the latest release for your platform from the Releases page.

macOS β€” Gatekeeper workaround

v0.1.x builds are ad-hoc signed (no Apple Developer ID), so macOS will block the first launch with one of:

  • "BuffBrain.app is damaged and can't be opened"
  • "BuffBrain.app cannot be opened because the developer cannot be verified"

Pick one of these to bypass:

Option A β€” GUI (one-time):

  1. Open the .dmg and drag BuffBrain to /Applications
  2. In /Applications, right-click BuffBrain.app β†’ Open (not double-click)
  3. Click Open in the warning dialog
  4. After that, double-click works normally

Option B β€” Terminal (works on Apple Silicon too):

xattr -d com.apple.quarantine "/Applications/BuffBrain.app"

Option C β€” ad-hoc sign manually (if the above still fails):

codesign --force --deep --sign - "/Applications/BuffBrain.app"

Proper Developer ID signing + notarization is on the roadmap β€” until then, please use one of the workarounds above. See issue tracker for status.

Linux

sudo dpkg -i BuffBrain_*.deb
sudo apt-get install -f   # resolve any missing deps
buffbrain

Windows

Run the NSIS installer .exe. SmartScreen may show a warning for unsigned binaries β€” click More info β†’ Run anyway.


✦ Build from Source

Prerequisites

Platform-specific:

  • macOS: Xcode Command Line Tools (xcode-select --install)
  • Linux: sudo apt install libwebkit2gtk-4.1-dev librsvg2-dev patchelf libssl-dev libgtk-3-dev
  • Windows: NSIS (for .exe installer)

Quick Start

git clone https://github.com/your-username/buffbrain.git
cd buffbrain

# Install JS dependencies
npm install

# Development mode (hot-reload)
npm run tauri dev

# Or use the dev script
./scripts/dev.sh

Production Build

npm run tauri build

Output by platform:

Platform Bundle
macOS (Apple Silicon) bundle/dmg/BuffBrain_0.1.1_aarch64.dmg
macOS (Intel) bundle/dmg/BuffBrain_0.1.1_x86_64.dmg
Linux (x86_64) bundle/deb/buffbrain_0.1.1_amd64.deb
Windows (x86_64) bundle/nsis/BuffBrain_0.1.1_x64-setup.exe + BuffBrain_0.1.1_x64-setup.nsis

Regenerate Icons

python3 scripts/generate_icons.py

The source logo (src-tauri/icons/buffbrain-logo.png) is the single source of truth. The script generates all PNG sizes, ICNS, ICO, and tray variants from it.


✦ Roadmap

  • On-device semantic search (MiniLM-L6)
  • Heuristic + optional LLM classification
  • Tray icon + auto-start
  • Settings UI (theme, AI, tray, autostart)
  • Linux support (.deb)
  • Windows support (.exe + NSIS installer)
  • Clipboard history sync (iCloud)
  • Multi-device or local network sync
  • Custom embedding models (bring your own ONNX)
  • Regex-based search filter
  • Export/import clipboard history

✦ License

MIT Β© BuffBrain β€” an open source project by Eulogik.


Built with ❀️ using Rust, React, and ONNX Runtime.
BuffBrain is crafted by Eulogik β€” we build tools that think.
BuffBrain β€” the clipboard manager that actually understands what you copied.