vectorStore.migrations.V1__Initial.sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xef-postgresql Show documentation
Show all versions of xef-postgresql Show documentation
Building applications with LLMs through composability in Kotlin
-- Add Vector extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Create collections table
CREATE TABLE IF NOT EXISTS xef_collections (
uuid TEXT PRIMARY KEY,
name TEXT UNIQUE NOT NULL
);
-- Create memory table
CREATE TABLE IF NOT EXISTS xef_memory (
uuid TEXT PRIMARY KEY,
conversation_id TEXT NOT NULL,
role TEXT NOT NULL,
content TEXT NOT NULL,
index INT NOT NULL
);
-- Create embeddings table
CREATE TABLE IF NOT EXISTS xef_embeddings (
uuid TEXT PRIMARY KEY,
collection_id TEXT REFERENCES xef_collections(uuid),
embedding vector(1536),
content TEXT
);