Files
my-vault/.scripts/memory/schema.sql
T

21 lines
559 B
SQL
Raw Normal View History

CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS memory_primary (
id TEXT PRIMARY KEY,
source TEXT NOT NULL,
content TEXT NOT NULL,
content_hash TEXT NOT NULL,
2026-02-26 21:10:47 +08:00
embedding VECTOR(4096) NOT NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE IF NOT EXISTS memory_secure_audit (
id TEXT PRIMARY KEY,
source TEXT NOT NULL,
risk TEXT NOT NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS memory_primary_embedding_idx
2026-02-26 21:10:47 +08:00
ON memory_primary USING hnsw (embedding vector_cosine_ops);