Skip to content

Commit b319ff1

Browse files
committed
fix: add memories_768 table
1 parent 98eb06d commit b319ff1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/adapter-supabase/schema.sql

+17
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ CREATE TABLE memories_1024 (
6262
CONSTRAINT fk_agent FOREIGN KEY ("agentId") REFERENCES accounts("id") ON DELETE CASCADE
6363
);
6464

65+
CREATE TABLE memories_768 (
66+
"id" UUID PRIMARY KEY,
67+
"type" TEXT NOT NULL,
68+
"createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
69+
"content" JSONB NOT NULL,
70+
"embedding" vector(768), -- Gaianet nomic-embed
71+
"userId" UUID REFERENCES accounts("id"),
72+
"agentId" UUID REFERENCES accounts("id"),
73+
"roomId" UUID REFERENCES rooms("id"),
74+
"unique" BOOLEAN DEFAULT true NOT NULL,
75+
CONSTRAINT fk_room FOREIGN KEY ("roomId") REFERENCES rooms("id") ON DELETE CASCADE,
76+
CONSTRAINT fk_user FOREIGN KEY ("userId") REFERENCES accounts("id") ON DELETE CASCADE,
77+
CONSTRAINT fk_agent FOREIGN KEY ("agentId") REFERENCES accounts("id") ON DELETE CASCADE
78+
);
79+
6580
CREATE TABLE memories_384 (
6681
"id" UUID PRIMARY KEY,
6782
"type" TEXT NOT NULL,
@@ -161,6 +176,8 @@ CREATE TABLE knowledge (
161176
-- Add index for Ollama table
162177
CREATE INDEX idx_memories_1024_embedding ON memories_1024 USING hnsw ("embedding" vector_cosine_ops);
163178
CREATE INDEX idx_memories_1024_type_room ON memories_1024("type", "roomId");
179+
CREATE INDEX idx_memories_768_embedding ON memories_768 USING hnsw ("embedding" vector_cosine_ops);
180+
CREATE INDEX idx_memories_768_type_room ON memories_768("type", "roomId");
164181
CREATE INDEX idx_memories_1536_embedding ON memories_1536 USING hnsw ("embedding" vector_cosine_ops);
165182
CREATE INDEX idx_memories_384_embedding ON memories_384 USING hnsw ("embedding" vector_cosine_ops);
166183
CREATE INDEX idx_memories_1536_type_room ON memories_1536("type", "roomId");

0 commit comments

Comments
 (0)