openvibers/openvibe.chat Commits

Chat: a room's memory, kept between summaries (#557)

OP OpenVibers committed 4 h ago · 8b18cb78d6 · 1 file, +23 −0

* Chat: the Global room's AI insight, read and shown

* Merge origin/main

* Chat: a room's insight, for rooms, server channels and Live channels

* Merge origin/main

* Merge origin/main

* Chat: a room's memory, kept between summaries

* Chat: renumber the room memory migration to 0066

* Chat: cover the memory page's render

* Chat: room memory is for the room's members

* Chat: renumber the room memory migration to 0067

* Chat: follow the room insight settings migration as 0066 on main

* Merge remote-tracking branch 'origin/main' into feat/room-memory-1110

* Merge origin/main

* Chat: renumber the room memory migration to 0079

Changes

ddiff --git a/migrations/0079_room_memory.sql b/migrations/0079_room_memory.sql
nnew file mode 100644
iindex 0000000..ce9c968
---- /dev/null
++++ b/migrations/0079_room_memory.sql
@@@ -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);