Blog Logo

I Built a Second Brain with AI (and I Never Lose What I Learn Anymore)

Let me confess something that probably happens to you too. I’ve been saving stuff for years with the feeling that someday it’ll come in handy - and that “someday” never comes. A Twitter thread, a YouTube video, a PDF, a good conversation with Claude, a solid ChatGPT response, a link that looked like gold… all of it piling up in different folders, different apps, different corners of my hard drive and the internet.

And for a while, you feel smart about it. You think: great, this isn’t going anywhere, I’ve got it saved. But then you come back weeks later and what you have isn’t knowledge. It’s a very well-stocked digital junk room.

That’s what was happening to me. Information wasn’t the problem - I had plenty of that. What I was missing was something much harder: a way to turn all that compulsive saving into something actually useful. Something that didn’t just accumulate, but distilled. Something that didn’t depend on any platform or trend. And above all, something that didn’t create more work than it saved.

So I built an absurdly simple system that I’ve been really happy with. Not because it’s sophisticated - but precisely because it isn’t. It’s small, understandable, and it actually reduces friction.


The problem wasn’t saving more: it was never digesting anything

For a long time I thought my problem was the tool. That I needed a better notes app. That I was missing a good article-saving extension. That I should switch to a different bookmark system. Notion, Obsidian, Chrome bookmarks, Google Drive folders… I tried all of it. And I’m not saying those things don’t help - but in my case I was looking in the wrong place.

The real problem was much simpler and a lot more uncomfortable to admit: I was capturing a ton and synthesizing almost nothing.

That’s what got me obsessed with one specific idea: I didn’t want another box to put things in. I wanted a mechanism to bring what I’d saved back to life. I wanted notes to evolve. I wanted a good AI response to not die inside a closed interface.

And that’s where this second brain comes in.

Before going further, credit where it’s due - this isn’t my invention. Andrej Karpathy has been pushing for a while on the idea that the real value of AI isn’t in asking it one-off questions, but in how you integrate it into your context, memory, and daily workflow. And Carlos Azaustre has also shared some really sharp ideas about using AI in a practical way. I just took that intuition and turned it into a system that works for me.


The simplest idea in the whole system: raw/ and wiki/

The whole thing lives in two folders. That’s it. On your computer. No server, no Docker required, no database. 100% yours.

raw/ is the inbox. The chaotic zone. Where the rough stuff lands without much ceremony. You can drop in a plain text note, a transcript, a Claude response you thought was especially good, meeting notes, ideas for a project, or the content of an article you copy-pasted. It doesn’t need to look nice. In fact, it’s better if it doesn’t slow you down.

wiki/ is something else. No noise allowed there. That’s where you want digested knowledge. Markdown files, clean, easy to open in any editor, designed to grow over time. It’s the difference between having ingredients scattered all over the counter and having an actual meal you can eat.

The AI works as the chef in between. It reads whatever you’ve dropped in raw/, figures out what it’s about, checks if there’s already a related page in wiki/, and either creates or updates it. Then it archives the original material in raw/procesados/ so it doesn’t get reprocessed every time.

Said like that, it sounds trivial. But it changes things quite a bit for me - because I’m no longer saving stuff and forgetting about it. I’m feeding a system that keeps building a cleaner layer of knowledge. And that, over time, is worth infinitely more than another bucket full of dead links.


Why I didn’t want to lock into any single AI provider

This was non-negotiable for me: I didn’t want to build this tied to one brand. Things change fast enough as it is without also locking yourself into one API and having to rewrite half your system every time something better comes out.

The repo is set up to work with any provider. My main recommendation is OpenRouter - not because they’re paying me, but because for small scripts like this it makes life easy. One API, similar format to OpenAI’s, and from there you can try Claude, GPT, Gemini, Llama, DeepSeek and half a zoo without barely touching the code.

But if you don’t want to go through OpenRouter, Gemini directly is a very reasonable starting point, especially since Google often has pretty generous conditions for trying models without burning through your wallet.

The point is that the system stays yours. If in three months you want to try something else, you change the provider in the config and that’s it. Your folders are still there. Your markdowns are still there. Your wiki is still yours.


How it’s set up and how you can set it up yourself

The repo is on GitHub and you can grab it right here. The structure looks like this:

segundo-cerebro-basico/
├── .env.example
├── package.json
├── scripts/
│   ├── index.ts
│   └── second-brain.config.example.json
└── second-brain/
    ├── raw/
    │   └── procesados/
    └── wiki/

Nothing fancy. And that’s exactly why I like it - I can understand it half asleep, and if something breaks I know where to look. raw/ is the entry point. wiki/ is the output layer. raw/procesados/ keeps the original material in case you ever want to trace where an idea came from or roll back if the model got something wrong.

Installation

Clone or download the repo and go into the folder:

git clone https://github.com/edunavajas/segundo-cerebro-basico.git
cd segundo-cerebro-basico

Install dependencies with pnpm:

pnpm install

If you don’t have pnpm installed:

npm install -g pnpm

Configuration

Copy the environment file example:

cp .env.example .env

On Windows (PowerShell):

Copy-Item .\.env.example .\.env

Open the .env file and fill in at least these three variables:

SECOND_BRAIN_PROVIDER=openrouter
SECOND_BRAIN_MODEL=anthropic/claude-4.5-sonnet
SECOND_BRAIN_API_KEY=your_key_here

If you’re using Gemini directly:

SECOND_BRAIN_PROVIDER=google
SECOND_BRAIN_MODEL=gemini-2.5-pro
GOOGLE_GENERATIVE_AI_API_KEY=your_key_here

If you want to tweak paths, temperature, or the system prompt, you can also create an optional config file:

cp scripts/second-brain.config.example.json scripts/second-brain.config.json

How to get your OpenRouter API key

Go to openrouter.ai, create an account, head to Keys, and generate a new one. Load it up with however many credits you want and you’ve got access to practically every model out there. For personal, occasional use you barely spend anything.

Test it before committing

The system has a config check command that validates your setup without making any API calls:

pnpm second-brain:check-config

And a dry-run that generates the articles without writing anything to disk or moving files - so you can see the output before committing:

pnpm second-brain:dry-run

When you’re ready to go for real:

pnpm second-brain

How it actually works day to day

Picture a normal day. You find a really good article about RAG. You have a conversation with Gemini about how to validate a business idea. Claude gives you a particularly good response about monetization. Instead of leaving each thing stranded in its own platform - or in a browser tab you’ll close tomorrow - you dump it in raw/. Sometimes in separate files. Sometimes just copy-pasting text into a .md or .txt. No ceremony required.

For example, if you find something online that interests you, select everything, copy it, and paste it into a new file inside raw/:

raw/
└── notes-on-rag.txt          ← what you just pasted

When you feel like it, run the script:

pnpm second-brain

And that mass of information starts to take shape. Where there was a messy note, a cleaner article appears in wiki/. Where you had three scattered ideas, you get one page with better structure and less noise. Where a good AI conversation used to die inside a closed interface, it becomes reusable knowledge.

The filename in wiki/ is generated by the AI based on the article title it creates - so you don’t need to worry about naming your notes in raw/ correctly. Just drop whatever you have and let the system handle the organizing.


Obsidian as a window, not as the system

Once you start having several pages in wiki/, opening that folder with Obsidian is a real pleasure. I’m saying this without fanaticism - I don’t like depending too much on any single app - but the truth is it fits really well here. You can search fast, edit comfortably, see links between notes if you’re into that, and generally feel like all that knowledge finally lives somewhere you can actually navigate.

Obsidian is free and works on any operating system. No special configuration needed: just point it at second-brain/wiki/ as a vault and you’re done.

What I like is that Obsidian here is NOT the system - it’s just the window. If tomorrow you prefer VS Code, or you just want to read the markdowns with any other editor, everything still works exactly the same. Your data is yours, in plain files, with no proprietary format.


The one thing I’d take away from all this

If I had to sum it all up in one idea, it’d be this: saving isn’t learning, and accumulating isn’t thinking better.

What changes the game isn’t having more notes. It’s having a system that turns raw material into something reusable. And that’s why I love this combination of raw/ + wiki/, provider-agnostic AI, plain markdown, and automation with a single command.

You don’t need a crazy infrastructure to start. You don’t need to sell your soul to any platform. You need a small, honest loop: capture fast, synthesize, keep what’s worth keeping, make it searchable, and repeat.

So if you recognize yourself in that feeling of having thousands of things saved and almost nothing actually integrated - give it a shot. The repo is right there at github.com/edunavajas/segundo-cerebro-basico, with everything you need to get started from minute zero.

And if you try it and it works for you, or you have ideas to improve it, let me know in the comments. I genuinely want to hear how it goes.


What do you think?

Leave your opinion, question or suggestion. Comments are synced with GitHub Discussions .

Back to blog