Enhanced Insights with daily summary embeddings
Bump to 0.5.0. Added daily summary generation job
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE daily_conversation_summaries;
|
||||
19
migrations/2026-01-04-060000_add_daily_summaries/up.sql
Normal file
19
migrations/2026-01-04-060000_add_daily_summaries/up.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Daily conversation summaries for improved RAG quality
|
||||
-- Each row = one day's conversation with a contact, summarized by LLM and embedded
|
||||
|
||||
CREATE TABLE daily_conversation_summaries (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
date TEXT NOT NULL, -- ISO date "2024-08-15"
|
||||
contact TEXT NOT NULL, -- Contact name
|
||||
summary TEXT NOT NULL, -- LLM-generated 3-5 sentence summary
|
||||
message_count INTEGER NOT NULL, -- Number of messages in this day
|
||||
embedding BLOB NOT NULL, -- 768-dim vector of the summary
|
||||
created_at BIGINT NOT NULL, -- When this summary was generated
|
||||
model_version TEXT NOT NULL, -- "nomic-embed-text:v1.5"
|
||||
UNIQUE(date, contact)
|
||||
);
|
||||
|
||||
-- Indexes for efficient querying
|
||||
CREATE INDEX idx_daily_summaries_date ON daily_conversation_summaries(date);
|
||||
CREATE INDEX idx_daily_summaries_contact ON daily_conversation_summaries(contact);
|
||||
CREATE INDEX idx_daily_summaries_date_contact ON daily_conversation_summaries(date, contact);
|
||||
Reference in New Issue
Block a user