Enhanced Insights with daily summary embeddings
Bump to 0.5.0. Added daily summary generation job
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Drop tables in reverse order
|
||||
DROP TABLE IF EXISTS vec_message_embeddings;
|
||||
DROP TABLE IF EXISTS message_embeddings;
|
||||
19
migrations/2026-01-04-000000_add_message_embeddings/up.sql
Normal file
19
migrations/2026-01-04-000000_add_message_embeddings/up.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Table for storing message metadata and embeddings
|
||||
-- Embeddings stored as BLOB for proof-of-concept
|
||||
-- For production with many contacts, consider using sqlite-vec extension
|
||||
CREATE TABLE message_embeddings (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
contact TEXT NOT NULL,
|
||||
body TEXT NOT NULL,
|
||||
timestamp BIGINT NOT NULL,
|
||||
is_sent BOOLEAN NOT NULL,
|
||||
embedding BLOB NOT NULL,
|
||||
created_at BIGINT NOT NULL,
|
||||
model_version TEXT NOT NULL,
|
||||
-- Prevent duplicate embeddings for the same message
|
||||
UNIQUE(contact, body, timestamp)
|
||||
);
|
||||
|
||||
-- Indexes for efficient queries
|
||||
CREATE INDEX idx_message_embeddings_contact ON message_embeddings(contact);
|
||||
CREATE INDEX idx_message_embeddings_timestamp ON message_embeddings(timestamp);
|
||||
Reference in New Issue
Block a user