Skip to content

⏳ Feature: Time-travel queries — query memories at a specific point in time #292

Closed

Description

@ajianaz

Context

SurrealDB adoption analysis (June 2026) identified time-travel queries as a valuable pattern. Uteke's schema already has valid_from/valid_until columns on the memories table, but the logic to actually query historical states is not implemented.

Current State

  • Schema columns valid_from and valid_until exist in SQLite
  • Columns are currently unused — no code reads or writes to them
  • No API/CLI support for temporal queries

Proposed Implementation

Phase 1: Populate timestamps

  • On remember() — set valid_from = now(), valid_until = NULL
  • On forget() — set valid_until = now() (soft-delete friendly)
  • On consolidate() — update valid_from of the surviving memory, set valid_until on the merged one

Phase 2: Temporal recall

  • New CLI flag: uteke recall --as-of <timestamp> — returns memories that were valid at that point in time
  • New API endpoint: GET /recall?query=...&as_of=2026-06-01T00:00:00Z
  • Server API: add as_of parameter to existing recall endpoints

Phase 3: History tracking

  • uteke history --memory <id> — show full lifecycle of a memory (created, updated, forgotten timestamps)
  • Useful for debugging memory consolidation and decay decisions

Acceptance Criteria

  • valid_from populated on every remember() call
  • valid_until set on forget() (soft-delete)
  • recall --as-of <timestamp> returns only memories valid at that time
  • API endpoint supports as_of query parameter
  • history --memory <id> shows lifecycle timeline
  • Existing recall without --as-of behaves unchanged (returns current valid memories)
  • Documentation updated

Effort

~3-4 days (Phase 1 + 2). Phase 3 can be deferred.

References

Activity

  1. added
    enhancement
    scope:core
    on Jun 12, 2026
  2. added
    epic:memory-engine
    on Jun 13, 2026
  3. added this to the milestone on Jun 13, 2026
  4. ajianaz commented on Jun 13, 2026

    @ajianaz
    CollaboratorAuthor

    Implemented in PR #314, merged to develop.

  5. modified the milestones: , on Jun 13, 2026
  6. added
    v0.1.0
    on Jun 13, 2026
  7. added a commit that references this issue on Jun 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

    enhancementepic:memory-enginepriority:mediumscope:corev0.1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions