Skip to main content

BrainMarks

Local-first, agentic bookmark RAG. Turn your browser bookmarks into a queryable knowledge base — ask a natural-language question and get a cited, synthesized answer from your own saved pages. Nothing leaves your machine.

❯ what was that article about local-first architecture?

  Three bookmarks in your index cover local-first architecture:
  - The Local-First Software Manifesto argues apps work offline first... [1]
  - Embedded RAG comparison shows local vector stores remove servers... [2]

  [tool] search_bookmarks · [tool] fetch_page

Features (Phase 1 — shipped)

  • Agentic chat — LangGraph agent with tool calling (search bookmarks, fetch pages, web search). SSE streaming, live RAG pipeline visualization, session memory.
  • Hybrid retrieval — LlamaIndex QueryFusionRetriever: vector (ChromaDB + sentence-transformers) fused with BM25 (Reciprocal Rank Fusion), deduplicated by source.
  • Browser extension (Chrome / Brave / Edge / Firefox) — one-click full import, selective tree picker, save current page, opt-in background sync, side-panel chat.
  • Webapp — chat, library (bookmarks + web sources), dashboard, admin. Hacker-terminal design.
  • BYOM — bring your own model: Ollama, OpenAI, Groq, Anthropic, OpenRouter, or any OpenAI-compatible endpoint. Provider presets in Admin, no raw URLs.
  • Privacy-first — zero telemetry, local SQLite + ChromaDB, air-gapped capable (Ollama + local embeddings). PRIVACY_MODE=strict blocks non-localhost models by default.
  • Prompt-injection guardrail — retrieved content is structurally delimited as untrusted data; the agent can't be redirected by page contents.

Install

Prerequisite: install uv (the Python package/venv manager) once:

# Linux / macOS
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Install BrainMarks (any platform — Linux / macOS / Windows):

uv tool install brainmarks-agent
brainmarks          # starts server on :8008 + opens the webapp

The wheel bundles the webapp UI and the CLI. brainmarks sets up autostart and prints your webapp URL, extension store links, and access token.

Then install the extension (Chrome Web Store / Firefox Add-ons) — enable sync in the popup and import your bookmarks.

Quick Start

  1. Install (above), run brainmarks
  2. Install the extension, toggle sync ON, import bookmarks (full or pick folders)
  3. Configure your model: Admin → provider (e.g. OpenRouter) + model + API key, or leave default Ollama
  4. Ask in Chat or the side panel: "what was that article about local-first architecture?"

Desktop captures, everywhere reads: the extension (bookmark capture) is desktop-only — mobile browsers have no extension API. The webapp is a read/search surface; remote mode (Phase 2) makes your index reachable from anywhere.

Configuration

Config precedence: environment vars > YAML (--config) > CWD .env > ~/.brainmarks/.env > defaults.

Key Default Purpose
PROVIDER ollama ollama | openai | groq | anthropic | openrouter | custom
LLM_MODEL llama3.2:3b Model name (provider-prefixed for cloud, e.g. openrouter/google/gemma-2-9b-it)
LLM_API_KEY ollama Provider key (leave blank in Admin to keep current)
EMBEDDING_MODEL all-MiniLM-L6-v2 Runs locally via sentence-transformers (downloads once; no key)
PRIVACY_MODE strict strict blocks non-localhost LLM endpoints; disabled allows cloud providers
TAGGING_ENABLED true LLM tagging at ingestion (Phase 2 wiring; dedicated tagger model optional)

Set them in the Admin panel (persists across restarts) or .env.

Architecture

API: the stable, third-party-consumable REST surface (auth, curl quickstart, endpoint reference) is documented in docs/api.md. Interactive docs at /docs (Swagger) and /openapi.json.

Browser Extension (vanilla MV3)  ─┐
Webapp (React + Vite + shadcn + motion) ─┤── HTTP :8008
                                         ▼
                    FastAPI backend
                      LangGraph agent (LiteLLM router, MemorySaver checkpointer)
                        Tools: search_bookmarks · fetch_page · web_search
                      LlamaIndex QueryFusionRetriever (vector + BM25, RRF)
                      Ingestion: fetch → extract → chunk → embed → tag
                      Stores: SQLite (metadata) · ChromaDB (vectors) · ~/.brainmarks

Development

git clone https://github.com/Akshxdev/BrainMarks.git && cd BrainMarks
uv sync                          # backend deps + dev group
uv run brainmarks                # backend on :8008
cd webapp && npm install && npm run dev   # webapp on :5173 (CORS configured)

uv run pytest                    # 56 tests
cd webapp && npm run build       # type-check + bundle
python scripts/generate_openapi.py  # regenerate frontend API types from the contract

Extension: chrome://extensions → Developer mode → Load unpacked → extension/.

Full project docs live in the Obsidian vault (see AGENTS.md for the path).

Roadmap

  • Phase 1 ✅ — core RAG, agent, extension, webapp, shipping
  • Phase 2 (next) — LLM categorization (real topic tags), web sources lifecycle, MCP server/client, Mem0 memory, document upload, remote mode + token auth
  • Phase 3 — dead-link detection, duplicates, recommendations, graph memory (Cognee opt-in)
  • Phase 4 — web archiving, history indexing, knowledge graph viz, scheduled digests, multi-user
  • Phase 5 — REST API, collaborative annotations, mobile companion

License

MIT. Dependencies MIT / Apache-2.0 compatible.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainmarks_agent-0.1.0.tar.gz (609.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainmarks_agent-0.1.0-py3-none-any.whl (661.0 kB view details)

Uploaded Python 3

File details

Details for the file brainmarks_agent-0.1.0.tar.gz.

File metadata

  • Download URL: brainmarks_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 609.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brainmarks_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff17d92eb916d5b0dd843d62a02d4dc27127582cc96e729eb1cb138ddcfebe01
MD5 92d0b9ff7bb0bd1eb68b0ba899041b95
BLAKE2b-256 6bfa40ecac1dd79f34b7787fccfd5807898873b77a14945aae6176b8b9084636

See more details on using hashes here.

File details

Details for the file brainmarks_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brainmarks_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 661.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brainmarks_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1789645c8703ea2414f2dbe66488bfa081f9f119ddc4e453191efa652c6b7bbd
MD5 cef97b482ce442b7f3348e28f1f2157f
BLAKE2b-256 16288b95090bd8ec5f779bfa4a0657955e7f2655f17161438084996bb435345a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page