You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
NOVA's daily session notes are currently stored as flat markdown files in ~/clawd/memory/YYYY-MM-DD.md. While these get embedded nightly into memory_embeddings (as daily_log source type — 770+ embeddings), the source files themselves live outside the database.
Current Flow
NOVA writes daily notes to ~/clawd/memory/YYYY-MM-DD.md during sessions
A nightly batch process reads these files, chunks them, and generates embeddings
Embeddings are stored in memory_embeddings table with source_type = 'daily_log'
Proposed Change
Store daily notes directly in the database (e.g., a daily_logs table) instead of flat files. Benefits:
Real-time embedding — Can trigger embedding generation via NOTIFY on insert/update instead of waiting for nightly batch
Structured metadata — Date, agent, session context as columns instead of parsed from filenames
Unified search — All memory sources in one place, queryable with SQL
Backup/replication — Included in pg_dump, no separate file backup needed
Multi-agent support — Multiple agents can write daily logs without filesystem coordination
Proposed Schema
CREATETABLEdaily_logs (
id SERIALPRIMARY KEY,
log_date DATENOT NULL,
agent_id INTEGERREFERENCES agents(id) DEFAULT 1,
content TEXTNOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(log_date, agent_id)
);
-- Trigger to auto-update updated_atCREATETRIGGERdaily_logs_updated_at
BEFORE UPDATEON daily_logs
FOR EACH ROW EXECUTE FUNCTION update_updated_at();
-- NOTIFY for embedding pipelineCREATE OR REPLACEFUNCTIONnotify_daily_log_change() RETURNS trigger AS $$
BEGIN
PERFORM pg_notify('daily_log_changed', json_build_object(
'id', NEW.id,
'log_date', NEW.log_date,
'agent_id', NEW.agent_id
)::text);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATETRIGGERdaily_logs_notify
AFTER INSERT ORUPDATEON daily_logs
FOR EACH ROW EXECUTE FUNCTION notify_daily_log_change();
Migration Path
Create the table and triggers
Import existing ~/clawd/memory/YYYY-MM-DD.md files into the table
Update NOVA's session write path to INSERT/UPDATE the table instead of writing files
Update the embedding pipeline to listen for daily_log_changed NOTIFY
Keep flat files as read-only archive (or generate from DB for backward compat)
Summary
NOVA's daily session notes are currently stored as flat markdown files in
~/clawd/memory/YYYY-MM-DD.md. While these get embedded nightly intomemory_embeddings(asdaily_logsource type — 770+ embeddings), the source files themselves live outside the database.Current Flow
~/clawd/memory/YYYY-MM-DD.mdduring sessionsmemory_embeddingstable withsource_type = 'daily_log'Proposed Change
Store daily notes directly in the database (e.g., a
daily_logstable) instead of flat files. Benefits:Proposed Schema
Migration Path
~/clawd/memory/YYYY-MM-DD.mdfiles into the tabledaily_log_changedNOTIFYRelated
memory_embeddingstable (existing embedding storage)source_type = 'daily_log'(770+ existing embeddings from flat files)