Skip to content

feat: add memory_type to FTS5 index for keyword search #662

Closed

Description

@ajianaz

Summary

memories_fts FTS5 only indexes: content, tags, namespace. The memory_type column is not indexed.

Current:

CREATE VIRTUAL TABLE memories_fts USING fts5(content, tags, namespace, content='memories');

Proposed

Add memory_type to FTS5 columns and update triggers.

Acceptance Criteria

Functional

  • Add memory_type to FTS5 columns
  • Update FTS5 triggers to include memory_type
  • Rebuild existing FTS5 index

Verification (CMO can run without reading code)

  • sqlite3 uteke.db "SELECT * FROM memories_fts WHERE memories_fts MATCH 'memory_type:decision'" → returns decision-type memories
  • sqlite3 uteke.db "SELECT * FROM memories_fts WHERE memories_fts MATCH 'memory_type:event'" → returns event-type memories
  • sqlite3 uteke.db "SELECT * FROM memories_fts WHERE memories_fts MATCH 'memory_type:fact'" → returns fact-type memories (most common)
  • After inserting new memory with type=insight → FTS5 query finds it
  • Query time < 1ms for memory_type filter on 17K rows

Tests

  • Integration: rebuild FTS5 → all 17K+ memories indexed correctly
  • Unit: insert → FTS5 contains new row

Priority

Low — /query endpoint (#657) is the primary solution.

Dependencies

Coordinate with #656 (index creation).

Activity

  1. added
    enhancement
    priority:low
    scope:db
    on Jul 14, 2026
  2. ajianaz commented on Jul 14, 2026

    @ajianaz
    CollaboratorAuthor

    Dependencies

    Coordinate with #656 (index creation) to batch schema migration.

  3. added a commit that references this issue on Jul 14, 2026
  4. added 2 commits that reference this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:lowscope:db

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions