# How LLM Wiki Builds a Persistent Obsidian-Compatible Vault

> Discover how LLM Wiki creates an Obsidian-compatible vault. Learn to build persistent, self-contained markdown vaults that survive application restarts.

- Repository: [nash_su/llm_wiki](https://github.com/nashsu/llm_wiki)
- Tags: how-to-guide
- Published: 2026-09-12

---

**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 subdirectories `sources/` and `assets/`
- **`wiki/`** – Contains the knowledge base with subfolders `entities/`, `concepts/`, and markdown pages including [`index.md`](https://github.com/nashsu/llm_wiki/blob/main/index.md)
- **`.obsidian/`** – Houses Obsidian-specific configuration files that control appearance, plugins, and behavior
- **[`schema.md`](https://github.com/nashsu/llm_wiki/blob/main/schema.md)** and **[`purpose.md`](https://github.com/nashsu/llm_wiki/blob/main/purpose.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`](https://github.com/nashsu/llm_wiki/blob/main/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.

```rust
// 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`](https://github.com/nashsu/llm_wiki/blob/main/schema.md), [`purpose.md`](https://github.com/nashsu/llm_wiki/blob/main/purpose.md), and [`wiki/index.md`](https://github.com/nashsu/llm_wiki/blob/main/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`](https://github.com/nashsu/llm_wiki/blob/main/app.json)** configures attachment handling and exclusion filters:

```json
{
  "attachmentFolderPath": "raw/assets",
  "userIgnoreFilters": [".cache", ".llm-wiki", ".superpowers"]
}

```

**[`appearance.json`](https://github.com/nashsu/llm_wiki/blob/main/appearance.json)** forces the dark theme to match LLM Wiki's UI:

```json
{
  "theme": "obsidian"
}

```

**[`core-plugins.json`](https://github.com/nashsu/llm_wiki/blob/main/core-plugins.json)** enables essential navigation features:

```json
{
  "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`](https://github.com/nashsu/llm_wiki/blob/main/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`](https://github.com/nashsu/llm_wiki/blob/main/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:**

```typescript
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:**

```typescript
async function loadExistingVault(path: string) {
  const project = await invoke('open_project', { path });
  return project;
}

```

## Summary

- **Directory scaffolding** occurs through `create_project_impl` in [`src-tauri/src/commands/project.rs`](https://github.com/nashsu/llm_wiki/blob/main/src-tauri/src/commands/project.rs), using `fs::create_dir_all` to establish the `raw/` and `wiki/` hierarchies
- **Obsidian compatibility** requires generating three configuration files—[`app.json`](https://github.com/nashsu/llm_wiki/blob/main/app.json), [`appearance.json`](https://github.com/nashsu/llm_wiki/blob/main/appearance.json), and [`core-plugins.json`](https://github.com/nashsu/llm_wiki/blob/main/core-plugins.json)—inside the `.obsidian` folder
- **Persistence** relies on standard filesystem storage, with `validate_wiki_project_root` verifying vault integrity by checking for [`schema.md`](https://github.com/nashsu/llm_wiki/blob/main/schema.md) and the `wiki/` directory
- **Source exclusion** prevents `.obsidian` configuration changes from triggering file watchers, as defined in [`src/lib/source-watch-defaults.json`](https://github.com/nashsu/llm_wiki/blob/main/src/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`](https://github.com/nashsu/llm_wiki/blob/main/app.json), [`appearance.json`](https://github.com/nashsu/llm_wiki/blob/main/appearance.json), and [`core-plugins.json`](https://github.com/nashsu/llm_wiki/blob/main/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`](https://github.com/nashsu/llm_wiki/blob/main/src-tauri/src/commands/project.rs) to verify the presence of [`schema.md`](https://github.com/nashsu/llm_wiki/blob/main/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`](https://github.com/nashsu/llm_wiki/blob/main/src/lib/source-watch-defaults.json) to maintain clean synchronization between the two applications.