Skip to content

[Feature] Hashtag tag parsing in /capture and remember #46

@rahilp

Description

@rahilp

Hashtag tag parsing in /capture and remember

Why

Tags currently require a JSON array. That’s fine for API calls but it’s a real barrier for everyday capture — nobody types {"tags": ["health", "fitness"]} on their phone.

Hashtags fix this. "Went for a run today #health #fitness" should just work.

What this covers

  • Parse hashtags from content in the /capture REST endpoint
  • Parse hashtags from content in the remember MCP tool
  • Strip hashtags from stored content so the text stays clean
  • Merge extracted hashtags with any explicitly provided tags (deduped, case-insensitive)

Implementation

function extractHashtags(content: string): { cleanContent: string; hashtags: string[] } {
  const hashtags = (content.match(/#(\w+)/g) || []).map(t => t.slice(1).toLowerCase());
  const cleanContent = content.replace(/#\w+/g, '').trim();
  return { cleanContent, hashtags };
}

Apply in both /capture and remember before duplicate check and storage:

const { cleanContent, hashtags } = extractHashtags(c);
const finalTags = [...new Set([...explicitTags, ...hashtags])];

Acceptance criteria

  • "note content #tag1 #tag2" stores with tags ["tag1", "tag2"] and clean content
  • Explicit tags in JSON body merge with hashtag-extracted tags
  • Duplicate tags deduped (case-insensitive)
  • Works in both /capture REST endpoint and remember MCP tool
  • No breaking change — existing calls without hashtags behave identically

Why this matters

Enables natural capture from iOS Shortcuts, browser bookmarklet, and voice input without any JSON formatting. Critical for personal use cases — health logging, relationship notes, travel — where users capture quickly on mobile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions