-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Issue: Obsidian YAML Frontmatter Tag Compatibility
Problem
Our current frontmatter logic adds tags using JSON array syntax:
tags: ["tag1", "tag2", "tag3"]While this is valid YAML, it makes Obsidian unhappy and doesn't follow Obsidian's preferred conventions for YAML frontmatter tags.
Expected Behavior
Obsidian prefers tags in YAML frontmatter to be formatted using one of these standard YAML list formats:
Option 1: YAML List Format (Recommended)
tags:
- tag1
- tag2
- tag3Option 2: YAML Array Format (Alternative)
tags: [tag1, tag2, tag3]Note: The unquoted format is preferred as it's cleaner and more aligned with Obsidian community conventions.
Current Impact
- ✅ Tags work functionally in Basic Memory
- ❌ Tags appear with JSON-style quotes in Obsidian
- ❌ May cause visual/parsing issues in Obsidian's property editor
- ❌ Doesn't follow Obsidian community best practices
References
- Obsidian Tags Documentation
- Obsidian Properties Documentation
- Obsidian Forum: YAML frontmatter formatting
Proposed Solution
Update the frontmatter generation in Basic Memory to use the YAML list format:
- Modify tag serialization in markdown generation
- Use unquoted strings for tag values (when they don't contain special characters)
- Use YAML list syntax with dashes instead of JSON array syntax
- Maintain backward compatibility for reading existing files
Implementation Areas
The changes would likely be needed in:
src/basic_memory/markdown/- Markdown generation and frontmatter handlingsrc/basic_memory/services/entity_service.py- Entity creation with frontmatter- Tests to verify the new format works correctly
Acceptance Criteria
- Tags are formatted using YAML list syntax (
- tag) instead of JSON array syntax (["tag"]) - Obsidian can properly parse and display the tags
- Basic Memory can still read existing files with old format
- All tests pass with new format
- Documentation updated to reflect the change
Priority
Medium - Improves compatibility with a major tool in the knowledge management ecosystem, but doesn't break core functionality.
Labels
enhancementcompatibilityobsidianyamlfrontmatter
Drakemoor and silversteez
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request