Skip to content

feat: add phase 1 mem db#10634

Merged
jif-oai merged 4 commits intomainfrom
jif/memory-db
Feb 4, 2026
Merged

feat: add phase 1 mem db#10634
jif-oai merged 4 commits intomainfrom
jif/memory-db

Conversation

@jif-oai
Copy link
Collaborator

@jif-oai jif-oai commented Feb 4, 2026

  • Schema: thread_id (PK, FK to threads.id with cascade delete), trace_summary, memory_summary, updated_at.
  • Migration: creates the table and an index on (updated_at DESC, thread_id DESC) for efficient recent-first reads.
  • Runtime API (DB-only):
    • get_thread_memory(thread_id): fetch one memory row.
    • upsert_thread_memory(thread_id, trace_summary, memory_summary): insert/update by thread id and always advance updated_at.
    • get_last_n_thread_memories_for_cwd(cwd, n): join thread_memory with threads and return newest n rows for an exact cwd match.
  • Model layer: introduced ThreadMemory and row conversion types to keep query decoding typed and consistent with existing state models.

@jif-oai jif-oai merged commit 4922b3e into main Feb 4, 2026
42 of 50 checks passed
@jif-oai jif-oai deleted the jif/memory-db branch February 4, 2026 21:38
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants