How I Built an AI-Readable Second Brain with Obsidian, Git, and a VS Code AI Agent
DEV Community

How I Built an AI-Readable Second Brain with Obsidian, Git, and a VS Code AI Agent

When you're a solo founder and lead architect, your knowledge base is your most valuable asset. Lose the thread on why a decision was made, and you spend hours - sometimes days - reconstructing context that you already figured out once. I want to share the exact setup I use at NEXT4I to turn a folder of Markdown files into a fully searchable, version-controlled, AI-readable knowledge system. No proprietary SaaS, no vendor lock-in, no custom integration work. This is the Key Highlight of this post: a genuinely useful, generic pattern you can apply to your own projects today. The NEXT4I-specific business logic stays abstracted (per our security rules), but the pattern itself is 100% reusable. 1. The Architecture: Three Layers, Zero Magic โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI Agent (VS Code) โ”‚ โ”‚ Reads, Searches, Summarizes, Drafts โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ reads plain .md files โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Git-tracked Obsidian Vault โ”‚ โ”‚ โ”œโ”€โ”€ Idea/ (brainstorms) โ”‚ โ”‚ โ”œโ”€โ”€ Infrastructure/ (architecture docs)โ”‚ โ”‚ โ”œโ”€โ”€ Platform/ (product specs) โ”‚ โ”‚ โ”œโ”€โ”€ Script/ (automation) โ”‚ โ”‚ โ””โ”€โ”€ Skill/ (reusable limits) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ committed & pushed โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ GitHub (remote backup) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Layer 1 - The Vault (Obsidian): A folder of interconnected .md files. The key insight is that Obsidian uses plain Markdown with [[wiki-links]] for connections - no database, no proprietary format. Layer 2 - Version Control (Git): Every vault is a git repo. Every change to any document has a commit message, a timestamp, and a diff. You can git log --oneline -- Idea/ to see the evolution of a concept. Layer 3 - AI Agent (VS Code Extension): Because the vault is just a file tree of .md files, any AI coding agent that can read a codebase can also read your knowledge base. Point the agent at the vault folder, and it has full context. 2. The Setup: Step-by-Step Step 1: Create the Vault mkdir next4i-knowledge cd next4i-knowledge mkdir Idea Infrastructure Platform Script Skill git init Open this folder in Obsidian: Open folder as vault. Step 2: Link Everything Inside a note, link to another note with [[Note Name]] . Obsidian auto-suggests as you type. Over time, this builds a graph you can visualize with Cmd/Ctrl + G . Pro tip: Create a _INDEX.md in each folder that links to the most important notes. This becomes a human-readable table of contents AND a search anchor for the AI. Step 3: Add Git Discipline git add -A && git commit -m "infra: initial sharding strategy decision" git remote add origin g**@github.com:your-org/knowledge-vault.git git push -u origin main Treat commit messages like code. Use prefixes: idea: , infra: , platform: , script: , skill: . This makes git log --oneline --grep="infra:" instantly useful. Step 4: Open in VS Code and Activate the AI code /path/to/vault With an AI agent extension active (Copilot, Cline, Cody, etc.), try prompts like: "Summarize the key architectural decisions in the Infrastructure folder." "Find any contradiction between documents in /Platform/ and /Infrastructure/." "Draft a new document in /Idea/ based on the sharding notes in /Infrastructure/." The agent reads the files as context, just like it would for code. 3. The Design Pattern: Folder-Convention-as-API Here's the key pattern: your folder structure IS your API. By keeping a consistent vault structure, both humans and AI know where to look: | Folder | Contains | AI Use Case | |---|---|---| Idea/ | Raw, unstructured thinking | Generate summaries, find related concepts | Infrastructure/ | System topology, deployment, config | Validate consistency, trace dependencies | Platform/ | Feature specs, user flows | Draft task tickets, check requirement coverage | Script/ | Automation, one-liners | Explain what a script does, suggest improvements | Skill/ | Reusable patterns, checklists | Retrieve relevant patterns for new tasks | This is essentially a convention-based RAG (Retrieval-Augmented Generation) setup without any vector database, embedding pipeline, or chunking strategy. The "chunking" is the natural boundary of each .md file. The "retrieval" is the AI agent's file-reading capability. 4. Why This Beats a Wiki | Wiki / Confluence | This Setup (Obsidian + Git) | |---|---| | Vendor lock-in | Plain .md files, portable anywhere | | Search is siloed within the tool | VS Code AI searches across the whole vault | | No version control (or poor built-in) | Full version control (git blame , git diff , git log ) | | Hard to automate | Scriptable - grep , sed , and AI prompts all work | | AI needs API integration | AI reads files natively, zero setup required | 5. What I Learned The biggest surprise: The AI agent became better at finding connections in my own notes than I was. It doesn't have recency bias. It doesn't forget what I wrote 8 months ago. It reads everything with equal attention. The biggest lesson: AI-native doesn't mean "add an AI button." It means design your systems - including your thinking systems - so that AI can participate as a first-class citizen without special plumbing. I'm building NEXT4I as an AI-native ecosystem from the ground up. If you're interested in following a solo founder's engineering journey - or want early access - join here: Subscribe NEXT4I or want early access - join here Top comments (0)

Comments

No comments yet. Start the discussion.