Skip to content

Section and Observation Anchor Wikilinks Support #135

@calebjpicker

Description

@calebjpicker

Feature Description

Add support for anchor links within documents, allowing wikilinks to reference specific sections or elements within a markdown file. Currently, Basic Memory only supports linking to entire documents via title, permalink, or memory URL.

Problem This Feature Solves

When working with long documents (meeting notes, research papers, conference notes), I need to reference specific quotes, insights, or sections. Currently I must either:

  • Create separate files for each quote (breaks context)
  • Link to entire documents (reader must search for relevant part)
  • Rely on search (doesn't create semantic connections)

Proposed Solution

Enable two types of anchor links:

  1. Section anchors: [[Meeting Notes#Project-Updates]] - links to ## Project Updates
  2. Observation anchors: [[Meeting Notes#Project-Updates#id-0001]] - links to any element tagged with #id-0001 within that section

Proposed Syntax:
[[entity#section#observation]]

Where:

  • entity = document name/title
  • section = heading within document (optional)
  • observation = specific element ID (optional)

Example workflow:

# Team Meeting 2025-06-14

## Budget Discussion
[quote] "We need to triple our marketing spend" (marketing) #id-0001 #john
[quote] "Last year's ROI was only 1.2x" (marketing) #id-0002 #sarah
  • based_on [[Q1 Marketing Report 2025#roi-analysis#figure-3]]
[action] Review Q1 marketing metrics before decision (marketing) #id-0003

## Tech Updates  
[issue] Accounting system can't handle multi-currency (accounting) #id-0004
[finding] $50k loss from exchange rate errors last quarter (accounting) #id-0005 #teri
  • discovered_in [[Financial Audit 2025#exchange-rate-errors#table-2]]
[todo] Schedule vendor demos for new system (tech) #id-0006

## Relations
- relates_to [[Q1 Marketing Performance Report]]
- impacts [[International Expansion Strategy#europe-section]]
- contradicts [[2024 Budget Decisions#marketing#spend-reduction]]

What This Feature Would Enable:

Basic Memory currently supports:
[[Team Meeting]] → relates_to → [[Marketing Report]]
(whole document → whole document)

With anchor support, we could use flexible syntax for any granularity:

Between Documents:
[[Budget Analysis]] → based_on → [[Team Meeting#Budget-Discussion]]
(entity → section of another entity)

[[Marketing Report#roi-analysis]] → contradicts → [[Team Meeting#Budget-Discussion#id-0001]]
(section → specific observation in another doc)

[[Team Meeting#Budget-Discussion#id-0002]] → derived_from → [[Marketing Report#roi-analysis#figure-3]]
(observation → observation across documents)

Within the Same Document:
[[#Summary]] → summarizes → [[#Budget-Discussion]]
(section → section in same doc)

[[#Tech-Updates#id-0004]] → caused_by → [[#Tech-Updates#id-0005]]
(observation → observation in same doc)

[[#Action-Items]] → implements → [[#Budget-Discussion#id-0001]], [[#Budget-Discussion#id-0003]], [[#Tech-Updates#id-0006]]
(section → multiple observations across sections in same doc)

The syntax supports any combination:

  • [[entity]] - whole document
  • [[entity#section]] - specific section
  • [[entity#section#observation]] - specific element
  • [[#section]] - section in current doc
  • [[#section#observation]] - specific element in current doc

In analysis documents:

# Q2 Analysis

John proposed [[Team Meeting 2025-06-14#Budget-Discussion#id-0001]] increasing spend, 
but Sarah noted [[Team Meeting 2025-06-14#Budget-Discussion#id-0002]] poor historical ROI.

Alternative Solutions

  • Creating one file per observation (too granular)
  • Using very descriptive filenames (still links to whole document)
  • Manual search for tags (no semantic graph connection)

Additional Context

This would enhance existing Basic Memory workflows like:

  • Conference Notes: Link to specific speaker quotes
  • Research Papers: Reference exact findings or methods
  • Meeting Notes: Connect decisions to who said what
  • Daily Reflections: Build precise knowledge chains

Without anchors, a "Weekly Planning" document can only say "see Tuesday's meeting notes" instead of linking directly to the specific decision or quote that matters.

Impact

This feature would:

  • Enable precise citation networks
  • Reduce need for file fragmentation
  • Make knowledge graphs more granular and useful
  • Support evidence-based workflows
  • Enhance the AI's ability to follow specific references when building context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions