From 7bdb8fc2e3c9553d8a30cbca060221f084aa28d6 Mon Sep 17 00:00:00 2001 From: Chris Bartholomew Date: Tue, 27 Jan 2026 03:54:07 -0500 Subject: [PATCH] fix: include tags, created_at, proof_count in graph table_rows (#207) The graph endpoint's table_rows response was missing three fields that the control plane UI expects: - tags: memory unit tags (shown in Tags column) - created_at: creation timestamp (shown in Created column for mental models) - proof_count: source memory count (shown in Sources column for mental models) All three columns exist on the memory_units table but were not being selected or included in the response. --- hindsight-api/hindsight_api/engine/memory_engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hindsight-api/hindsight_api/engine/memory_engine.py b/hindsight-api/hindsight_api/engine/memory_engine.py index f70cd12b..a0ae8016 100644 --- a/hindsight-api/hindsight_api/engine/memory_engine.py +++ b/hindsight-api/hindsight_api/engine/memory_engine.py @@ -2818,7 +2818,7 @@ class MemoryEngine(MemoryEngineInterface): param_count += 1 units = await conn.fetch( f""" - SELECT id, text, event_date, context, occurred_start, occurred_end, mentioned_at, document_id, chunk_id, fact_type + SELECT id, text, event_date, context, occurred_start, occurred_end, mentioned_at, document_id, chunk_id, fact_type, tags, created_at, proof_count FROM {fq_table("memory_units")} {where_clause} ORDER BY mentioned_at DESC NULLS LAST, event_date DESC @@ -2959,6 +2959,9 @@ class MemoryEngine(MemoryEngineInterface): "document_id": row["document_id"], "chunk_id": row["chunk_id"] if row["chunk_id"] else None, "fact_type": row["fact_type"], + "tags": list(row["tags"]) if row["tags"] else [], + "created_at": row["created_at"].isoformat() if row["created_at"] else None, + "proof_count": row["proof_count"] if row["proof_count"] else None, } )