Skip to content

Commit 9efe4aa

Browse files
committed
docs(memory): document archived_traces brain_id source caveat
1 parent ca31c3d commit 9efe4aa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/memory/retrieval/store/migrations/v1-to-v2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ const V2_TABLES: TableSpec[] = [
292292
primaryKey: ['brain_id', 'trace_id'],
293293
// Migration: copy existing agent_id column into brain_id (legacy archive
294294
// already discriminated by agent_id, which is semantically the same).
295+
//
296+
// CAVEAT: if the caller passes an explicit brainId override that differs
297+
// from the original agent_id, archived_traces row brain_ids stay at the
298+
// original agent_id values (not the override). Live tables receive the
299+
// override; only archived_traces inherits agent_id. To rebrand archives,
300+
// run a separate UPDATE statement after migration.
295301
brainIdSourceColumn: 'agent_id',
296302
indexes: [
297303
`CREATE INDEX IF NOT EXISTS idx_archived_traces_brain_time

0 commit comments

Comments
 (0)