# How to Configure an Obsidian Vault for Patent Reading: Complete Setup Guide

> Configure your Obsidian vault for patent reading with this complete setup guide. Learn to bootstrap your vault and generate patent notes efficiently. Get started today!

- Repository: [handsomestWei/patent-disclosure-skill](https://github.com/handsomestWei/patent-disclosure-skill)
- Tags: how-to-guide
- Published: 2026-09-01

---

**Set the vault path with [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py), bootstrap it with [`setup_obsidian_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/setup_obsidian_vault.py), then generate patent notes using [`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py) — the toolchain in `handsomestWei/patent-disclosure-skill` automates CSS, templates, Dataview dashboards, and Canvas visualizations.**

The `patent-disclosure-skill` repository provides a dedicated toolchain that transforms a standard Obsidian vault into a specialized environment for patent analysis. This guide walks you through configuring your Obsidian vault for patent reading using the exact scripts and modules implemented in the codebase.

---

## Detect or Configure the Vault Path

Before bootstrapping, the system needs to know where your Obsidian vault lives. The [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py) script handles this detection and configuration.

Run the environment checker to see your current status:

```bash
python tools/patent_reader/vault/check_obsidian_env.py

```

If no vault is configured, you'll see a prompt in Chinese explaining how to set it:

```

错误：未配置 Obsidian 库。可先运行：
  python tools/patent_reader/vault/check_obsidian_env.py
然后：
  python tools/patent_reader/vault/check_obsidian_env.py --set "你的库路径"

```

Set your vault path explicitly:

```bash
python tools/patent_reader/vault/check_obsidian_env.py --set "D:/Obsidian/MyVault"

```

The script stores this path via `runtime_config()` in [`shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/shared/common.py), making it available to all subsequent tools. This step is **idempotent** — you can re-run it to update the location without side effects.

*Source:* [[`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/check_obsidian_env.py)

---

## Bootstrap the Vault with Patent-Specific Assets

Once the vault path is known, run the bootstrap script to install all required assets:

```bash
python tools/patent_reader/vault/setup_obsidian_vault.py

```

Or specify a custom path directly:

```bash
python tools/patent_reader/vault/setup_obsidian_vault.py --vault "D:/Obsidian/MyVault"

```

In [`setup_obsidian_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/setup_obsidian_vault.py) [lines 80-82](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/setup_obsidian_vault.py#L80-L82), this calls `bootstrap_vault(vault)` from [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py), which performs six key actions:

| Asset | Purpose | Destination Path |
|-------|---------|------------------|
| **CSS snippet** ([`patent-reader.css`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/patent-reader.css)) | Enables specialized UI styling for patent notes | [`.obsidian/snippets/patent-reader.css`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/.obsidian/snippets/patent-reader.css) |
| **Patents base file** | Template with YAML placeholders for the Patents collection | `Research/Patents/patents.base` |
| **Glossary base file** | Base template for the terminology glossary | `Research/术语/glossary.base` |
| **Index page** (`_专利解读索引.md`) | Central hub with Dataview dashboard for patent overview | `Research/Patents/_专利解读索引.md` |
| **Glossary index** (`_术语索引.md`) | Auto-generated index of all term pages | `Research/术语/_术语索引.md` |
| **Appearance settings** | Ensures the CSS snippet is active without manual UI steps | [`.obsidian/appearance.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/.obsidian/appearance.json) |

All operations append to an `actions` list for logging, and files are only overwritten when the source is newer — making the bootstrap **safe to re-run**.

*Source:* [`obsidian.py – bootstrap_vault`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/obsidian.py#L80-L95)

---

## Generate Patent Notes in the Configured Vault

With the vault structure in place, generate individual patent notes:

```bash
python -m tools.patent_reader.vault.write_patent_obsidian_note \
    --pub "CN1234567A" \
    --vault "D:/Obsidian/MyVault"

```

This module ([`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py)) performs several coordinated actions:

- Reads patent data and assembles **front-matter** with tags, IPC classification, domain, and confidence flags
- Writes the markdown file to `Research/Patents/CN1234567A_解读.md`
- Updates the glossary via `ensure_glossary_stub`
- Creates **Canvas JSON** for visual claim analysis
- Adds **backlinks** automatically using `enrich_note_frontmatter`

The resulting note integrates with the Dataview dashboards and index pages created during bootstrap, giving you immediate navigability across your patent collection.

*Source:* [[`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/write_patent_obsidian_note.py)

---

## Refresh or Repair an Existing Vault

If you modify templates or need to update Dataview queries, re-run the bootstrap script. In [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) [lines 34-44](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/obsidian.py#L34-L44), the `bootstrap_vault` function detects an existing index and performs targeted repairs:

- `_upgrade_index_evidence_dataview` — updates Dataview columns to Chinese labels
- `_repair_index_glossary_dataview` — fixes glossary-related query syntax
- Appends a tip about automatic node coloring in the "关联图谱" (relationship graph) section

These repairs preserve your existing notes while upgrading the infrastructure around them.

---

## Complete Configuration Workflow

Execute these three commands to fully configure your Obsidian vault for patent reading:

```bash

# Step 1: Set vault location (one-time or when moving vaults)

python tools/patent_reader/vault/check_obsidian_env.py --set "D:/Obsidian/MyVault"

# Step 2: Bootstrap with CSS, templates, and index pages

python tools/patent_reader/vault/setup_obsidian_vault.py

# Step 3: Generate your first patent note

python -m tools.patent_reader.vault.write_patent_obsidian_note \
    --pub "CN1234567A" \
    --vault "D:/Obsidian/MyVault"

```

For programmatic access, import `bootstrap_vault` directly:

```python
from tools.patent_reader.vault.obsidian import bootstrap_vault
from pathlib import Path

vault = Path("D:/Obsidian/MyVault")
actions = bootstrap_vault(vault)
print(f"Completed {len(actions)} bootstrap actions")

```

---

## Key Source Files and Their Roles

| File | Responsibility | Direct Link |
|------|---------------|-------------|
| [`setup_obsidian_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/setup_obsidian_vault.py) | CLI entry point; resolves vault path and triggers bootstrap | [source](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/setup_obsidian_vault.py) |
| [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) | Core implementation: `bootstrap_vault`, front-matter helpers, glossary management, Canvas generation | [source](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/obsidian.py) |
| [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py) | Vault path detection and persistent configuration | [source](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/check_obsidian_env.py) |
| [`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py) | Patent note generation with full metadata and visualizations | [source](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/write_patent_obsidian_note.py) |
| [`schema_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/schema_vault.py) | Canvas schema definitions for claim trees and relationship graphs | [source](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/patent_reader/vault/schema_vault.py) |

---

## Summary

- **Detect the vault path** using [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py) — stores configuration via `runtime_config()` in [`shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/shared/common.py)
- **Bootstrap the vault** with [`setup_obsidian_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/setup_obsidian_vault.py) — installs CSS snippets, base templates, index pages, and appearance settings through `bootstrap_vault` in [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py)
- **Generate notes** via [`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py) — creates markdown with front-matter, glossary stubs, Canvas JSON, and automatic backlinks
- **Repair incrementally** by re-running bootstrap — updates Dataview queries and index structures without touching existing notes

This three-step configuration gives you an Obsidian vault purpose-built for patent reading: styled visuals, structured metadata, searchable glossaries, and interactive Canvas claim analysis.

---

## Frequently Asked Questions

### Where does the vault path get stored permanently?

The path is persisted through `runtime_config()` in [`shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/shared/common.py), which writes to a runtime configuration file. This makes the location available to all patent-reader tools without requiring environment variables or hardcoded paths. You can update it anytime by re-running `check_obsidian_env.py --set`.

### What happens if I re-run the bootstrap script on an existing vault?

The `bootstrap_vault` function in [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) is idempotent: it compares timestamps and only overwrites files when the source is newer. For existing index pages (detected at lines 34-44), it performs targeted repairs to Dataview queries rather than full replacement, preserving your data while upgrading the infrastructure.

### Can I use a vault that already contains other notes?

Yes. The patent-disclosure-skill toolchain creates its own directory structure under `Research/Patents/` and `Research/术语/`, keeping its assets isolated. The CSS snippet [`patent-reader.css`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/patent-reader.css) only affects notes that use its specific classes, so your existing notes remain unaffected.

### How do I customize the Dataview dashboards or templates?

Modify the template files in the repository's `assets/obsidian/` directory, then re-run [`setup_obsidian_vault.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/setup_obsidian_vault.py). The bootstrap logic in [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) will propagate your changes while preserving any glossary entries or patent notes you've already created.