rahilp/second-brain-cloudflare

One memory layer, every AI tool. Store anything once — recall it in Claude, ChatGPT, Cursor, or any MCP client. Self-hosted on Cloudflare's free tier.

Second Brain – Personal & Team Memory for AI Tools

What it is – A cloud‑hosted “knowledge base” that stores your notes, decisions, preferences, and other project facts and makes them searchable by meaning (semantic search). It runs as a Cloudflare Worker backed by Cloudflare D1, Vectorize, Workers AI and KV, and talks to any MCP‑compatible AI assistant (Claude, ChatGPT, Cursor, Codex, etc.) via a simple REST/MCP API.


Why it matters

Problem How Second Brain solves it
AI assistants have no shared context – you repeat the same info in every app. A single, private + team‑wide memory layer that every client queries, so the same fact is available everywhere.
You have to remember exact wording to retrieve a note. Semantic embeddings let you recall by meaning; the same fact is found even if you phrase the query differently.
Keeping notes in many places (Obsidian, Notion, email, calendars) leads to drift. Integrations capture from those sources directly into the same brain, preserving the original source metadata.
Teams need a shared knowledge base but also personal privacy. Team Edition gives each user a private workspace plus a shared “company” layer; sharing moves a single canonical memory rather than copying it.
Scaling semantic search can become expensive. Uses Cloudflare Vectorize for cheap, fast vector search; falls back to keyword search if unavailable, and indexes grow automatically with nightly jobs.

Core features (high‑level)

  • Semantic capture & recall – remember, recall, append, update, etc. work with natural‑language queries.
  • Automatic organization – classification, duplicate detection, relationship graph, time‑aware ranking, weekly insights.
  • Multi‑layer access – personal (private), company (shared team), and future team layers.
  • Prompt Capsules – deterministic, read‑only “core” or project‑specific context blocks that can be prepended to prompts for LLM gateways.
  • Rich integrations – desktop app (no terminal needed), CLI, browser extension, Obsidian sync, Notion sync, calendar/email hooks, iOS shortcuts, and hooks for Claude Code, Codex, Cursor, VS Code Copilot, Gemini CLI.
  • Control & audit – dashboard lets you browse, edit, delete, export, and view history; admin tools manage members and sharing permissions.
  • Self‑hosted on your Cloudflare account – all data (vectors, credentials, memories) stays in your own account, not a third‑party SaaS.

How it works (simplified flow)

  1. Deploy – One‑click Cloudflare Workers deployment (or use the provided desktop app which does it for you). Resources created: D1 DB (SQL storage), Vectorize index, KV cache, Workers AI model.
  2. Capture – Any client calls the /capture endpoint (or MCP remember) with {content, source, tags, …}. The worker stores the text, runs an embedding model, classifies the entry, checks for duplicates, and adds it to the vector index.
  3. Organize – Background nightly jobs create a full‑text relevance index, link related memories, and generate weekly insights.
  4. Recall – A client sends a natural‑language query (recall). The worker performs a vector similarity search, re‑ranks with the full‑text index, follows relationships, and returns the most relevant memories (with source links).
  5. Prompt Capsules – Special tagged memories (capsule:*) are compiled into a deterministic, size‑limited text block that can be cached and used as a stable prefix for LLM prompts.

Getting started (quick steps)

  1. Desktop app – Download from the Releases page, run, set a password, and sign in to Cloudflare. The app provisions the worker and connects your AI tools automatically.
  2. Or manual deployment – npm install && npm run vectors:create && npm run deploy (requires Wrangler, Cloudflare account, and a D1/Vectorize plan).
  3. Connect a client – Use the provided MCP URL (https://<your‑worker>.workers.dev/mcp) with your AUTH_TOKEN (Bearer header). The README lists ready‑made integrations for Claude, ChatGPT, Cursor, VS Code, Obsidian, Notion, etc.
  4. Try it – curl -X POST https://<worker>/capture -H "Authorization: Bearer <token>" -d '{"content":"second brain is working","source":"test"}' should return {"ok":true,"id":"..."}.

Who should use it

  • Individual AI power users who want a persistent, searchable memory that works across Claude, ChatGPT, Copilot, etc.
  • Small to medium teams that need a shared “second brain” while keeping personal notes private.
  • Developers building custom AI agents or gateways that need a deterministic context block (Prompt Capsules).
  • Anyone who prefers their data to stay inside their own Cloudflare account rather than a SaaS provider.

Limitations & considerations

  • Relies on Cloudflare Vectorize; if the service is disabled the system falls back to keyword search, losing semantic quality.
  • Current Team Edition supports one shared team per brain (multi‑team planned for a future release).
  • Prompt Capsules have a hard 12 k‑character budget; oversized entries are skipped or cause a 409 error.
  • All client authentication is token‑based; query‑string tokens were removed in v3 for security.

TL;DR

Second Brain is a Cloudflare‑hosted, semantic memory store that lets you and your team give every AI assistant a consistent, searchable context. Deploy it with one click, capture from dozens of everyday tools, and retrieve information by meaning rather than exact phrasing—all while keeping the data under your own Cloudflare account.

Related

  • Project
  • Project
  • Project
  • Project
  • Project