Skip to content

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

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:lowFix when convenientscope:dbSQLite schema, indexes, migrations

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions