How LLM Wiki Builds a Persistent Obsidian-Compatible Vault
LLM Wiki generates a self-contained folder structure with a pre-configured .obsidian directory and standardized markdown layout, enabling any project to function as a persistent Obsidian-compatible vault that survives application restarts.
LLM Wiki treats every research project as a standalone Obsidian-compatible vault, leveraging a Rust-powered Tauri backend to scaffold directories and configuration files according to Obsidian's expectations. This architecture ensures users can open their LLM Wiki projects directly in Obsidian while maintaining full compatibility with the application's research management features.
Vault Architecture and Directory Structure
Each project follows a strict folder hierarchy that mirrors Obsidian's native vault layout. The Tauri command create_project triggers the Rust backend to establish this structure in a designated root folder.
The generated layout includes:
raw/– Stores unprocessed source materials with subdirectoriessources/andassets/wiki/– Contains the knowledge base with subfoldersentities/,concepts/, and markdown pages includingindex.md.obsidian/– Houses Obsidian-specific configuration files that control appearance, plugins, and behaviorschema.mdandpurpose.md– Root-level markdown files defining the project's data structure and research intent
The Vault Creation Pipeline
The implementation in src-tauri/src/commands/project.rs executes a four-stage initialization process through the create_project_impl function.
Stage 1: Scaffold Core Directories
The backend iterates over a predefined list of directory paths and invokes fs::create_dir_all to ensure the entire hierarchy exists before writing files. This creates the raw/sources, raw/assets, wiki/entities, and wiki/concepts subdirectories simultaneously.
// From src-tauri/src/commands/project.rs (lines 23-36)
// create_project_impl iterates directory names:
fs::create_dir_all(root.join("raw").join("sources"))?;
fs::create_dir_all(root.join("raw").join("assets"))?;
fs::create_dir_all(root.join("wiki").join("entities"))?;
Stage 2: Initialize Starter Markdown
Using the internal write_file_inner utility, the system writes minimal starter files including schema.md, purpose.md, and wiki/index.md. This utility ensures parent directories exist before writing content, preventing I/O errors during project creation.
Stage 3: Generate Obsidian Configuration
The most critical step for Obsidian compatibility involves creating the .obsidian/ directory and populating three JSON configuration files:
app.json configures attachment handling and exclusion filters:
{
"attachmentFolderPath": "raw/assets",
"userIgnoreFilters": [".cache", ".llm-wiki", ".superpowers"]
}
appearance.json forces the dark theme to match LLM Wiki's UI:
{
"theme": "obsidian"
}
core-plugins.json enables essential navigation features:
{
"graph": true,
"backlink": true,
"page-preview": true,
"file-explorer": true
}
The create_project command writes these files immediately after creating the .obsidian directory using fs::create_dir_all(root.join(".obsidian")).
Persistence and Validation Mechanisms
Because the vault exists as standard files on the host filesystem, the structure persists across application restarts. When reopening an existing project, the open_project command invokes validate_wiki_project_root to verify integrity.
This validation function checks for the presence of schema.md and the wiki/ directory before loading the project, ensuring that only properly structured Obsidian-compatible vaults are accessible through the application interface.
Source Watch Integration
To prevent configuration changes from triggering unnecessary file system events, LLM Wiki explicitly excludes the .obsidian directory from automatic source watching. The file src/lib/source-watch-defaults.json defines this exclusion, ensuring that theme changes or plugin toggle adjustments in Obsidian do not spawn spurious update processes within the LLM Wiki interface.
Programmatic Vault Access
Frontend TypeScript code interacts with these persistent vaults through Tauri commands:
Creating a new vault:
import { invoke } from '@tauri-apps/api/tauri';
async function initializeVault(name: string, path: string) {
const project = await invoke('create_project', { name, path });
console.log('Vault created at:', project.path);
}
Opening an existing vault:
async function loadExistingVault(path: string) {
const project = await invoke('open_project', { path });
return project;
}
Summary
- Directory scaffolding occurs through
create_project_implinsrc-tauri/src/commands/project.rs, usingfs::create_dir_allto establish theraw/andwiki/hierarchies - Obsidian compatibility requires generating three configuration files—
app.json,appearance.json, andcore-plugins.json—inside the.obsidianfolder - Persistence relies on standard filesystem storage, with
validate_wiki_project_rootverifying vault integrity by checking forschema.mdand thewiki/directory - Source exclusion prevents
.obsidianconfiguration changes from triggering file watchers, as defined insrc/lib/source-watch-defaults.json
Frequently Asked Questions
What makes an LLM Wiki project compatible with Obsidian?
An LLM Wiki project becomes compatible by including a properly structured .obsidian directory containing app.json, appearance.json, and core-plugins.json configuration files. This setup allows Obsidian to recognize the folder as a vault, apply the correct dark theme, enable core plugins like graph view and backlinks, and respect the designated attachment folder path.
Where does LLM Wiki store Obsidian configuration files?
Configuration files reside in the .obsidian/ subdirectory at the project root. The Rust backend creates this directory during project initialization via fs::create_dir_all and populates it with JSON files that control Obsidian's behavior, including attachment folder paths set to raw/assets and filters excluding internal folders like .cache and .llm-wiki.
How does the application validate an existing vault on startup?
When opening a project, the system calls validate_wiki_project_root from src-tauri/src/commands/project.rs to verify the presence of schema.md and the wiki/ directory. This validation ensures the folder structure matches the expected Obsidian-compatible layout before loading the project into the application workspace.
Why does LLM Wiki exclude the .obsidian folder from source watching?
The .obsidian folder is excluded from source watching to prevent configuration changes—such as switching themes or toggling plugins within Obsidian itself—from triggering unnecessary file system events in LLM Wiki. This exclusion is hardcoded in src/lib/source-watch-defaults.json to maintain clean synchronization between the two applications.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →