obsidian-copilot icon indicating copy to clipboard operation
obsidian-copilot copied to clipboard

Enhancement: include Obsidian frontmatter tags and aliases in Vault QA index/search

Open ONOVAR opened this issue 8 months ago • 0 comments

Add an option in Copilot’s settings to have the Vault QA indexer also read and index each note’s YAML frontmatter tags and aliases. This would allow users’ existing metadata workflows to surface notes in QA queries, even when the search term only appears in a tag or alias—not in the body text.

Current Behavior

  • Vault QA only indexes the raw note content.
  • Notes tagged or aliased with keywords (for synonyms, alternative names, or other languages) are not returned if the keyword doesn’t appear in the body.

Desired Behavior

  • A toggle “Include frontmatter metadata (tags & aliases) in QA index” in Settings → Vault QA.
  • When enabled, the indexer should:
    • Read each note’s YAML frontmatter tags array.
    • Read each note’s YAML frontmatter aliases array.
    • Treat those values as if they appeared in the body for search and retrieval.

Why this is useful

  1. Synonym lookup
  • You may tag a note with a synonym (e.g. tag UI/UX on a note whose text only says “user interface design”). Vault QA would then return that note when asking about “UI/UX.”
  1. Multi-lingual notes
  • If you maintain notes in English but add Chinese or Georgian translations under aliases, you can query in any language and still retrieve the correct note.
  1. Concept mapping
  • Tags often capture higher-level concepts (e.g. #project-management). Indexing them ensures your QA agent knows which notes relate to that concept even if the phrase never appears verbatim.
  1. Consistent with Obsidian search
  • Obsidian’s built-in search already respects tags and aliases. Bringing Copilot’s QA into alignment removes user confusion and leverages existing vault organization.

Steps to reproduce

  1. Create a note with frontmatter:
---
tags: [“synonym”, “例子”, “აუდიო”]
aliases: [“alternative name”, “пример”]
---
# My Note Title
Content mentions neither “synonym” nor “alternative name”…
  1. Content mentions neither “synonym” nor “alternative name”…
  2. Run Vault QA and ask: “Show me the note about synonym” (or “пример”).
  3. Observe that the note is not returned.

Suggested implementation

  • Extend the local indexing pipeline to parse YAML frontmatter for tags and aliases.
  • Merge those strings into the document text before vectorization.
  • Expose a user-toggle in plugin settings to enable/disable metadata indexing.

ONOVAR avatar Apr 25 '25 08:04 ONOVAR