Skip to main content
A minimal guide to turning an Obsidian vault into Cognee memory. obsidian_source() returns a dlt resource you pass straight to remember(), and each *.md note becomes one document whose id is its path in the vault. Unlike remember(<folder>), which stores a note once, re-running the sync replaces edited notes and forgets deleted or renamed ones.

Before You Start

  • Complete Quickstart to understand basic operations
  • Ensure you have LLM Providers configured — the script needs LLM_API_KEY to extract the graph and answer the question
  • Read Datasets — the vault is synced into its own obsidian_vault dataset
  • No extra install, account, or token is needed: the connector ships with Cognee and only reads files from a local folder
  • Run the script against a throwaway Cognee instance (a scratch SYSTEM_ROOT_DIRECTORY and DATA_ROOT_DIRECTORY) — it starts by wiping the whole instance, not just this dataset
prune_data() and prune_system(metadata=True) delete every dataset in the instance the script runs against. Remove those two calls before pointing the script at memory you want to keep.

Code in Action

What Just Happened

Step 1: Configure the Sync

These are the routing options for remember(), reused on every sync. write_disposition="merge" upserts notes by their id (their path in the vault); with the default "replace", the next sync would wipe the whole synced vault. max_rows_per_table=0 disables any per-table read cap, so forget-on-delete compares against the entire vault.

Step 2: Sync the Vault and Ask

obsidian_source(vault_path=...) builds a dlt resource over every *.md note in the vault. remember() loads the notes into the obsidian_vault dataset and builds the graph, and source.cognee_sync_stats reports counts such as synced, deleted, and failed. recall() then asks the same question against that dataset.

Step 3: Change the Vault

The script edits two notes and deletes a third, the way you would in Obsidian. The frontmatter title names the note and its tags become node sets (obsidian:tag:engineering).

Step 4: Sync Again

Every sync walks the whole vault, but a note whose text did not change costs no extraction, so only the two edited notes are built again. The edited notes replace their old documents and the deleted note is forgotten, so the old answer — Ada Lovelace leads Project Atlas — does not come back.

Additional Information

Pass your vault’s folder as vault_path, and folders=[...] to read only some folders. Only regular *.md files are read: hidden files and folders (.obsidian, .trash, .git), attachments, and symbolic links are skipped. A renamed or moved note is a new document under its new path, and the old one is forgotten.
If the vault folder is gone, or is empty although notes were synced from it before (a drive that did not mount), the sync raises ObsidianVaultUnavailableError; a folder that cannot be listed raises ObsidianListingError. Either way nothing is synced and nothing is forgotten. A note that cannot be read keeps what memory already holds and is counted in cognee_sync_stats["failed"], so check it after a normal return.
The text of every note, frontmatter included, goes to your configured LLM and embedding providers. Nothing is read until you build a source and run it. Keep a vault in its own dataset so it is easy to inspect and forget. cognee.forget does not remove the staged copy of the text, so the next sync builds the notes again.

dlt (Data Load Tool)

Every Obsidian connector parameter and error, and how forget-on-delete works

Remember

All remember() parameters, including the dlt options

Recall

Query the synced vault with other search types

Forget: Delete Agent Memory

Wipe the vault dataset when you are done