Skip to content

Split semantic.rs into recall, summarization, and cross-session sub-modules #1736

@bug-ops

Description

@bug-ops

Problem

crates/zeph-memory/src/semantic.rs is 3335 lines. It handles recall, summarization, MMR re-ranking, temporal decay, cross-session search, graph extraction, corrections, and session summaries — all in a single file.

Proposed Changes

Extract concern-specific modules under semantic/:

  • semantic/recall.rsrecall(), apply_mmr(), apply_temporal_decay(), RecalledMessage
  • semantic/summarization.rssummarize_conversation(), structured summary generation, Summary
  • semantic/cross_session.rs — cross-session search, SessionSummaryResult, session summary retrieval
  • semantic/corrections.rs — correction storage, embedding, and retrieval
  • semantic/graph.rsextract_and_store(), ExtractionStats, GraphExtractionConfig
  • semantic/mod.rsSemanticMemory struct definition and delegation methods

Acceptance Criteria

  • No file in semantic/ exceeds 600 lines
  • Public API unchanged (same re-exports from crates/zeph-memory/src/lib.rs)
  • All tests pass

Files

  • crates/zeph-memory/src/semantic.rs (3335 lines)

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode refactoring without functional changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions