summaryrefslogtreecommitdiff
path: root/Omni/Agent/Memory.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-19 21:54:54 -0500
committerBen Sima <ben@bensima.com>2025-12-19 21:54:54 -0500
commitfcb8629182fa1552e4a840ccd4ec0aa2b8042cc0 (patch)
treee389479cf9349fbdab107da739bceef11cf8e7ee /Omni/Agent/Memory.hs
parente856c766584ed933bed0b79c7ef47b6d98b0fb7e (diff)
feat(ava): add tool trace viewer mini-app
- Add SQLite storage for tool traces (Omni/Ava/Trace.hs) - Add web server to serve trace viewer (Omni/Ava/Web.hs) - Add HTML/CSS/JS trace viewer UI (Omni/Ava/Web/trace.html) - Integrate trace storage into Engine.hs tool execution callback - Add trace links to Telegram responses when AVA_WEB_URL is set - Configure Tailscale Funnel for public access - Fix pre-push hook variable scope bug - Add direnv, bash, nix to Ava service PATH - Add mustache dep to Ava.hs for template rendering Epic: t-272
Diffstat (limited to 'Omni/Agent/Memory.hs')
-rw-r--r--Omni/Agent/Memory.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Omni/Agent/Memory.hs b/Omni/Agent/Memory.hs
index d59104c..c869b26 100644
--- a/Omni/Agent/Memory.hs
+++ b/Omni/Agent/Memory.hs
@@ -795,6 +795,21 @@ initMemoryDb conn = do
SQL.execute_
conn
"CREATE INDEX IF NOT EXISTS idx_chat_history_time ON chat_history(created_at)"
+ SQL.execute_
+ conn
+ "CREATE TABLE IF NOT EXISTS tool_traces (\
+ \ id TEXT PRIMARY KEY,\
+ \ created_at TEXT NOT NULL,\
+ \ tool_name TEXT NOT NULL,\
+ \ input TEXT NOT NULL,\
+ \ output TEXT NOT NULL,\
+ \ duration_ms INTEGER NOT NULL,\
+ \ user_id TEXT,\
+ \ chat_id TEXT\
+ \)"
+ SQL.execute_
+ conn
+ "CREATE INDEX IF NOT EXISTS idx_traces_created ON tool_traces(created_at)"
-- | Migrate conversation_messages to add sender_name and thread_id columns.
migrateConversationMessages :: SQL.Connection -> IO ()