Second Brain for AI - Persistent memory for Claude, ChatGPT & Cursor. Free.

by
Every AI conversation starts from zero. Your projects, decisions, and preferences disappear as soon as you close the chat. Second Brain fixes that. It is a self-hosted memory layer that works with Claude, ChatGPT, Cursor, and any MCP client. You can store context once and recall it by meaning instead of keywords. It includes duplicate detection, semantic search, and a web UI. Built on Cloudflare, it offers a free tier and your data remains yours. MIT licensed.

Add a comment

Replies

Best
💡 Bright idea

Semantic retrieval over stored context beats keyword search for memory, and the dedup layer is a smart addition since AI workflows generate a lot of overlapping notes. We've wrestled with context window management in multi-step AI tasks too: deciding when to summarize vs. fetch older context is genuinely tricky. How does the similarity threshold work when memories partially overlap? Can users tune it?

Great technical question. There are two thresholds at play. Below 0.85 similarity the new memory is stored as a separate entry. In the 0.85 to 0.95 band, it goes to LLM judgment to decide whether to add, replace, merge, or ignore based on actual content. Above 0.95 it treats it as a duplicate and skips storage entirely. topK is configurable so you can control how many candidates get pulled into that judgment step. Full threshold tunability is on the roadmap. right now the importance score influences recall ranking but does not factor into the merge or delete decision. That's actually a really interesting idea though. A high-importance memory probably should require stronger evidence before getting overwritten. Adding that to the roadmap.

Hi --

Just a quick update, we just added in the changes to use importance score for merge decisions. Thank you so much for your feedback! (even mentioned you in the issue!)

rerankWithTimeDecay now accepts an importanceScores map; scores 1–5 apply a 0.88–1.20× multiplier so high-importance memories surface above the recency cap without dominating fresh entries (score=0 stays neutral at 1.0×)

  • Recall path fetches importance_score alongside recall_count and passes it through to reranking

  • Smart merge/replace guard: if the target entry has importance_score ≥ 4, skip the overwrite and return flagged instead of silently replacing a critical memory

Issue:
PR:

how it's different than

 Great project, truly impressive work!

The main difference is infrastructure. Agentmemory, from what I see, runs a local server that you have to manage.

Second Brain deploys to Cloudflare Workers and runs entirely serverless. There is no process to handle, no Docker, and no Node runtime. Your data is stored in your own Cloudflare D1 and Vectorize. One-click deploy, free tier, it's done.

There’s a different tradeoff: Agentmemory offers more features, while Second Brain is easier to run and own.

is agent memory just for code?
Not at all… Second Brain works with any MCP-compatible client. Claude, ChatGPT, Cursor, Windsurf, whatever you use. It’s general purpose memory, not tied to any specific workflow.
💎 Pixel perfection

what the actual setup experience looks like for someone who knows their way around cloudflare but isn't a backend developer. the github readme is usually where these projects lose 80% of potential users because the instructions assume a level of comfort with wrangler and environment variables that most people who would benefit from this don't have. is there a one-click deploy path or is it still a manual configuration process

This is genuinely the most useful feedback I've received today and you're 100% right. The README assumes too much. There is a one-click Deploy to Cloudflare button that handles the Worker, D1, and Vectorize setup automatically… no Wrangler, no CLI, no environment variables to configure manually. You click deploy, fill in a name, and it's live. I'm going to make that the first thing people see. Thank you for saying this out loud.

 The automatic setup is asking me for "dimensions" to be filled out, and I can't deploy. What am I missing here?

hi Anthony. It should automatically have the value, but the answer is 384. I’ll do a quick check tinunderdatsbf even that may be happening.

curious how it handles conflicting memories. if you store an architecture decision then change it a month later, does it override or accumulate? stale context injected confidently is probably worse than no context at all

Great question! This is actually something I spent a lot of time on. Second Brain has automatic contradiction detection built in. When you store a new memory, it checks your existing memories for semantic conflicts using vector similarity and LLM judgment. If it finds a contradiction, the old entry is deleted and the new one is stored as canonical. So if you change an architecture decision, the old one doesn't silently linger. You're right that stale context injected confidently is worse than no context and that's exactly why this was a priority build for me.
💡 Bright idea

This is a strong wedge. The bit I’d be most careful with is treating “newer” as automatically more correct when memories conflict. For writing/product work especially, an old positioning decision might still be canonical while a recent one-off chat is just exploration.

A lightweight status layer could help a lot: canonical, draft, preference, deprecated, maybe source-linked. Then the model can say “I found the current rule” vs “I found a past note that may be stale,” instead of injecting both with the same confidence.

 Valid. Newer isn’t always more correct. A positioning decision from six months ago can absolutely outrank a throwaway idea from yesterday. The current contradiction logic does lean on recency too heavily for that case.

The status layer you’re describing (canonical, draft, deprecated) is exactly the right fix. It’s on the roadmap but not shipped yet. The honest answer right now is that importance scoring and explicit pinning partially address it, but a first-class memory status field would close the gap properly. Adding this to the backlog with your framing… it’s more precise than how we had it scoped.

The between-session memory problem is real and this solves it well. The harder problem - at least for how I use AI - is within-session overflow. My conversations regularly hit 100K+ words before they die/lag to unusble. The context window can't hold it all anyway, so even within a single session I'm losing early context. What I actually want is a rolling summarizer that compresses as the thread grows - keeping the essential through-line while shedding weight. That plus persistent cross-session memory would be the full solution. This a great idea tho, one I really like!

You’ve described the problem precisely. Between-session memory is what Second Brain solves today. The within-session overflow problem… compressing a 100K word thread down to its essential through-line is issue #9 on our roadmap: Semantic Compression. Rolling summaries that shed weight while preserving the core narrative, then persisting those summaries across sessions so nothing is ever truly lost. You’ve basically described the full vision. We’re building it!

Memory as a separate product (rather than a feature of one chat client) is the right bet. The interesting bit is conflict resolution: when Claude and Cursor have both updated the same project entry over the last day with different framings, what wins? Last-write, semantic merge, or surfaced to the user? That choice usually decides whether the layer feels like trust or like noise after a few weeks of use.

this is exactly what we built for. Second Brain runs contradiction detection at capture time. If Claude and Cursor write conflicting framings, it resolves to the newer canonical entry and tags the resolution so nothing gets lost silently. In the gray zone (high similarity but not identical), an LLM decides whether to merge, replace, or append.

persistent memory is the piece most AI tools are missing right now. you end up re-explaining context every session which kills the usefulness for anything beyond one-off tasks. curious how this handles conflicting memories when your thinking evolves over time — does it version or just overwrite?

Exactly the problem that made me build this. On conflicting memories it does both depending on how you handle it. The `update` tool lets you explicitly overwrite a memory in place when your thinking changes. But there's also automatic contradiction detection: when you store something new, it checks existing memories for semantic conflicts and auto-resolves by replacing the old one with the new one as canonical. Full versioning history is on the roadmap but not there yet. For now it's explicit update or automatic conflict resolution.

The product is good and very needed for those who want very personalised chats.

But even claude has a good context window not that big but decent

Great point, and it's a common misconception worth clarifying! Context window is what the AI can see in a single session. Second Brain is what carries over between sessions. When you close Claude and open it tomorrow, that context window is gone. Second Brain is what fills it back in with what actually matters… your decisions, your preferences, your project history. They work together, not against each other.

 I might be wrong

Even ChatGPT has personalization

 It does, but only within ChatGPT. The moment you switch to Claude or Cursor, that memory is gone. Second Brain is the layer that works across all of them… one memory, every tool.

 yeah that is true.

Great solution. 😁👍

CC A

 appreciate you Duc! Are you building anything that deals with AI context or memory?

123
Next
Last