Skip to content

BasisAI/obsidian-vault-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsidian Vault SQL Indexer

Transform your Obsidian markdown vault into a queryable SQLite database while preserving its graph structure (wikilinks, backlinks, and unresolved concepts).

Why?

Obsidian's "Bases" feature requires manual organization. This tool treats your vault as a document-graph hybrid:

  • Notes = Nodes (with frontmatter properties)
  • Wikilinks = Edges (bidirectional, typed)
  • Unresolved links = Semantic concepts waiting to be documented

Write naturally in Obsidian. Query instantly via SQL.

Features

  • Incremental Sync: Only re-indexes changed files (hash + mtime tracking)
  • Graph Semantics: Traverse [[wikilinks]] as SQL relationships
  • Unresolved Concepts: Tracks missing notes by reference count (your writing backlog)
  • FTS5 Search: Full-text search with ranking, booleans, and prefix matching
  • Zero Lock-in: Your markdown files remain the source of truth; delete vault.db anytime

Quick Start

# 1. Index your vault
python index.py ~/Documents/ObsidianVault

# 2. Query with sqlite3 directly
sqlite3 vault.db "SELECT path FROM notes WHERE title LIKE '%LoRA%'"

# 3. Or use the included CLI helper
python query.py backlinks "lora_qlora_notes.md"
python query.py unresolved --limit 10

Database Schema

See docs/SCHEMA.md for complete reference.

Core Tables:

  • notes: Markdown files (path, title, content, frontmatter)
  • links: Graph edges with context (the sentence containing the link)
  • properties: Flattened frontmatter key-values
  • attachments: Non-markdown files (images, PDFs)
  • notes_fts: Full-text search index (virtual table)

Installation

Requires Python 3.8+ (no dependencies, uses stdlib + SQLite).

git clone https://github.com/YOURUSERNAME/obsidian-vault-sql.git
cd obsidian-vault-sql
chmod +x index.py
./index.py ~/path/to/vault

Philosophy

  • Files are primary, database is cache
  • Path-based linking (folder/note.md not titles—titles can collide)
  • Unresolved links are data (not errors)
  • Schema-stable: Core tables won't change; additions only

Roadmap

  • Embedding support (vector similarity)
  • WebDAV/S3 sync hooks
  • Obsidian plugin (sync on save)
  • Import .base file format

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors