Ingest Obsidian Vault Data for LlamaIndex
LlamaIndex reader that parses Obsidian vault markdown files into documents with metadata including wikilinks, backlinks, and optional task extraction.
Why it matters
Integrate your Obsidian vault into LlamaIndex or LangChain agents. This asset parses markdown files, extracting content and metadata for advanced AI applications.
Outcomes
What it gets done
Parse all markdown files from an Obsidian vault.
Extract file names, folder paths, and wikilinks as metadata.
Optionally extract tasks from notes.
Load parsed data into LlamaIndex or LangChain.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-obsidian | bash Overview
LlamaIndex Readers Integration: Obsidian
The Obsidian Reader integration for LlamaIndex parses markdown files from an Obsidian vault into Document objects. Each document includes metadata such as file name, folder paths, note name, wikilinks, and backlinks. It optionally extracts tasks from the text and can remove task lines from the main content. This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.
What it does
The LlamaIndex Obsidian Reader integration parses markdown files from an Obsidian vault and converts them into a list of Documents for use in LlamaIndex workflows. Documents are automatically split by headers, and each document includes rich metadata: file name, folder paths, note name, wikilinks, and backlinks. Optionally, tasks can be extracted from the text and stored in metadata, with the ability to remove task lines from the main document text.
When to use - and when NOT to
This reader loads data from Obsidian vaults into LlamaIndex. The source material indicates it is designed to load data into LlamaIndex and can subsequently be used as a Tool in a LangChain Agent.
Inputs and outputs
You provide the path to an Obsidian vault directory as the input_dir parameter. Optional boolean flags control task extraction (extract_tasks) and whether to remove task lines from the document text (remove_tasks_from_text). The reader returns a list of Document objects, each containing the parsed markdown content and metadata fields: file_name, folder_path, folder_name, note_name, wikilinks (all wikilinks found in the document), and backlinks (all notes that link to this note).
from llama_index.readers.obsidian import ObsidianReader
# Initialize ObsidianReader with the path to the Obsidian vault
reader = ObsidianReader(
input_dir="<Path to Obsidian Vault>",
extract_tasks=False,
remove_tasks_from_text=False,
)
# Load data from the Obsidian vault
documents = reader.load_data()
Integrations
This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.
Who it's for
This integration is a data loader for LlamaIndex that parses Obsidian vault markdown files.
Source README
LlamaIndex Readers Integration: Obsidian
Overview
Pass in the path to an Obsidian vault and it will parse all markdown
files into a List of Documents. Documents are split by header in
the Markdown Reader we use.
Each document will contain the following metadata:
- file_name: the name of the markdown file
- folder_path: the full path to the folder containing the file
- folder_name: the relative path to the folder containing the file
- note_name: the name of the note (without the .md extension)
- wikilinks: a list of all wikilinks found in the document
- backlinks: a list of all notes that link to this note
Optionally, tasks can be extracted from the text and stored in metadata.
Usage
from llama_index.readers.obsidian import ObsidianReader
### Initialize ObsidianReader with the path to the Obsidian vault
reader = ObsidianReader(
input_dir="<Path to Obsidian Vault>",
extract_tasks=False,
remove_tasks_from_text=False,
)
### Load data from the Obsidian vault
documents = reader.load_data()
Arguments
- input_dir (str): Path to the Obsidian vault.
- extract_tasks (bool): If True, extract tasks from the text and store them in metadata. Default is False.
- remove_tasks_from_text (bool): If True and extract_tasks is True, remove the task lines from the main document text. Default is False.
Implementation for Obsidian reader can be found here
This loader is designed to be used as a way to load data into
LlamaIndex and/or subsequently
used as a Tool in a LangChain Agent.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.