openvibers/openvibe.chat Commits
Chat: a room's memory, kept between summaries (#557)
Changes
nnew file mode 100644@@@ -0,0 +1,23 @@++-- phase: expand++-- A room's memory (plan 2026-11-10, part 3): what the summariser may keep about a room between++-- summaries — running topics, standing facts ("the stream is on Fridays"), decisions and asks. Each++-- entry names the room messages it came from (ids only; never a copy of deleted text), when it was++-- learned and a confidence. A moderator may correct or remove any entry; a person may remove an entry++-- made from their own messages. It goes with the account export and deletion.++CREATE TABLE IF NOT EXISTS room_memory (++ id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,++ room_id bigint NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,++ kind text COLLATE "C" NOT NULL DEFAULT 'fact' CHECK (kind IN ('topic', 'fact', 'decision', 'request')),++ text text COLLATE "C" NOT NULL CHECK (char_length(text) BETWEEN 3 AND 400),++ source_message_ids jsonb NOT NULL DEFAULT '[]'::jsonb,++ source_subjects jsonb NOT NULL DEFAULT '[]'::jsonb,++ confidence integer NOT NULL DEFAULT 50 CHECK (confidence BETWEEN 0 AND 100),++ learned_at text COLLATE "C" NOT NULL DEFAULT ov_now(),++ learned_by text COLLATE "C" NOT NULL DEFAULT 'ai',++ updated_at text COLLATE "C",++ updated_by text COLLATE "C",++ removed_at text COLLATE "C",++ removed_by text COLLATE "C"++);++CREATE INDEX IF NOT EXISTS idx_room_memory_room ON room_memory (room_id, removed_at, id DESC);++CREATE INDEX IF NOT EXISTS idx_room_memory_room_text ON room_memory (room_id, text);
new file mode 100644
new file mode 100644
@@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
+-- phase: expand
+-- A room's memory (plan 2026-11-10, part 3): what the summariser may keep about a room between
+-- summaries — running topics, standing facts ("the stream is on Fridays"), decisions and asks. Each
+-- entry names the room messages it came from (ids only; never a copy of deleted text), when it was
+-- learned and a confidence. A moderator may correct or remove any entry; a person may remove an entry
+-- made from their own messages. It goes with the account export and deletion.
+CREATE TABLE IF NOT EXISTS room_memory (
+ id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
+ room_id bigint NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
+ kind text COLLATE "C" NOT NULL DEFAULT 'fact' CHECK (kind IN ('topic', 'fact', 'decision', 'request')),
+ text text COLLATE "C" NOT NULL CHECK (char_length(text) BETWEEN 3 AND 400),
+ source_message_ids jsonb NOT NULL DEFAULT '[]'::jsonb,
+ source_subjects jsonb NOT NULL DEFAULT '[]'::jsonb,
+ confidence integer NOT NULL DEFAULT 50 CHECK (confidence BETWEEN 0 AND 100),
+ learned_at text COLLATE "C" NOT NULL DEFAULT ov_now(),
+ learned_by text COLLATE "C" NOT NULL DEFAULT 'ai',
+ updated_at text COLLATE "C",
+ updated_by text COLLATE "C",
+ removed_at text COLLATE "C",
+ removed_by text COLLATE "C"
+);
+CREATE INDEX IF NOT EXISTS idx_room_memory_room ON room_memory (room_id, removed_at, id DESC);
+CREATE INDEX IF NOT EXISTS idx_room_memory_room_text ON room_memory (room_id, text);