-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.sql
More file actions
29 lines (25 loc) · 946 Bytes
/
schema.sql
File metadata and controls
29 lines (25 loc) · 946 Bytes
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
-- deja: persistent memory for agents
CREATE TABLE IF NOT EXISTS learnings (
id TEXT PRIMARY KEY,
trigger TEXT NOT NULL,
learning TEXT NOT NULL,
reason TEXT,
confidence REAL DEFAULT 1.0,
source TEXT,
scope TEXT NOT NULL, -- Added for scope support
embedding TEXT, -- Vector embedding as JSON string
created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_learnings_trigger ON learnings(trigger);
CREATE INDEX IF NOT EXISTS idx_learnings_confidence ON learnings(confidence);
CREATE INDEX IF NOT EXISTS idx_learnings_created_at ON learnings(created_at);
CREATE INDEX IF NOT EXISTS idx_learnings_scope ON learnings(scope);
-- Secrets table (authenticated read/write)
CREATE TABLE IF NOT EXISTS secrets (
name TEXT PRIMARY KEY,
value TEXT NOT NULL,
scope TEXT NOT NULL, -- Added for scope support
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_secrets_scope ON secrets(scope);