Karpathy's Obsidian RAG + Claude Code = CHEAT CODE

CChase AI
Computing/SoftwareSmall Business/StartupsManagementInternet Technology

Transcript

00:00:00Andrey Karpathy just gave us the keys
00:00:02to his personal Obsidian RAG system.
00:00:06And I put RAG in air quotes
00:00:07because this Obsidian power knowledge base
00:00:10has no vector database, no embeddings
00:00:12and no complicated retrieval process.
00:00:15Yet it solves the exact same problem
00:00:17that these more complicated RAG structures claim to do,
00:00:21which is allow our large language model
00:00:23to handle large amounts of documents and answer questions
00:00:27and gather accurate information about them.
00:00:30And the best part about this Obsidian powered system
00:00:32is that it is very lightweight, it's essentially free
00:00:36and it is the perfect middle ground
00:00:38for a solo operator or a small team.
00:00:41So today I'm gonna show you
00:00:42how Karpathy's Obsidian knowledge system works,
00:00:45how to set it up yourself
00:00:46and how it differs between traditional RAG systems
00:00:50so you know if this is the right option for you.
00:00:52So the process by which we are going to create
00:00:54this Obsidian powered knowledge system was laid out yesterday
00:00:58in a pretty comprehensive Twitter post by Andre Karpathy.
00:01:02Now the big takeaway from this post
00:01:04is that we are able to create
00:01:05large language model knowledge bases
00:01:07that essentially act in the same way
00:01:09as something like light RAG or RAG anything
00:01:12or any other graph RAG system with Obsidian.
00:01:17And we're able to do so in a rather simple manner
00:01:20by just having a clever structure to our file system
00:01:23and how we actually ingest data.
00:01:25And the end result is that I am able to ingest
00:01:28a pretty significant amount of data and documents
00:01:32into my Obsidian vault and use Claude code
00:01:35to ask questions about it,
00:01:36to figure out connections between different things,
00:01:38AKA the exact same thing you would do
00:01:41with a traditional RAG system,
00:01:43but with none of the overhead and a way simpler setup.
00:01:46And as Andre lays out, the setup looks something like this.
00:01:49First, we have data ingestion.
00:01:51We are bringing in articles,
00:01:52we're bringing in papers,
00:01:53we're bringing in repos from the internet or from wherever,
00:01:57and we're bringing it into a raw directory
00:02:00inside of our Obsidian vault.
00:02:02This is essentially the staging area
00:02:03before it gets turned into a Wiki.
00:02:05We as the human being in this interaction
00:02:07are able to see all of this happening via Obsidian.
00:02:10Obsidian for all intents and purposes is our front end.
00:02:13Here's where I can see where all the documents are laid out.
00:02:15Here's where I can read all the Wikis.
00:02:17So it isn't sort of abstracted away in a black box,
00:02:20like it isn't a RAG system.
00:02:21It's kind of hard, even in a graph RAG setup like Light RAG,
00:02:25to actually go inside of here and really see everything.
00:02:29I mean, I can, but as cool as this looks,
00:02:31this isn't very efficient.
00:02:33And from there, you just do a Q&A
00:02:35via something like Claude code.
00:02:37And like Andre laid out here,
00:02:38he expected that he would have to reach out
00:02:40for something like RAG,
00:02:42but the large language model has been pretty good
00:02:43about auto-maintaining index files
00:02:45and brief summary of all the documents it reads.
00:02:47And this is something we are gonna be able to do too
00:02:49with a pretty simple Claude.md file,
00:02:52which I will be giving you.
00:02:53And you will be able to find that Claude MD,
00:02:55as well as a written guide
00:02:56that comes with a bunch of prompts
00:02:57inside of my free Chase AI community.
00:03:00There will be a link to that
00:03:01in the description of this video.
00:03:03And speaking of Chase AI, and you knew this was coming,
00:03:06quick plug for my Claude code masterclass.
00:03:08Just released this a couple of weeks ago,
00:03:09and it is the number one place to go from zero to AI dev,
00:03:12especially if you do not come from a technical background.
00:03:15You can find a link to this in the pinned comment.
00:03:18So make sure to check this out.
00:03:19If you're serious about learning this tool.
00:03:22Now, before we jump into the specifics
00:03:24of how to set up this Obsidian system for yourself,
00:03:28let's go over the actual file structure
00:03:30because this is important to understand
00:03:32how data is coming into our vault
00:03:34and then getting turned into Wikis.
00:03:36So the Obsidian vault is where everything lives.
00:03:39As you'll see, if you've never used it before,
00:03:41when you download Obsidian,
00:03:42you are going to designate a specific folder as the vault.
00:03:45In my case, it is quite literally called the vault.
00:03:48That's where everything in Obsidian lives.
00:03:50As a sub folder of the vault,
00:03:52we are going to have the raw folder.
00:03:54The raw folder is where all of our research gets dumped.
00:03:58Anything we want to manually include in these Wikis gets put.
00:04:01This is essentially the staging folder.
00:04:02So this is where all the raw data is going to be held.
00:04:05This can be markdown files.
00:04:06This can be PDFs.
00:04:07And I'm going to show you how to use the Obsidian clipper
00:04:10to essentially turn any webpage into a markdown file
00:04:14like it's sent to the raw folder automatically.
00:04:16We will have another sub folder
00:04:18that is the Wiki folder.
00:04:19So what the large language model is going to do,
00:04:21what Cloud Code will do for us, is on demand,
00:04:24or you could have it even be a skill or have it be automated,
00:04:27is we are going to point it at the raw folder and say,
00:04:29"Hey, I want you to create a Wiki about whatever subject
00:04:33"you've been gathering information about."
00:04:35From there, it will then create a Wiki about that.
00:04:37So you can see we have three different Wikis here,
00:04:41one for AI agents, one for RAG systems,
00:04:43and one for content creation.
00:04:45Now, in between the Wiki folder and these sub Wiki folders
00:04:50is the master index markdown.
00:04:53This is essentially just a list
00:04:54of all of the different Wikis that have been created.
00:04:58Because the idea is when you, this is you,
00:05:02when you talk to Cloud Code, all right,
00:05:04that's Cloud Code over there, and say,
00:05:06"Hey, I want to learn more about AI agents.
00:05:08"Can you ask, I want to ask questions about my Wiki."
00:05:12Well, what is it going to do?
00:05:13Well, it's going to go to the vault
00:05:15because you're probably already in there.
00:05:17It's then going to go to the Wiki folder.
00:05:18It's going to go to the master index folder and say,
00:05:21"Hey, what Wikis have we created?
00:05:23"Oh, he wants to know about RAG systems."
00:05:26Okay, it goes down to RAG.
00:05:28And the Wiki folders themselves have index files
00:05:31which break down all of the additional content.
00:05:33So what Obsidian gives us
00:05:35and what this file structure gives us
00:05:36is a very clear path to find information,
00:05:39even if we have a ton of it floating around.
00:05:41And this helps Cloud Code
00:05:42because it's not going to have a ton of issues
00:05:45finding the data.
00:05:46We're not going to run a million tool calls
00:05:48to see what's in our file structure.
00:05:50But it also helps you because it's very clear where to go.
00:05:52For example, over here on the left is my Obsidian folder.
00:05:56I'm in the Obsidian UI,
00:05:57and we'll go through the download here in a second.
00:05:59But if I want to see a Wiki, what do I do?
00:06:01I just go to Wiki.
00:06:03I have a master index
00:06:04which lays down everything in there.
00:06:06Right now, it's just three things.
00:06:07But if there were 3,000, it still wouldn't be too difficult.
00:06:10And then from there, you know, I can click on it.
00:06:12It takes me to the index of that specific Wiki.
00:06:16And then I can look at different stuff inside of there.
00:06:18It's that simple.
00:06:19And it's that simple for AI too,
00:06:21which is why we're able to use
00:06:22essentially just a markdown file structure
00:06:24to somewhat mimic a rag system.
00:06:27So while that theory is cool,
00:06:28now let's go into how to actually set this up for yourself.
00:06:31First and foremost, you're going to need to download Obsidian.
00:06:33You're just going to head to obsidian.md, hit Download Now,
00:06:37go through the wizard.
00:06:38It's completely free.
00:06:40And you're going to designate some folder as the vault.
00:06:43Just create one, call it the vault.
00:06:45Makes it easy for me, and it'll probably work for you.
00:06:47After we create the vault,
00:06:49we now need to set up this file structure inside of it.
00:06:52The easiest way to do that is with Clawed Code.
00:06:54Simply open up Clawed Code in the vault.
00:06:57So that's the directory I'm in.
00:06:59And you're going to give it a prompt
00:07:01telling it to create this file structure.
00:07:03Now, luckily for you, I already created the prompt.
00:07:05So you can just copy this thing and paste it in a Clawed Code.
00:07:08Now, if you're like me and you've already been using Obsidian
00:07:10for a bit, you probably have a bunch of folders
00:07:13already in there.
00:07:14So maybe you don't want to call it raw.
00:07:17Maybe you want to call it something else.
00:07:18The whole point of it is you just need to designate
00:07:20some folder as, like I said, sort of the holding area
00:07:23or the staging area for where all this information
00:07:25is going to get dumped until it gets turned into a Wiki.
00:07:27So just as needed.
00:07:28Now, the next thing we want to do is create a Clawed.md file.
00:07:31Personal assistant type projects, things like this
00:07:33that are very Markdown heavy, Clawed.mds are perfect for.
00:07:37And this Clawed.md file is breaking down
00:07:40the knowledge base rules,
00:07:41as well as how to essentially traverse it.
00:07:43So again, that we aren't wasting tokens
00:07:44when we ask questions.
00:07:46Again, I have this entire Clawed.md template prompt
00:07:50you can use.
00:07:50This Clawed.md file is also telling Clawed
00:07:53how to structure these Markdown files.
00:07:55So it's very easy to traverse files
00:07:58with this Wiki links format.
00:08:00Now let's talk about how we can bring things
00:08:02into this raw folder.
00:08:03How we can get data into our system in the first place.
00:08:06Well, super easy way to do this
00:08:08is with the Obsidian Web Clipper.
00:08:10So I will put a link to this in the school,
00:08:13or you can go to obsidian.md/clipper.
00:08:16And this is just a Chrome extension,
00:08:18which makes it super easy to turn a webpage into data,
00:08:22into a Markdown file.
00:08:23Now, the one issue with this Web Clipper
00:08:25is it's going to struggle with images.
00:08:26It's just not even going to bring them in.
00:08:27I'll have them as a link.
00:08:29But I want to be able to see the images from these documents
00:08:31I ingest inside of Obsidian.
00:08:33So what do we do?
00:08:34Well, we are going to use an Obsidian community skill
00:08:37or Obsidian community plugin to help with this.
00:08:39So one of the cool things about Obsidian
00:08:41is the community plugins.
00:08:42There's thousands of them.
00:08:43So if you're inside of Obsidian,
00:08:46I'm inside the desktop app right now.
00:08:47If I come down here and I hit this little gear,
00:08:50I'm going to go to community plugins.
00:08:52I'm going to go to browse.
00:08:54And then you're going to search for local images plus.
00:08:56You're going to download it, install it, and turn it on.
00:09:00Make sure it's enabled.
00:09:01You can confirm it's enabled
00:09:03by heading to your community plugins tab
00:09:05and seeing this little tab turned on.
00:09:08Now, if we use the Obsidian web clipper,
00:09:11and I can see that over here as an extension,
00:09:13you can see what happens.
00:09:15It immediately pulls everything.
00:09:17And if I hit add to Obsidian,
00:09:19I can see this entire article, including the images.
00:09:21Now there is one thing we need to set up
00:09:24inside of the web clipper,
00:09:25and that's making sure it actually pulls it
00:09:26into the raw folder automatically.
00:09:29I don't want to have to manually do that.
00:09:30You're just going to head to the options on your web clipper.
00:09:34I just right clicked it.
00:09:35And then over here on the left, where it says default,
00:09:38I created my own new template,
00:09:39but you can stick on the default if you want,
00:09:42where it says location and note location right here.
00:09:47You're going to want to change that from clippings to raw.
00:09:52And that will make sure when you use the web clipper,
00:09:54it automatically goes into the raw folder.
00:09:56So now with the Obsidian web clipper extension
00:09:59and the images community plugin,
00:10:01we can now turn any webpage on the internet
00:10:04into a markdown file that will be used for our Wiki.
00:10:08But that is just one data funnel.
00:10:10That's a manual one.
00:10:11We can have Claude code do a bunch of heavy lifting too.
00:10:14So let's say I was trying to create a Wiki
00:10:16about Claude code skills.
00:10:17So I told Claude code,
00:10:18let's create a Wiki about Claude code skills.
00:10:20I already included some info in the raw folder,
00:10:23what we pulled in via the web clipper.
00:10:25Go conduct your own research and bring in the relevant raw
00:10:27MD files to generate that Wiki.
00:10:29So what is it going to do?
00:10:30It's going to go on the internet, use its standard web search,
00:10:32and it's going to create its own Wiki about Claude code
00:10:36skills.
00:10:37So what you see is that this raw folder,
00:10:40this whole raw pipeline, that's more for you.
00:10:42That's for when you mainly want to put in some information.
00:10:44Now you can have Claude code do that as well,
00:10:46but Claude code is also smart enough to essentially take the
00:10:49research,
00:10:50figure out what's relevant itself and just create the Wiki
00:10:53directly. This raw folder is really for you,
00:10:55the human being to have some level of organization.
00:10:58And here's what Claude code came back with.
00:10:59So it created the Claude code skills Wiki.
00:11:02We see here in the master index that it's referenced here.
00:11:05If I click on it,
00:11:07this then brings us to the index of Claude code skills.
00:11:10And right now it has four articles.
00:11:12So here's the skills overview article.
00:11:15You can see it links to websites and it also links to
00:11:18different articles within our obsidian vault.
00:11:21So if I click on skill ecosystem, here's more stuff.
00:11:25I click on the top skills, right? So on and so forth.
00:11:27There's a very clear pathway from one article to another and
00:11:30how these things relate,
00:11:32which means when you ask Claude code questions about these
00:11:34articles in these subjects,
00:11:35it's easy and cheap for it to answer questions about them,
00:11:39which then brings us to the obvious question.
00:11:41Do we need rag at all? You know,
00:11:43we look at something like this light rag setup.
00:11:45You watch my last few videos with light rag and rag,
00:11:48anything, and seeing how simple the set up with obsidian,
00:11:51you're probably like, well,
00:11:52why would I ever even bother with these more complicated
00:11:55setups at all?
00:11:56And the truth is if you're a solo dev,
00:11:59a solo operator or a small team that isn't dealing with
00:12:02thousands of documents,
00:12:04the answer probably is obsidian makes more sense for you.
00:12:08It's lightweight and you really don't need rag.
00:12:11These large language models,
00:12:12these harnesses like Claude code are good enough for your use
00:12:16case.
00:12:17And we can sit here and get in the weeds about the
00:12:18differences between the obsidian rag and true rag.
00:12:21But the truth is the big thing is scale, right?
00:12:24Are we trying to scale to millions of documents or are we not
00:12:27because at a certain scale,
00:12:29it's going to be cheaper and faster to use a proper rag
00:12:32system.
00:12:33No matter how good Claude code is at navigating this MD file
00:12:38document network you've created.
00:12:40But this isn't a question you necessarily need to have the
00:12:42exact answer to right away.
00:12:44Why wouldn't you just start with something like obsidian?
00:12:47And if it's clear,
00:12:48your scale goes well beyond the bounds of what this thing can
00:12:51handle, then just move into rag.
00:12:53I think people get really caught up in like answering this
00:12:55question when it's like, just try it out, just experiment.
00:12:58It's not costing you anything to use some sort of rag system,
00:13:01rag system like obsidian.
00:13:03And if it doesn't work, it doesn't work fine.
00:13:05Then go to use light rag and said,
00:13:06people want to sit here as they inevitably will in the
00:13:09comments and like argue this back and forth, just try it.
00:13:11I think the answer will be pretty clear at a certain point
00:13:14when you need to move to a true rag system.
00:13:16But the nice thing with this is, is again,
00:13:19most people don't need a real rag system.
00:13:21They just don't, right?
00:13:22Even if they're in a small business team situation.
00:13:24So having a proper, you know,
00:13:27orchestrated system like the subsidiary and knowledge base,
00:13:30I think is a huge boon to the majority of people.
00:13:33So I hope this breakdown was useful to you.
00:13:35Definitely check out Andre's post about this.
00:13:37He goes into a fair amount of detail.
00:13:39Make sure to check out the free chase AI school.
00:13:41There's a link to that in the description that has all the
00:13:43prompts and a written breakdown of how to actually do this.
00:13:47If you got confused at any part and as always take a look at
00:13:50chase AI, plus if you want to get your hands on that
00:13:52masterclass besides that,
00:13:54let me know what you thought and I'll see you around.

Key Takeaway

An Obsidian-based knowledge system using a structured Markdown directory and Claude Code provides a lightweight, cost-free alternative to traditional RAG for managing small-to-medium document sets without vector database complexity.

Highlights

The system uses a simple file structure within an Obsidian vault to eliminate the need for vector databases, embeddings, and complex retrieval logic.

Data ingestion involves the Obsidian Web Clipper to convert web pages into Markdown files stored in a designated 'raw' staging directory.

The system relies on a 'master index' and individual Wiki indexes to create a clear, navigable path for Claude Code to traverse information without excessive tool calls.

A custom 'Claude.md' file acts as a set of knowledge base rules that instructs the LLM on how to maintain summaries and handle Wiki links.

The 'Local Images Plus' community plugin allows the system to store and display images locally within Markdown files for a visual front-end experience.

This approach serves as a middle ground for solo operators or small teams who handle fewer than thousands of documents where traditional RAG overhead is unnecessary.

Timeline

Simplifying Knowledge Bases with Obsidian RAG

  • LLMs can handle large document sets effectively using a clever file system structure instead of vector databases.
  • Obsidian serves as a transparent front-end for the knowledge base that prevents data from being abstracted away in a black box.
  • Claude Code automates the maintenance of index files and document summaries to facilitate accurate information retrieval.

Traditional RAG systems often introduce unnecessary technical overhead for solo operators. By utilizing Obsidian as a front-end, users can see how documents are laid out and verify connections manually. This method mimics the functionality of GraphRAG or LightRAG through simple file organization rather than complex embeddings.

The Three-Tier Vault Architecture

  • A 'raw' folder acts as the staging area where research, PDFs, and Markdown files are initially dumped.
  • The 'Wiki' folder contains sub-folders for specific subjects that include index files for internal navigation.
  • A master index file lists all created Wikis to provide Claude Code with a starting point for any query.

The hierarchy starts with the Obsidian vault as the root. When a user asks a question, Claude Code navigates to the Wiki folder, checks the master index to find the relevant subject, and then uses the specific Wiki's index to locate detailed articles. This structure prevents the AI from running excessive tool calls to understand the file tree, saving both time and tokens.

Setting Up the Automated Research Pipeline

  • The Obsidian Web Clipper extension must be configured to save notes directly to the 'raw' folder location.
  • The Local Images Plus plugin ensures that images from ingested web articles are saved locally rather than remaining as broken external links.
  • Claude Code can conduct independent web research to populate the Wiki folders directly based on a single prompt.

Manual ingestion is handled by the browser extension, which converts web content into Markdown. To make the system autonomous, users can instruct Claude Code to research a topic, find relevant information online, and generate the necessary Wiki structure and cross-links automatically. This creates a clear pathway from one article to another, making it cheap and efficient for the AI to answer future questions.

Obsidian vs. Traditional RAG Scaling

  • The primary differentiator between this method and true RAG is the scale of the document library.
  • Small teams and individuals rarely reach the document volume required to justify the costs of a proper RAG system.
  • Starting with an Obsidian-based system allows for experimentation before migrating to a more complex infrastructure if scale exceeds current bounds.

While a true RAG system is faster and cheaper once a library reaches millions of documents, it is overkill for most business use cases. Large language models and tools like Claude Code are now capable enough to navigate structured text files directly. Users should prioritize starting with the simplest system and only move to LightRAG or similar frameworks when the file-based approach fails to scale.

Community Posts

View all posts