~6m34:08How To Build LLM Wiki In Obsidian? 🧠 A Memory Layer For Any Agentic AI
May 17, 2026
Read: ~6m · You save: 28 min
How To Build LLM Wiki In Obsidian? A Memory Layer For Any Agentic AI
Build your own AI-powered Wiki in Obsidian! Learn to create a structured knowledge layer for AI agents, transforming raw data into accessible insights. Step-by-step gui
The development of Large Language Models (LLMs) has introduced powerful capabilities for information processing. However, the effectiveness of these models is intrinsically linked to the quality and accessibility of the data they utilize. This article outlines the construction of an "LLM Wiki," a structured system designed to transform raw information into a persistent, accessible knowledge base for both human users and AI agents. This system aims to create a shared memory layer that evolves and improves with the addition of new information, aligning with individual thinking patterns.
The Three-Layered Architecture
The LLM Wiki system is built upon three fundamental layers:
- Sources (Raw Layer): This layer comprises the captured source material, such as transcripts, documents, or articles. This raw data serves as the input for the Wiki.
- Wiki (Knowledge Layer): This layer is where topics, concepts, entities, and projects are extracted from the raw source material. The Wiki is organized and maintained according to a defined schema.
- Schema (Organizational Layer): This layer dictates how the Wiki is structured and maintained. It includes elements like agent configurations, templates, skills, and command documentation, which instruct AI agents on how to manage the Wiki.
When new information is added to the Wiki, it cites the original source material, ensuring the preservation of the raw data while creating a structured, interconnected knowledge graph. The schema acts as a contract between the user and the AI agent, ensuring consistency and alignment.
Demonstration of the Workflow
A practical demonstration illustrates the functionality of these layers. A YouTube video transcript on "attention and how to fix it" was used as a source.
- Ingestion: The transcript was captured using an Obsidian web clipper and saved to the "raw" folder within the Obsidian vault.
- Extraction: An AI agent was instructed to check for new raw files, ingest them into the Wiki, and run maintenance scripts. The agent identified the new source and proceeded to extract concepts.
- Maintenance: The system then entered a maintenance or "linting" mode, verifying the accuracy and consistency of the newly added information and ensuring adherence to the defined schema.
The Obsidian graph view visually represents these layers, with "raw" material in green, "Wiki" content in blue, and the "schema" in orange. This visualization highlights the interconnectedness of the data as new sources are added and concepts are extracted.
Prerequisites for Building the LLM Wiki
To establish the LLM Wiki system, several tools and software are required:
- Python: Essential for running repeatable scripts, enhancing accuracy, and saving on token usage.
- Git: Provides version control, enabling the creation of save points and facilitating recovery from potential errors made by AI agents.
- Obsidian: Serves as the core memory system and the second brain layer for storing files and notes.
- Agentic AI (Coding Agent): The central component that powers the system, running scripts, processing files, and suggesting improvements. The author uses Codex but notes that any agentic AI can be utilized.
- Optional: Local Model: For free and private operation, a local LLM can be integrated.
Core Setup and Workflow
The construction of the LLM Wiki involves the following steps:
- Initialize Obsidian Vault as a Git Repository: Create a new Obsidian vault and initialize it as a Git repository to enable version control. A
.gitignorefile is used to exclude unnecessary configuration files. - Configure Agentic Environment: Ensure the chosen agentic environment has Obsidian-aware skills. This involves installing specific plugins or skill packs that allow the agent to interact effectively with Obsidian's wiki-linking system. The author recommends the Obsidian CLI, markdown basis, canvas, and defuddle skills, and emphasizes enabling the command-line interface in Obsidian settings.
- Create Folder Structure: Establish a core folder structure within the Obsidian vault to organize different types of information, including "raw," "wiki," and "schema" folders.
- Implement Schema Files: Introduce schema files, such as
agents.md, which act as a constitution for the AI agent, defining rules, workflow guidance, and structural requirements. This includes specifying front matter schemas, naming conventions, and workflow examples to ensure repeatable behavior. - Develop Templates: Create templates for various note types (e.g., sources, concepts, topics, entities, projects, logs) to ensure consistent formatting and property inclusion. These templates are linked to the front matter schema.
- Integrate Python Scripts (Tooling): Develop Python scripts that provide the agent with specific commands for tasks like building an index, checking structure, querying, and performing maintenance. These scripts translate schema rules into executable code for consistent operation.
- Ingest and Validate Raw Data: Test the system by ingesting a new raw source file (e.g., a video transcript). The agent uses the ingest skill to process the file, extract concepts, and update the Wiki.
- Run Maintenance and Linting: Execute maintenance scripts to validate the ingested data, update the catalog, and ensure adherence to all defined rules and schema requirements. This includes checking for routing gaps or catalog search failures.
Advanced Features
Beyond the core setup, several advanced features can enhance the LLM Wiki system:
- Obsidian Safe System (Firewall): Implement a wrapper around the Obsidian CLI skill to restrict agent access to specific, approved vaults, preventing unauthorized modifications to other vaults.
- Local LLM Setup: Integrate local LLM models (e.g., via Ollama) for private and free operation. This may involve creating a review folder for proposed changes before applying them to the main system, acting as a "human in the loop."
- Launcher Commands: Develop one-click commands (e.g., for Mac or Windows) to initiate local LLM workflows, simplifying the process of updating the Obsidian vault.
- PDF Ingestion: Develop a system to extract markdown from PDF files and integrate them into the LLM Wiki.
- Molecular Zettelkasten System: Implement advanced knowledge theory for a more sophisticated knowledge organization beyond a standard wiki.
- Querying with RAG and Graph RAG: Enhance the querying capabilities using Retrieval Augmented Generation (RAG) and Graph RAG for more intelligent information retrieval.
The LLM Wiki is presented as a foundational system that can be continuously iterated upon and customized to align with individual workflows and thinking patterns. The author emphasizes building a solid foundation before integrating more complex features like local models, which may initially have lower intelligence compared to cloud-based systems. The ultimate goal is to create a dynamic, evolving knowledge base that improves the quality, connections, and efficiency of AI agents while reducing hallucinations.
Introduction to the LLM Wiki
Introduction to the LLM Wiki concept, its purpose as a structured, accessible knowledge layer for AI agents, and an overview of the video's focus on building and setting it up, including advanced features.
- The LLM Wiki is a structured system to transform raw information into accessible knowledge for AI tools.
- It acts as a separate, automatically maintained brain or shared memory layer for AI agents.
- The video focuses on the 'how-to' of building the LLM Wiki, building upon a previous video explaining the 'why'.
- Advanced features like agentic firewalls and local model integration will be covered.
The Three Layers of the LLM Wiki
Explanation of the three core layers of the LLM Wiki system: Sources (raw captured material), Wiki (extracted topics and concepts), and Schema (organization and agent instructions).
- Layer 1: Sources - Raw captured material that will be compiled.
- Layer 2: Wiki - Extracted topics, concepts, entities, projects organized by the schema.
- Layer 3: Schema - The agentic layer (e.g., agents.md, templates) that instructs the agent on maintaining the Wiki.
- The Wiki cites raw material, preserving the source and ensuring structured alignment for humans and agents.
- The schema acts as a contract between the user and the agent for consistent maintenance.
Demonstration: Ingesting and Extracting Concepts
A demonstration of the LLM Wiki in action, showing how a new video transcript is ingested, concepts are extracted into the Wiki, and the graph view updates to reflect the new information and its connections.
- Demonstration uses a video transcript on 'attention and how to fix it'.
- The Obsidian web clipper adds the transcript to the 'raw' folder.
- An agent ingests the raw file, extracts concepts, and populates the Wiki.
- The graph view expands, showing new notes and their references to the source.
- The process involves three steps: raw capture, Wiki extraction, and lint/maintenance mode.
Prerequisites for Building the LLM Wiki
Listing the essential prerequisites for building the LLM Wiki, including software like Python, Git, Obsidian, and an agentic AI, with optional local model setup for privacy and cost savings.
- Prerequisites: Python (for repeatable scripts), Git (for version control), Obsidian (core memory system), Agentic AI (e.g., Codex) (powers the system).
- Optional: Local model setup for free and private building.
- Python enables accurate and token-efficient scripting.
- Git provides essential save points for agent-modified vaults.
- Obsidian serves as the second brain for storing and connecting notes.
- Agentic AI runs scripts, processes files, and suggests improvements.
Core Setup Workflow
Outlining the core setup steps: initializing the Obsidian vault as a Git repository, structuring rules and templates, creating the schema, and demonstrating the ingestion and maintenance workflow.
- Steps: Initialize Obsidian vault as Git repo, structure rules/templates/schema, bring in Python scripts, demo ingestion, and set up maintenance/query/linting.
- Obsidian vault is created (e.g., 'LLM Wiki Starter').
- The vault is initialized as a Git repository with a
.gitignorefile. - Git is crucial for version control and recovery from agent errors.
- Agentic environment needs Obsidian-aware skills (e.g., Obsidian CLI, markdown basis) for consistent operation.
Initializing the Obsidian Vault and Git
Detailed steps on setting up the Obsidian vault, initializing it with Git, and configuring agent skills for effective interaction with Obsidian's wiki-linking system.
- Create a new Obsidian vault (e.g., 'LLM Wiki Starter').
- Initialize the vault folder as a Git repository using an agent (e.g., Codex).
- Use
.gitignoreto exclude unnecessary Obsidian configuration files. - Git provides version control, essential for agentic AI interactions.
- Ensure the agentic environment has Obsidian-aware skills (e.g., Obsidian CLI, markdown basis) for wiki linking.
Configuring Agent Skills for Obsidian
Explaining the importance of Obsidian-aware skills for the agent, how to install them, and enabling the command-line interface for direct agent-Obsidian interaction.
- Agent needs skills to understand Obsidian's wiki-linking (e.g.,
[[link]]). - Install skill packs (e.g., from Obsidian founders) via the agent.
- Key skills include Obsidian CLI, markdown basis, canvas, defuddle.
- Enable the command-line interface (CLI) in Obsidian settings for agent connection.
- Custom skills can be created, like a firewall to protect other vaults.
Creating the Core Folder Structure and Schema
Setting up the core folder structure for the LLM Wiki, including 'raw', 'wiki', and 'schema' folders, and populating the schema directory with essential files like `agents.md` and templates.
- Create core folder structure: raw, wiki, schema.
- Populate schema with
agents.md(the 'constitution'), schema docs, workflow guidance. - The
agents.mdfile defines rules for the agent, including not overwriting raw sources and using Obsidian conventions like front matter and tags. - Front matter schema ensures consistent metadata (created date, source reference) for all notes.
- Naming conventions can be customized within the schema.
- Workflow examples provide context for the agent's tasks.
- A lint checklist ensures schema structure is maintained.
Defining Schema Rules and Conventions
Defining the schema rules, including front matter requirements, naming conventions, and workflow examples, to ensure consistent and structured note-taking by the AI agent.
- Schema dictates rules like 'don't overwrite raw source material' and use of Obsidian features (tags, front matter).
- Front matter requires consistent fields: tags, created/updated dates, source reference.
- Customizable naming conventions align with user preferences.
- Workflow examples guide the agent on tasks like capturing sources, updating notes, and preserving topics.
- The schema acts as a contract, ensuring the agent writes correctly formatted and validated files.
Creating Note Templates
Creating templates for different note types (sources, concepts, topics, etc.) to ensure consistent formatting and structure, driven by the defined schema.
- Templates ensure repeatable formatting for notes like sources, concepts, topics, entities, projects, logs.
- Templates are linked to the schema's front matter requirements.
- Example: A source note template includes tags, processed checkbox, source reference, content type.
- Templates can be updated, and the agent will automatically use the latest version for new notes.
- Obsidian's source mode shows the YAML front matter corresponding to the template.
Implementing Python Scripts (Tooling)
Introducing the Python scripts (tooling) that provide the agent with specific commands for tasks like indexing, searching, and maintenance, turning schema rules into executable code.
- Python scripts (tooling) are stored in a 'scripts' folder.
- These scripts provide the agent with commands like building an index, checking structure, searching, querying, and core maintenance.
- The scripts translate schema rules into executable code for consistent operation.
- Key script functions include building an index/catalog, maintaining structure, searching, scanning raw files, and checking source conversion.
- A command reference list explains how to run these scripts.
Testing the Ingestion Process
Testing the LLM Wiki system by ingesting a new raw file (a video transcript), observing the agent's process of extracting concepts, and verifying the updates in the graph view and Wiki log.
- Test ingestion using a previous video's transcript ('YLLM Wiki: Theory').
- Use Obsidian web clipper to add the transcript to the 'source' folder.
- Instruct the agent to 'ingest any new files' and 'commit changes'.
- The agent uses the 'LLM Wiki ingest' skill and the Wiki tool (Python script).
- Concepts like 'graph rag' and 'LLM Wiki' are extracted and linked.
- The graph view updates, showing interlinked red (raw) and blue (wiki) files.
- The Wiki log tracks the ingest actions.
Validation and Maintenance Loop
Performing the validation stage, including maintenance, linting, and querying, to ensure the ingested data is correctly processed, structured, and integrated into the knowledge base.
- Validation involves running 'maintain', 'lint', and 'query' skills.
- This completes the full maintenance loop.
- Automation can be set up to run this loop daily or weekly.
- Identified maintenance issue: a routing gap where catalog search failed to pull body text.
- The system tightens the query process to correctly pull expected information.
- Git shows the exact changes made during the maintenance pass.
- The process ensures source traceability, compiled notes, a searchable catalog, and repeatable checks.
Advanced Features: Obsidian Safe System and Local LLM
Discussing advanced features, including creating an Obsidian safe system (firewall) to protect other vaults and setting up a local LLM using Ollama for private and free knowledge base building.
- Advanced features include Obsidian safe system (firewall), local LLM setup (Ollama), PDF ingest, and molecular Zettelkasten.
- Obsidian Safe System: Wraps the Obsidian CLI skill to restrict agent actions to specific approved vaults.
- Local LLM Setup: Uses Ollama to run models locally, ensuring privacy.
- A review folder is introduced for local models, which may make more mistakes.
- Launcher commands (e.g., double-click) can trigger local model workflows.
- Example: Using Ollama to draft concepts from a new source, with manual approval before applying.
Local LLM Integration and Workflow Automation
Exploring the integration of local LLMs like Ollama, including setting up a review process and using launcher commands for simplified workflows, and touching upon further advanced possibilities.
- Ollama allows running LLMs locally for free and private processing.
- A draft system proposes changes from the local model for review before applying.
- Launcher commands (e.g., 'check raw sources', 'draft with Ollama', 'apply latest draft') simplify interaction.
- Local models can be integrated with agents for automated workflows.
- Further advanced topics include PDF ingest, molecular Zettelkasten, and improving querying with RAG/Graph RAG.