From 8856ef16a1b34177d9e9093ebfb30040c7235b05 Mon Sep 17 00:00:00 2001 From: Jonny Date: Sun, 13 Sep 2026 11:56:32 +0200 Subject: [PATCH] feat: add migration 006_memory.sql for cross-chat memory tables Add two new tables for cross-chat memory feature: - memory_facts: stores explicit user-provided facts (user_id, content, created_at) - conversation_summaries: stores conversation summaries with vector embeddings for similarity search This migration prepares the database schema for Task 2-7 of the cross-chat memory feature plan. No indexes yet (sequential scan sufficient for expected data volume). Co-Authored-By: Claude Haiku 4.5 Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w --- migrations/006_memory.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrations/006_memory.sql diff --git a/migrations/006_memory.sql b/migrations/006_memory.sql new file mode 100644 index 0000000..2788c27 --- /dev/null +++ b/migrations/006_memory.sql @@ -0,0 +1,13 @@ +CREATE TABLE memory_facts ( + id SERIAL PRIMARY KEY, + user_id INTEGER NOT NULL REFERENCES users(id), + content TEXT NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE conversation_summaries ( + conversation_id INTEGER PRIMARY KEY REFERENCES conversations(id), + summary TEXT NOT NULL, + embedding vector(768) NOT NULL, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +);