📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Build a Self-Improving Claude Knowledge Base with ONE Prompt

Jay E | RoboNuggets12:35

Transcription

Some weeks ago, Andre Karpathy, one of the leading voices in AI, quietly posted how he runs his own second brain. Thousands of people saved that post, but only a handful of technical people ever really did build one. Today, we're going to fix that, because I'm going to show you how to build your own self-evolving Claude knowledge base in just one prompt. And the best part about it is that we're not using any complex tools, no Obsidian, no vector or rag databases, and no complicated setup. We just have one self-improving second brain that is far more powerful on day 100 than it was on day one. Let's dive [music] into it.

Now, before we go through the system itself, I'll just quickly show you how easy it is to set up. Because with these second brain systems, I'd argue that you actually don't need any other extra tools like Obsidian or rag databases or any of those fancy technical tools in order to get started. All you would really need is Claude and a well-crafted prompt like this that basically instructs Claude to create the folders for you and set up the system in your own computer. So, I'll make this available down below so that you can copy it as well.

And a key aspect of this prompt, which I wanted to highlight, is that I actually included the LLM Wiki pattern of Andre Karpathy himself, so that you're setting up your second brain system using the best practices straight from the source. And mind you, this same system is what Andre Karpathy has now highlighted in this now popular post of his. And from his knowledge base, he has around 100 articles in here and more than 400,000 words. So, if it works for one of the most respected AI researchers alive, then it'll probably work for yourself as well.

And by the way, if you're interested in going from just using AI to getting paid for it, then check out the Robo Nuggets community down in the description. We've got founders in there who landed their first client in weeks, live build sessions where we create this stuff together, and the actual templates behind what I just showed in this video. The community's also the reason these lessons get made, so see that below if that's for you.

So, personally, if you've been following me for a while, you know that I'm using Claude via the VS Code extension, but just to make this as simple as possible, I'll be using the desktop app for this demo. Which, if you're completely new, you can just download that under claude.ai/downloads, and you'll be able to find that desktop app over here.

So now from here, if you head over to Cloud Code, which is the most powerful out of these different services that you can use Cloud in, and if we paste that second brain prompt in this new session, Cloud will just tell you what it is about to do so that it can get your confirmation once. And once you're okay with that, you can just say go ahead and it will build all of these folders and all of these best practices, which we'll be talking about in this lesson. And so this is an important part, right? Because instead of you having to create these folders yourself and creating these files yourself, you can just actually have Cloud Code do all of that for you end-to-end. So we'll come back to this after it's built our second brain setup here.

And after just a few seconds, it now created those files for us, put it in this folder called knowledge base, and confirmed that the structure of our self-evolving second brain is now fully set up. And so just to show you, if I navigate to this specific folder now on my device, you can see that it created those folders for us, which will now be the core of our knowledge base, which Cloud will now self-update as we talk with Cloud more to build up this second brain of ours.

So before we start using this system, let's understand it because it's actually beautifully simple. There's only five building blocks to it, and as you saw, it's all just folders and text files, and there's nothing really technical or scary about it.

Now these three blocks in the middle are the three folders that it created for you, which starts with the inputs. So this is going to be the raw folder, which is going to basically be a dumping ground of all of the research and all of the files that you want your agent to capture. It can be as messy as you want, which is why it's the raw folder, because the organization layer actually happens on this second block, which is the wiki. So in this layer, we are asking our AI agent to organize those raw files into linked, summarized knowledge that you can search, which I'll show you in a bit, but that basically involves creating an index and log file so the Cloud Code has a proper map, so to speak, of the inputs that you placed here. And then the third block would be the outputs. So whenever you ask, let's say Claude code to create PDFs for you or to create, let's say slide packs for you or even applications based on the wiki as well as the inputs that you fed it, then it all lives in this outputs folder.

Now, those are the sort of three big blocks behind this whole system, but at the top layer of it is this claw.md file, which is something that you can think of as an operating manual. So, this is literally just a text file, a markdown file, which are rules that your whole second brain runs on. So, every time you talk to Claude code, this markdown file is actually sent as a system prompt for your agent and it just tells the agent how to read, write, and maintain everything below. And as best practice, which Karpathy also highlighted, is that this claw.md file, it is maintained by the agent itself, which means that any self-evolution or any updates to it is done by your agent as well.

And so, just to demystify this a bit more, if we open this claw.md that was created for us, it just has instructions for your Claude that talks about how this knowledge base is a self-improving one based on Karpathy's LLM wiki pattern. It gives it the view of the building blocks and the architecture and so on.

And finally, the fifth building block is this dream sequence. So, I'll illustrate how this happens in a bit, but essentially in Karpathy's viral article, he talked about this as a lint or a health check, where you set up some sort of routine or a scheduled task, where let's say every week or every day, if you wanted it to happen more regularly, Claude actually audits itself, flags any contradictions in the wiki, and also basically just updates everything like this whole setup to make sure that this second brain of yours is updated based on the latest inputs that you provided.

And so, if we go back to our session with Claude, you can see that that dream sequence is now scheduled, says that it runs every Monday. What it basically does is it ingests anything new in raw, then does a lint sequence, which is basically just making sure that contradictions, stale claims, any duplicates, or any orphans within this whole wiki index has been properly accounted for. And here in the Claude desktop app, you actually have a nice way to view it over here at routines and here you'll be able to find that knowledge base dream sequence where you can also revise it here if you wish.

And that's it. To summarize, the five building blocks are as follows. You feed it raw inputs, it organizes that into a navigable wiki, you get your outputs or artifacts back in this folder, the claw.md basically informs your agent how to run the whole thing, and you have your dream sequence which makes sure that the whole system is clean and is self-updating. So with just one prompt you are able to set up this whole thing in less than 5 minutes.

But now here comes the fun part because I'll be teaching you how to use it and how to optimize it depending on the topic that you intend to use this second brain system for. And what I did as part of that prompt is that I actually included a command for Claude to teach you as well how to use it. And there's basically three things to it. The first one is for you to feed it the inputs that you would need depending on your topic. The second one is for you to ask it. So let's say you have a particular question in mind from your second brain then I'll show how that works as well. And finally, I'll illustrate how to do the dream sequence which anyway runs in the background but you can actually invoke or run this yourself manually if you wish.

Now as part of this prompt, what you can see is that I included this refinement question near the end where you have the option to give Claude a visibility of the topic or the focus for this wiki. So I just told it earlier that it's for a subject that I'm learning and then secondly, it will also ask you a question if you want to pull knowledge from the internet on that topic or if you want to put in the files yourself.

Now for the sake of this demo, I chose the topic of AI and the upcoming agentic industry and I actually asked it to do some deep research on this topic to pull sources into the raw folder. And so it ran that research in the background and now after a few minutes, it told me that it dumped all of those learnings and research into raw and it updated the files within wiki in order to make sure that it has that sort of proper understanding of where to find these raw files if in case I ask for it next time.

And so, now if we jump over to our knowledge base section here, you can see under raw that it included all of the articles, all of the pages that it scoured all over the internet. And so, you can see this is sort of unorganized by design. And the great thing about this folder is that you can actually choose to let the agents put stuff in here. Let's say you did what I just did where you ask it to do some deep research on a particular topic, or if you want to put your files in here as well, that is completely up to you.

And if in case you want to add in articles or knowledge pieces manually, you can also do that just by sharing the links of articles you read, let's say this one, into Claude. So, for example, on mobile, this is really easy where you just click the share icon, and if you send that link and just ask it to save it by default, because of its operating manual now, it now knows that when you say save this, it just saves this article as part of your raw folder. So, you can see when it ingested that, it included the raw source to this markdown file. It updated the wiki as well. And apart from that, it also updated the wiki so that it is much easier to retrieve later on.

And talking about the wiki, if we go to that specific folder, you can see there's essentially three files to this. One is the index, which if you look at that, that is basically a table of contents, which just makes it easier for your AI agent to browse through your knowledge base in a much faster way. So, it will just list all of the concepts, the entities, as well as the sources that you include in your knowledge base. And this functions as a sort of a map for Claude to parse through your second brain.

And then you have the log, which is just a useful file in order for Claude code to have a proper log of the stuff that it added and removed in your specific second brain. So, you can see here that it has date stamps on when the knowledge base was created, what we did exactly, like this deep research piece that we did, and also that injection piece on the article that we just ask it to save for us.

And finally, you have this processed markdown file. And if you open that, you can see that its description is that it just says which raw files have already been ingested into the wiki. And so, as your second brain grows more and more, this just makes it easier for your AI agent to identify, okay, which particular raw files have I already processed in the last round, so that the next time that I need to do like a dream sequence, then I wouldn't need to touch those files or look at those files again.

Now, the other great thing about this setup is that you can actually customize it however that you wish. For example, right now, by default, you can see that whenever you ingest a new source, it actually goes ahead and updates the wiki for us in order to update the index as well as the log. In case you want to tweak that, you can just send a simple prompt where you tell Claude to update your second brain system and say that when we ingest new raw files, don't auto-update the wiki, but instead let the dream sequence handle that. And apart from that, I also ask it to have the dream sequence happen daily to make sure that any new raw files that we capture throughout the day are updated the following day.

And so, that is one very simple way by which you can tweak the knowledge-based second brain system to fit whatever it is that you need. And from that simple tweak, your Claude code has now self-edited its operating manual, its claude.md, and it also now flipped the dream sequence to happen daily instead of weekly.

And just to demo that, let's say we want to run the dream sequence manually, we can just also invoke it via natural language, and you can see what Claude code is doing here is listing all of the files in your raw folder, it is comparing that with the process registry, which we showed earlier, and it will fold them into the wiki so that it self-evolves all of the connections from within that database. And once it's done with the dream sequence, it now made changes to the wiki, which allows it to map and traverse your knowledge base much easier the next time you ask it.

And so, once you have this simple knowledge-based setup, then as you fill it up with your own personal context or maybe internal working files that you need to query down the line, then that is now going to be easy for you because literally all of the context that you have built up internally is now contained in just these three folders.

Just to give one example, you can see here that I just queried my own knowledge base to ask for my summary notes from Google I/O, which I was basically feeding it once I was at the event in order to jot down notes. So, it was able to pull from our wiki and also find the specific raw file for that in order to surface the notes that I had during the day.

And so, there you go. Without any fancy tooling, with just Claude at our side, we were able to set up this self-evolving second brain setup with five building blocks through just one prompt. And as mentioned, if you want to master this agentic AI space a bit more seriously with topics like these, then you can just visit and check out the Robo Nuggets community, where we can take you from zero to mastery around these agentic AI systems, and also a track on how you can earn from this space as well with all the courses and foundations that we are teaching across the classroom. So, if that sounds good to you, then check out the community down below. And if you learned something new from this quick tutorial, then consider subscribing because that helps me a lot to put out more educational stuff like this. As always, thanks for watching until the end, and I'll see you all next time. >> [music]