A cloud-hosted database that turns your raw thoughts into searchable, AI-accessible knowledge. You'll set up a PostgreSQL instance with vector embeddings, deploy an MCP server on top of it, and connect your favourite AI tools so they can read and write to a shared memory.
Roughly 30 minutes. No programming required — every step is copy-and-paste.
- Supabase — Hosts the database and runs the server-side functions
- OpenRouter — Routes embedding and metadata-extraction calls to the right AI models
| Component | Typical Cost |
|---|---|
| Supabase (free tier) | $0 |
| Embeddings via text-embedding-3-small | ~$0.02 per million tokens |
| Metadata extraction via gpt-4o-mini | ~$0.15 per million input tokens |
At around 20 thoughts per day, expect roughly $0.10–0.30 per month in OpenRouter API charges.
Throughout this guide you'll create accounts and generate keys. Keep them in one place so you can reference them later. Copy the block below into any text editor:
CEREBRO CREDENTIALS
═══════════════════════════════
SUPABASE
Email: ____________
Database password: ____________ ← Step 1
Project ref: ____________ ← Step 1
Project URL: ____________ ← Step 3
Service role key: ____________ ← Step 3
OPENROUTER
API key: ____________ ← Step 4
CEREBRO
MCP Access Key: ____________ ← Step 5
Server URL: ____________ ← Step 6
Connection URL: ____________ ← Step 6
═══════════════════════════════
Supabase provides the PostgreSQL database that stores your thoughts and the Edge Function runtime that hosts the MCP server.
- Go to supabase.com and create an account (GitHub login works)
- In the dashboard, click New Project
- Choose an organization (the default is fine)
- Name the project
cerebro(or your preference) - Generate a database password — copy it to your credential tracker now
- Select the region closest to you
- Click Create new project and wait for provisioning (~1–2 minutes)
Your project ref is the alphanumeric string in the dashboard URL:
supabase.com/dashboard/project/abcxyz123. Copy it to your tracker.
In the left sidebar: Database → Extensions → search for "vector" → flip pgvector ON.
In the left sidebar: SQL Editor → New query → paste and Run:
create table thoughts (
id uuid default gen_random_uuid() primary key,
content text not null,
embedding vector(1536),
metadata jsonb default '{}'::jsonb,
created_at timestamptz default now(),
updated_at timestamptz default now()
);
-- Index for fast vector similarity search
create index on thoughts
using hnsw (embedding vector_cosine_ops);
-- Index for filtering by metadata fields
create index on thoughts using gin (metadata);
-- Index for date range queries
create index on thoughts (created_at desc);
-- Auto-update the updated_at timestamp
create or replace function update_updated_at()
returns trigger as $$
begin
new.updated_at = now();
return new;
end;
$$ language plpgsql;
create trigger thoughts_updated_at
before update on thoughts
for each row
execute function update_updated_at();New query → paste and Run:
create or replace function match_thoughts(
query_embedding vector(1536),
match_threshold float default 0.7,
match_count int default 10,
filter jsonb default '{}'::jsonb
)
returns table (
id uuid,
content text,
metadata jsonb,
similarity float,
created_at timestamptz
)
language plpgsql
as $$
begin
return query
select
t.id,
t.content,
t.metadata,
1 - (t.embedding <=> query_embedding) as similarity,
t.created_at
from thoughts t
where 1 - (t.embedding <=> query_embedding) > match_threshold
and (filter = '{}'::jsonb or t.metadata @> filter)
order by t.embedding <=> query_embedding
limit match_count;
end;
$$;One more new query:
alter table thoughts enable row level security;
create policy "Service role full access"
on thoughts
for all
using (auth.role() = 'service_role');Open the Table Editor in the sidebar — you should see a thoughts table with six columns (id, content, embedding, metadata, created_at, updated_at). Then check Database → Functions and confirm match_thoughts appears in the list.
Open the Supabase sidebar: Settings (gear icon) → API. Grab these two values and paste them into your credential tracker:
- Project URL — shown at the top of the API page
- Secret key — listed under "API keys" (previously called "Service role key"). Click the eye icon to reveal it, then copy.
⚠️ The secret key grants full database access. Keep it private — don't share it or commit it to a repo.
OpenRouter acts as a single gateway to many AI models. Cerebro uses it for both embedding generation and metadata extraction.
- Sign up at openrouter.ai
- Navigate to openrouter.ai/keys
- Click Create Key and name it
cerebro - Copy the key to your credential tracker right away
- Under Credits, add $5 (this covers months of normal usage)
Your MCP server sits behind a public URL. To prevent unauthorized access, you'll generate a random key that the server checks on every request.
Run one of these commands in your terminal to produce a 64-character hex string:
Mac/Linux:
openssl rand -hex 32Windows (PowerShell):
-join ((1..32) | ForEach-Object { '{0:x2}' -f (Get-Random -Maximum 256) })Save the output in your credential tracker under MCP Access Key — you'll set it as a Supabase secret in the next step.
Mac (Homebrew):
brew install supabase/tap/supabaseWindows (Scoop):
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabaseLinux:
npm install -g supabasesupabase login
supabase link --project-ref YOUR_PROJECT_REFsupabase secrets set MCP_ACCESS_KEY=your-access-key-from-step-5
supabase secrets set OPENROUTER_API_KEY=your-openrouter-key-heresupabase functions new cerebro-mcpCopy the contents of integrations/mcp-server/deno.json into supabase/functions/cerebro-mcp/deno.json.
Copy the contents of integrations/mcp-server/index.ts into supabase/functions/cerebro-mcp/index.ts.
Deploy:
supabase functions deploy cerebro-mcp --no-verify-jwtYour MCP server is now live at:
https://YOUR_PROJECT_REF.supabase.co/functions/v1/cerebro-mcp
Build your MCP Connection URL by setting the x-brain-key header to your access key:
URL: https://YOUR_PROJECT_REF.supabase.co/functions/v1/cerebro-mcp
Header: x-brain-key: your-access-key
Paste both into your credential tracker.
Grab your MCP Connection URL from the credential tracker.
- Open Claude Desktop → Settings → Connectors
- Click Add custom connector
- Name:
Cerebro - Remote MCP server URL: paste your MCP Connection URL
- Click Add
Start a new conversation and Cerebro's tools will be available.
Requires a paid ChatGPT plan. Works on web at chatgpt.com.
- Go to Settings → Apps & Connectors → Advanced settings → toggle Developer mode ON
- Back in Apps & Connectors, click Create
- Name:
Cerebro - MCP endpoint URL: paste your MCP Connection URL
- Authentication: No Authentication (the key is embedded in the URL)
- Click Create
If ChatGPT doesn't pick up the tools on its own, tell it explicitly: "Use the search_thoughts tool to find my notes about X."
claude mcp add --transport http cerebro \
https://YOUR_PROJECT_REF.supabase.co/functions/v1/cerebro-mcp \
--header "x-brain-key: your-access-key"Option A: Remote URL. If your client supports remote MCP servers, paste the full MCP Connection URL directly.
Option B: mcp-remote bridge. For clients that only support local stdio servers, use the mcp-remote npm package to bridge the connection:
{
"mcpServers": {
"cerebro": {
"command": "npx",
"args": [
"mcp-remote",
"https://YOUR_PROJECT_REF.supabase.co/functions/v1/cerebro-mcp",
"--header",
"x-brain-key:${BRAIN_KEY}"
],
"env": {
"BRAIN_KEY": "your-access-key"
}
}
}
}Your AI client now has four Cerebro tools available. Here are some things to try:
| What to Say | What Happens |
|---|---|
| "Save this: decided to move the launch to March 15" | Captures the thought, extracts metadata automatically |
| "Remember that Marcus wants to move to the platform team" | Captures with people + topics detected |
| "What did I capture about career changes?" | Semantic search across all thoughts |
| "Show me what I captured this week" | Lists recent thoughts with date filters |
| "How many thoughts do I have?" | Returns totals, type breakdown, top topics |
Quick test — capture:
Remember this: Sarah mentioned she's thinking about leaving her job to start a consulting business
You should see a confirmation with the auto-extracted type, topics, and people.
Quick test — search:
What did I capture about Sarah?
This should return the thought above, even though you searched for "Sarah" and the thought contains "leaving her job." That's the vector similarity search at work.
Tools don't appear in Claude Desktop Check that the connector is added under Settings → Connectors and that it's toggled on for the current conversation.
401 errors on every request
The access key doesn't match what's stored in Supabase Secrets. Make sure your client sends the x-brain-key header with the exact value of your MCP_ACCESS_KEY.
Search comes back empty Make sure you've captured at least one thought first. You can also try lowering the threshold: "search with threshold 0.3" casts a wider net.
Responses take several seconds The first request after a period of inactivity wakes up the Edge Function (cold start). Follow-up calls in the same session are faster. If it stays slow, check that your Supabase project region is near you.
Capture flow: your text → capture_thought tool → two parallel API calls (embedding generation + LLM metadata extraction) → single row inserted into Supabase → confirmation returned.
Search flow: your query → search_thoughts tool → query gets embedded → pgvector cosine-similarity scan across all rows → results ranked by semantic closeness.
This is why "career changes" matches a note about "Sarah thinking about leaving" — the vectors encode meaning, not keywords.
Since all model calls go through OpenRouter, you can swap to a different model by editing the model identifiers in index.ts and redeploying. Browse options at openrouter.ai/models. Just keep embedding output at 1536 dimensions to stay compatible with existing data.
Before moving on, confirm all of these pass:
- Supabase Dashboard → Table Editor shows
thoughtstable with 6 columns (id, content, embedding, metadata, created_at, updated_at) - Supabase Dashboard → Database → Functions shows
match_thoughts - Edge Function responds — visiting
https://YOUR_PROJECT_REF.supabase.co/functions/v1/cerebro-mcpin a browser returns a page (not a 404 or 500) - Capture works — in your AI client, say "Remember this: Sarah mentioned she's thinking about leaving her job to start a consulting business" → you get a confirmation with metadata (topics, people, type)
- Search works — ask "What did I capture about Sarah?" → returns the thought you just captured with a similarity score
- Supabase data — Table Editor →
thoughtsshows at least one row withmetadata.source="mcp"and a non-nullembedding
If any check fails, see the Troubleshooting section above.
Once your MCP server is working, you can add more ways to capture thoughts. See the Cerebro Setup Guide for the recommended order, or jump directly:
| Integration | Guide | What It Does |
|---|---|---|
| Microsoft Teams | Teams Setup | DM or @mention a bot in Teams |
| Discord | Discord Setup | /capture and /search slash commands |
| Alexa | Alexa Setup | "Alexa, tell cerebro …" voice commands |
| Calendar Reminders | Reminders Setup | Auto-create O365/Google calendar events from captured dates |
| Daily Digest | Digest Setup | Automated daily/weekly summaries to Teams + Discord |
| Microsoft Graph daily ingest | Graph Ingest Setup | Once configured, your M365 mail / calendar / OneNote / OneDrive content auto-flows into Cerebro every morning |