feat(memory): use timestamp-prefixed document IDs for chronological sorting (#381)

Replace random UUID document IDs with `{unix_seconds}_{8char_hex}` format
so memory documents sort chronologically by filename and ID.
This commit is contained in:
Steven Enamakel
2026-04-06 19:46:15 -07:00
committed by GitHub
parent 3851d1ef67
commit e8fd08c800
@@ -27,7 +27,11 @@ impl UnifiedMemory {
let document_id = input
.document_id
.or(existing_document_id)
.unwrap_or_else(|| Uuid::new_v4().to_string());
.unwrap_or_else(|| {
let ts = Self::now_ts() as u64;
let short = &Uuid::new_v4().to_string()[..8];
format!("{ts}_{short}")
});
let now = Self::now_ts();
let created_at = {
let conn = self.conn.lock();