File size: 836 Bytes
66dbebd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- sessions.sqlite
-- SQLite Schema for MVP Persistence Layer

CREATE TABLE sessions (
    session_id TEXT PRIMARY KEY,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    last_activity TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    context_data BLOB,  -- Compressed JSON
    user_metadata TEXT
);

CREATE TABLE interactions (
    interaction_id TEXT PRIMARY KEY,
    session_id TEXT REFERENCES sessions(session_id),
    user_input TEXT NOT NULL,
    agent_trace TEXT,  -- JSON array of agent executions
    final_response TEXT,
    processing_time INTEGER,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE embeddings (
    embedding_id INTEGER PRIMARY KEY AUTOINCREMENT,
    session_id TEXT,
    content_text TEXT,
    embedding_vector BLOB,  -- FAISS-compatible
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);