Skip to content

feat(memory): FTS5 + embedding semantic search over session history #19

@TerrysPOV

Description

@TerrysPOV

Background

ClaudeClaw-Plus has a persistent memory system. A complementary layer — searchable session history — would give Claude recall over past work without loading entire sessions into context.

Proposed approach (from @Nibbler1250)

Index all session JSONL files into SQLite with two search layers:

  1. FTS5 — fast exact keyword match
  2. Sentence-transformer vectors — semantic similarity (all-MiniLM-L6-v2, ~80MB)

Combined weighted hybrid score: alpha * vector_score + (1-alpha) * fts5_score

For Claude Max users (no separate API key), summaries can pipe through the claude --print CLI rather than the SDK:

result = subprocess.run(
    ["claude", "--print", "--model", "claude-haiku-4-5"],
    input=summary_prompt, capture_output=True, text=True
)

@Nibbler1250 has a working ~200-line Python implementation ready to contribute.

Why ClaudeClaw-Plus

  • Orthogonal to (but complementary with) Plus's existing MEMORY.md system
  • Provides unlimited searchable history without blowing up context window
  • The infrastructure complexity (SQLite, embeddings) fits Plus's scope

Source

Requested by @Nibbler1250 in moazbuilds/claudeclaw#14 (Mega-Post) with a working proof-of-concept.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions