fmerian

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
Rohit Ghumare
how it's different than https://github.com/rohitg00/agen...
Rahil Pirani

@rohit_ghumare 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.

Rational Health
@rahilpirani is agent memory just for code?
Rahil Pirani
@health_rational 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.
Yan Trekhov

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

Rahil Pirani
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.
Jay Gangwar

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

Rahil Pirani
@jay_gangwar 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.
Jay Gangwar

@rahilpirani I might be wrong

Even ChatGPT has personalization

Rahil Pirani

@jay_gangwar 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.

Jay Gangwar

@rahilpirani yeah that is true.

Great solution. 😁👍

Ansari Adin

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

Rahil Pirani
@ansari_adin 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.
Duc Doba
CC A
Rahil Pirani

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

Nithin Raju

Does it work seamlessly with ChatGPT and Claude together?

Rahil Pirani

@nithin_raju1 Yes! Claude and ChatGPT both connect via MCP and pull from the same Second Brain memory layer. Store something in Claude, recall it in ChatGPT. Same context, same session history, across both.

That's actually one of the core reasons I built it... your memory shouldn't be locked to one tool.

Ozan

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?

Rahil Pirani
@ozandag 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.
Aiswarya Subramanian

Nice one @rahilpirani !

This can be run on-prem too?

Rahil Pirani
@aiswarya_s Thank you! It runs on Cloudflare Workers so it's not traditional on-prem, but since it deploys to your own Cloudflare account, your data never touches any third-party server. You own it completely. As close to on-prem as serverless gets!
Anand Thakkar

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?

Rahil Pirani
@anand_thakkar1 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.
Jim Jeffers

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.

Rahil Pirani

@jim_jeffers 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.

12
Next
Last