@steno-ai/supabase-adapter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +7 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +8 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/storage.d.ts +126 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +990 -0
- package/dist/storage.js.map +1 -0
- package/package.json +33 -0
- package/src/client.d.ts +7 -0
- package/src/client.d.ts.map +1 -0
- package/src/client.js +8 -0
- package/src/client.js.map +1 -0
- package/src/client.ts +13 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +2 -0
- package/src/migrations/001_extensions.sql +4 -0
- package/src/migrations/002_create_tenants.sql +14 -0
- package/src/migrations/003_create_api_keys.sql +15 -0
- package/src/migrations/004_create_sessions.sql +18 -0
- package/src/migrations/005_create_extractions.sql +34 -0
- package/src/migrations/006_create_facts.sql +68 -0
- package/src/migrations/007_create_entities.sql +26 -0
- package/src/migrations/008_create_fact_entities.sql +9 -0
- package/src/migrations/009_create_edges.sql +22 -0
- package/src/migrations/010_create_triggers.sql +18 -0
- package/src/migrations/011_create_memory_accesses.sql +20 -0
- package/src/migrations/012_create_usage_records.sql +16 -0
- package/src/migrations/013_create_functions.sql +19 -0
- package/src/migrations/014_create_rls_policies.sql +50 -0
- package/src/migrations/015_create_rpc_functions.sql +109 -0
- package/src/migrations/016_alter_source_ref.sql +2 -0
- package/src/migrations/017_keyword_search_rpc.sql +75 -0
- package/src/migrations/018_graph_traverse_rpc.sql +106 -0
- package/src/migrations/019_create_webhooks.sql +22 -0
- package/src/migrations/020_compound_search_rpc.sql +100 -0
- package/src/migrations/021_match_entities_rpc.sql +39 -0
- package/src/migrations/022_get_facts_for_entities_rpc.sql +123 -0
- package/src/migrations/023_add_event_date.sql +8 -0
- package/src/migrations/024_add_source_chunk.sql +3 -0
- package/src/migrations/025_update_edge_types_add_signing_key.sql +14 -0
- package/src/storage.d.ts +126 -0
- package/src/storage.d.ts.map +1 -0
- package/src/storage.js +990 -0
- package/src/storage.js.map +1 -0
- package/src/storage.ts +1180 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
-- Keyword search using PostgreSQL full-text search (tsvector/tsquery)
|
|
2
|
+
-- Returns facts matching the search query with ts_rank scoring.
|
|
3
|
+
|
|
4
|
+
CREATE OR REPLACE FUNCTION keyword_search_facts(
|
|
5
|
+
search_query TEXT,
|
|
6
|
+
match_tenant_id UUID,
|
|
7
|
+
match_scope TEXT,
|
|
8
|
+
match_scope_id TEXT,
|
|
9
|
+
match_count INT,
|
|
10
|
+
match_as_of TIMESTAMPTZ DEFAULT NULL
|
|
11
|
+
)
|
|
12
|
+
RETURNS TABLE (
|
|
13
|
+
id UUID,
|
|
14
|
+
tenant_id UUID,
|
|
15
|
+
scope TEXT,
|
|
16
|
+
scope_id TEXT,
|
|
17
|
+
session_id UUID,
|
|
18
|
+
content TEXT,
|
|
19
|
+
embedding_model TEXT,
|
|
20
|
+
embedding_dim INT,
|
|
21
|
+
version INT,
|
|
22
|
+
lineage_id UUID,
|
|
23
|
+
valid_from TIMESTAMPTZ,
|
|
24
|
+
valid_until TIMESTAMPTZ,
|
|
25
|
+
operation TEXT,
|
|
26
|
+
parent_id UUID,
|
|
27
|
+
importance FLOAT,
|
|
28
|
+
frequency INT,
|
|
29
|
+
last_accessed TIMESTAMPTZ,
|
|
30
|
+
decay_score FLOAT,
|
|
31
|
+
contradiction_status TEXT,
|
|
32
|
+
contradicts_id UUID,
|
|
33
|
+
source_type TEXT,
|
|
34
|
+
source_ref JSONB,
|
|
35
|
+
confidence FLOAT,
|
|
36
|
+
original_content TEXT,
|
|
37
|
+
extraction_id UUID,
|
|
38
|
+
extraction_tier TEXT,
|
|
39
|
+
modality TEXT,
|
|
40
|
+
tags TEXT[],
|
|
41
|
+
metadata JSONB,
|
|
42
|
+
created_at TIMESTAMPTZ,
|
|
43
|
+
rank_score FLOAT
|
|
44
|
+
)
|
|
45
|
+
LANGUAGE plpgsql
|
|
46
|
+
AS $$
|
|
47
|
+
BEGIN
|
|
48
|
+
RETURN QUERY
|
|
49
|
+
SELECT
|
|
50
|
+
f.id, f.tenant_id, f.scope, f.scope_id, f.session_id,
|
|
51
|
+
f.content, f.embedding_model, f.embedding_dim,
|
|
52
|
+
f.version, f.lineage_id, f.valid_from, f.valid_until,
|
|
53
|
+
f.operation, f.parent_id, f.importance, f.frequency,
|
|
54
|
+
f.last_accessed, f.decay_score, f.contradiction_status,
|
|
55
|
+
f.contradicts_id, f.source_type, f.source_ref, f.confidence,
|
|
56
|
+
f.original_content, f.extraction_id, f.extraction_tier,
|
|
57
|
+
f.modality, f.tags, f.metadata, f.created_at,
|
|
58
|
+
ts_rank(f.search_vector, plainto_tsquery('english', search_query)) AS rank_score
|
|
59
|
+
FROM facts f
|
|
60
|
+
WHERE f.tenant_id = match_tenant_id
|
|
61
|
+
AND f.scope = match_scope
|
|
62
|
+
AND f.scope_id = match_scope_id
|
|
63
|
+
AND (
|
|
64
|
+
CASE
|
|
65
|
+
WHEN match_as_of IS NOT NULL THEN
|
|
66
|
+
f.valid_from <= match_as_of AND (f.valid_until IS NULL OR f.valid_until > match_as_of)
|
|
67
|
+
ELSE
|
|
68
|
+
f.valid_until IS NULL
|
|
69
|
+
END
|
|
70
|
+
)
|
|
71
|
+
AND f.search_vector @@ plainto_tsquery('english', search_query)
|
|
72
|
+
ORDER BY rank_score DESC
|
|
73
|
+
LIMIT match_count;
|
|
74
|
+
END;
|
|
75
|
+
$$;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
-- Graph traversal using recursive CTE
|
|
2
|
+
-- Walks edges from seed entity IDs up to max_depth hops.
|
|
3
|
+
-- Returns entity and edge information for the traversal path.
|
|
4
|
+
|
|
5
|
+
CREATE OR REPLACE FUNCTION graph_traverse(
|
|
6
|
+
match_tenant_id UUID,
|
|
7
|
+
seed_entity_ids UUID[],
|
|
8
|
+
max_depth INT DEFAULT 3,
|
|
9
|
+
max_entities INT DEFAULT 200,
|
|
10
|
+
match_as_of TIMESTAMPTZ DEFAULT NULL
|
|
11
|
+
)
|
|
12
|
+
RETURNS TABLE (
|
|
13
|
+
entity_id UUID,
|
|
14
|
+
entity_name TEXT,
|
|
15
|
+
entity_type TEXT,
|
|
16
|
+
canonical_name TEXT,
|
|
17
|
+
properties JSONB,
|
|
18
|
+
hop_depth INT,
|
|
19
|
+
-- Edge info for the path
|
|
20
|
+
edge_id UUID,
|
|
21
|
+
edge_source_id UUID,
|
|
22
|
+
edge_target_id UUID,
|
|
23
|
+
edge_relation TEXT,
|
|
24
|
+
edge_type TEXT,
|
|
25
|
+
edge_weight FLOAT,
|
|
26
|
+
edge_valid_from TIMESTAMPTZ,
|
|
27
|
+
edge_valid_until TIMESTAMPTZ,
|
|
28
|
+
edge_confidence FLOAT
|
|
29
|
+
)
|
|
30
|
+
LANGUAGE plpgsql
|
|
31
|
+
AS $$
|
|
32
|
+
BEGIN
|
|
33
|
+
RETURN QUERY
|
|
34
|
+
WITH RECURSIVE traversal AS (
|
|
35
|
+
-- Base case: seed entities at depth 0
|
|
36
|
+
SELECT
|
|
37
|
+
e.id AS entity_id,
|
|
38
|
+
e.name AS entity_name,
|
|
39
|
+
e.entity_type,
|
|
40
|
+
e.canonical_name,
|
|
41
|
+
e.properties,
|
|
42
|
+
0 AS hop_depth,
|
|
43
|
+
NULL::UUID AS edge_id,
|
|
44
|
+
NULL::UUID AS edge_source_id,
|
|
45
|
+
NULL::UUID AS edge_target_id,
|
|
46
|
+
NULL::TEXT AS edge_relation,
|
|
47
|
+
NULL::TEXT AS edge_type,
|
|
48
|
+
NULL::FLOAT AS edge_weight,
|
|
49
|
+
NULL::TIMESTAMPTZ AS edge_valid_from,
|
|
50
|
+
NULL::TIMESTAMPTZ AS edge_valid_until,
|
|
51
|
+
NULL::FLOAT AS edge_confidence,
|
|
52
|
+
ARRAY[e.id] AS visited_ids
|
|
53
|
+
FROM entities e
|
|
54
|
+
WHERE e.id = ANY(seed_entity_ids)
|
|
55
|
+
AND e.tenant_id = match_tenant_id
|
|
56
|
+
|
|
57
|
+
UNION ALL
|
|
58
|
+
|
|
59
|
+
-- Recursive case: follow edges (with cycle detection via visited_ids)
|
|
60
|
+
SELECT
|
|
61
|
+
e2.id,
|
|
62
|
+
e2.name,
|
|
63
|
+
e2.entity_type,
|
|
64
|
+
e2.canonical_name,
|
|
65
|
+
e2.properties,
|
|
66
|
+
t.hop_depth + 1,
|
|
67
|
+
ed.id,
|
|
68
|
+
ed.source_id,
|
|
69
|
+
ed.target_id,
|
|
70
|
+
ed.relation,
|
|
71
|
+
ed.edge_type,
|
|
72
|
+
ed.weight,
|
|
73
|
+
ed.valid_from,
|
|
74
|
+
ed.valid_until,
|
|
75
|
+
ed.confidence,
|
|
76
|
+
t.visited_ids || e2.id
|
|
77
|
+
FROM traversal t
|
|
78
|
+
JOIN edges ed ON (ed.source_id = t.entity_id OR ed.target_id = t.entity_id)
|
|
79
|
+
AND ed.tenant_id = match_tenant_id
|
|
80
|
+
AND (
|
|
81
|
+
CASE
|
|
82
|
+
WHEN match_as_of IS NOT NULL THEN
|
|
83
|
+
ed.valid_from <= match_as_of AND (ed.valid_until IS NULL OR ed.valid_until > match_as_of)
|
|
84
|
+
ELSE
|
|
85
|
+
ed.valid_until IS NULL
|
|
86
|
+
END
|
|
87
|
+
)
|
|
88
|
+
JOIN entities e2 ON e2.id = CASE
|
|
89
|
+
WHEN ed.source_id = t.entity_id THEN ed.target_id
|
|
90
|
+
ELSE ed.source_id
|
|
91
|
+
END
|
|
92
|
+
AND e2.tenant_id = match_tenant_id
|
|
93
|
+
WHERE t.hop_depth < max_depth
|
|
94
|
+
AND e2.id != ALL(t.visited_ids)
|
|
95
|
+
)
|
|
96
|
+
SELECT
|
|
97
|
+
traversal.entity_id, traversal.entity_name, traversal.entity_type,
|
|
98
|
+
traversal.canonical_name, traversal.properties,
|
|
99
|
+
traversal.hop_depth, traversal.edge_id, traversal.edge_source_id,
|
|
100
|
+
traversal.edge_target_id, traversal.edge_relation,
|
|
101
|
+
traversal.edge_type, traversal.edge_weight, traversal.edge_valid_from,
|
|
102
|
+
traversal.edge_valid_until, traversal.edge_confidence
|
|
103
|
+
FROM traversal
|
|
104
|
+
LIMIT max_entities;
|
|
105
|
+
END;
|
|
106
|
+
$$;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- =============================================================================
|
|
2
|
+
-- 019: Create webhooks table
|
|
3
|
+
-- =============================================================================
|
|
4
|
+
|
|
5
|
+
CREATE TABLE webhooks (
|
|
6
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
7
|
+
tenant_id UUID NOT NULL REFERENCES tenants(id),
|
|
8
|
+
url TEXT NOT NULL,
|
|
9
|
+
events TEXT[] NOT NULL,
|
|
10
|
+
secret_hash TEXT NOT NULL,
|
|
11
|
+
active BOOLEAN NOT NULL DEFAULT TRUE,
|
|
12
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE INDEX idx_webhooks_tenant ON webhooks(tenant_id);
|
|
16
|
+
CREATE INDEX idx_webhooks_active ON webhooks(tenant_id, active) WHERE active = TRUE;
|
|
17
|
+
|
|
18
|
+
-- RLS
|
|
19
|
+
ALTER TABLE webhooks ENABLE ROW LEVEL SECURITY;
|
|
20
|
+
|
|
21
|
+
CREATE POLICY tenant_isolation ON webhooks
|
|
22
|
+
USING (tenant_id = current_setting('app.current_tenant_id')::uuid);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
-- Compound search: vector + keyword in ONE database round-trip
|
|
2
|
+
-- This eliminates 2 separate RPC calls
|
|
3
|
+
|
|
4
|
+
CREATE OR REPLACE FUNCTION steno_search(
|
|
5
|
+
query_embedding TEXT,
|
|
6
|
+
search_query TEXT,
|
|
7
|
+
match_tenant_id UUID,
|
|
8
|
+
match_scope TEXT,
|
|
9
|
+
match_scope_id TEXT,
|
|
10
|
+
match_count INT DEFAULT 20,
|
|
11
|
+
min_similarity FLOAT DEFAULT 0.0
|
|
12
|
+
)
|
|
13
|
+
RETURNS TABLE (
|
|
14
|
+
source TEXT,
|
|
15
|
+
id UUID,
|
|
16
|
+
tenant_id UUID,
|
|
17
|
+
scope TEXT,
|
|
18
|
+
scope_id TEXT,
|
|
19
|
+
session_id UUID,
|
|
20
|
+
content TEXT,
|
|
21
|
+
embedding_model TEXT,
|
|
22
|
+
embedding_dim INT,
|
|
23
|
+
version INT,
|
|
24
|
+
lineage_id UUID,
|
|
25
|
+
valid_from TIMESTAMPTZ,
|
|
26
|
+
valid_until TIMESTAMPTZ,
|
|
27
|
+
operation TEXT,
|
|
28
|
+
parent_id UUID,
|
|
29
|
+
importance NUMERIC,
|
|
30
|
+
frequency INT,
|
|
31
|
+
last_accessed TIMESTAMPTZ,
|
|
32
|
+
decay_score NUMERIC,
|
|
33
|
+
contradiction_status TEXT,
|
|
34
|
+
contradicts_id UUID,
|
|
35
|
+
source_type TEXT,
|
|
36
|
+
source_ref JSONB,
|
|
37
|
+
confidence NUMERIC,
|
|
38
|
+
original_content TEXT,
|
|
39
|
+
extraction_id UUID,
|
|
40
|
+
extraction_tier TEXT,
|
|
41
|
+
modality TEXT,
|
|
42
|
+
tags TEXT[],
|
|
43
|
+
metadata JSONB,
|
|
44
|
+
created_at TIMESTAMPTZ,
|
|
45
|
+
relevance_score FLOAT
|
|
46
|
+
)
|
|
47
|
+
LANGUAGE plpgsql
|
|
48
|
+
AS $$
|
|
49
|
+
BEGIN
|
|
50
|
+
RETURN QUERY
|
|
51
|
+
|
|
52
|
+
-- Vector search results (exclude raw chunks — only search atomic extracted facts)
|
|
53
|
+
(SELECT
|
|
54
|
+
'vector'::TEXT AS source,
|
|
55
|
+
f.id, f.tenant_id, f.scope, f.scope_id, f.session_id,
|
|
56
|
+
f.content, f.embedding_model, f.embedding_dim,
|
|
57
|
+
f.version, f.lineage_id, f.valid_from, f.valid_until,
|
|
58
|
+
f.operation, f.parent_id, f.importance, f.frequency,
|
|
59
|
+
f.last_accessed, f.decay_score, f.contradiction_status,
|
|
60
|
+
f.contradicts_id, f.source_type, f.source_ref, f.confidence,
|
|
61
|
+
f.original_content, f.extraction_id, f.extraction_tier,
|
|
62
|
+
f.modality, f.tags, f.metadata, f.created_at,
|
|
63
|
+
(1 - (f.embedding <=> query_embedding::vector))::float AS relevance_score
|
|
64
|
+
FROM facts f
|
|
65
|
+
WHERE f.tenant_id = match_tenant_id
|
|
66
|
+
AND f.scope = match_scope
|
|
67
|
+
AND f.scope_id = match_scope_id
|
|
68
|
+
AND f.valid_until IS NULL
|
|
69
|
+
AND f.source_type != 'api'
|
|
70
|
+
AND NOT ('raw_chunk' = ANY(f.tags))
|
|
71
|
+
AND (1 - (f.embedding <=> query_embedding::vector)) >= min_similarity
|
|
72
|
+
ORDER BY f.embedding <=> query_embedding::vector
|
|
73
|
+
LIMIT match_count)
|
|
74
|
+
|
|
75
|
+
UNION ALL
|
|
76
|
+
|
|
77
|
+
-- Keyword search results (FTS, exclude raw chunks)
|
|
78
|
+
(SELECT
|
|
79
|
+
'keyword'::TEXT AS source,
|
|
80
|
+
f.id, f.tenant_id, f.scope, f.scope_id, f.session_id,
|
|
81
|
+
f.content, f.embedding_model, f.embedding_dim,
|
|
82
|
+
f.version, f.lineage_id, f.valid_from, f.valid_until,
|
|
83
|
+
f.operation, f.parent_id, f.importance, f.frequency,
|
|
84
|
+
f.last_accessed, f.decay_score, f.contradiction_status,
|
|
85
|
+
f.contradicts_id, f.source_type, f.source_ref, f.confidence,
|
|
86
|
+
f.original_content, f.extraction_id, f.extraction_tier,
|
|
87
|
+
f.modality, f.tags, f.metadata, f.created_at,
|
|
88
|
+
ts_rank(f.search_vector, to_tsquery('english', search_query))::float AS relevance_score
|
|
89
|
+
FROM facts f
|
|
90
|
+
WHERE f.tenant_id = match_tenant_id
|
|
91
|
+
AND f.scope = match_scope
|
|
92
|
+
AND f.scope_id = match_scope_id
|
|
93
|
+
AND f.valid_until IS NULL
|
|
94
|
+
AND f.source_type != 'api'
|
|
95
|
+
AND NOT ('raw_chunk' = ANY(f.tags))
|
|
96
|
+
AND f.search_vector @@ to_tsquery('english', search_query)
|
|
97
|
+
ORDER BY relevance_score DESC
|
|
98
|
+
LIMIT match_count);
|
|
99
|
+
END;
|
|
100
|
+
$$;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- Vector similarity search on entities table
|
|
2
|
+
-- Used by graph seeding to find relevant entities for a query
|
|
3
|
+
CREATE OR REPLACE FUNCTION match_entities(
|
|
4
|
+
query_embedding TEXT,
|
|
5
|
+
match_tenant_id UUID,
|
|
6
|
+
match_count INT DEFAULT 10,
|
|
7
|
+
min_similarity FLOAT DEFAULT 0.3
|
|
8
|
+
)
|
|
9
|
+
RETURNS TABLE (
|
|
10
|
+
id UUID,
|
|
11
|
+
tenant_id UUID,
|
|
12
|
+
name TEXT,
|
|
13
|
+
entity_type TEXT,
|
|
14
|
+
canonical_name TEXT,
|
|
15
|
+
properties JSONB,
|
|
16
|
+
embedding_model TEXT,
|
|
17
|
+
embedding_dim INT,
|
|
18
|
+
merge_target_id UUID,
|
|
19
|
+
created_at TIMESTAMPTZ,
|
|
20
|
+
updated_at TIMESTAMPTZ,
|
|
21
|
+
similarity FLOAT
|
|
22
|
+
)
|
|
23
|
+
LANGUAGE plpgsql
|
|
24
|
+
AS $$
|
|
25
|
+
BEGIN
|
|
26
|
+
RETURN QUERY
|
|
27
|
+
SELECT
|
|
28
|
+
e.id, e.tenant_id, e.name, e.entity_type, e.canonical_name,
|
|
29
|
+
e.properties, e.embedding_model, e.embedding_dim,
|
|
30
|
+
e.merge_target_id, e.created_at, e.updated_at,
|
|
31
|
+
(1 - (e.embedding <=> query_embedding::vector))::float AS similarity
|
|
32
|
+
FROM entities e
|
|
33
|
+
WHERE e.tenant_id = match_tenant_id
|
|
34
|
+
AND e.embedding IS NOT NULL
|
|
35
|
+
AND (1 - (e.embedding <=> query_embedding::vector)) >= min_similarity
|
|
36
|
+
ORDER BY e.embedding <=> query_embedding::vector
|
|
37
|
+
LIMIT match_count;
|
|
38
|
+
END;
|
|
39
|
+
$$;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
-- Retrieve facts linked to a set of entities via the fact_entities junction table.
|
|
2
|
+
-- Used by graph traversal to hydrate facts for discovered entities.
|
|
3
|
+
CREATE OR REPLACE FUNCTION get_facts_for_entities(
|
|
4
|
+
match_tenant_id UUID,
|
|
5
|
+
entity_ids UUID[],
|
|
6
|
+
per_entity_limit INT DEFAULT 20
|
|
7
|
+
)
|
|
8
|
+
RETURNS TABLE (
|
|
9
|
+
entity_id UUID,
|
|
10
|
+
fact_id UUID,
|
|
11
|
+
tenant_id UUID,
|
|
12
|
+
scope TEXT,
|
|
13
|
+
scope_id TEXT,
|
|
14
|
+
session_id UUID,
|
|
15
|
+
content TEXT,
|
|
16
|
+
embedding_model TEXT,
|
|
17
|
+
embedding_dim INTEGER,
|
|
18
|
+
version INTEGER,
|
|
19
|
+
lineage_id UUID,
|
|
20
|
+
valid_from TIMESTAMPTZ,
|
|
21
|
+
valid_until TIMESTAMPTZ,
|
|
22
|
+
operation TEXT,
|
|
23
|
+
parent_id UUID,
|
|
24
|
+
importance NUMERIC,
|
|
25
|
+
frequency INTEGER,
|
|
26
|
+
last_accessed TIMESTAMPTZ,
|
|
27
|
+
decay_score NUMERIC,
|
|
28
|
+
contradiction_status TEXT,
|
|
29
|
+
contradicts_id UUID,
|
|
30
|
+
source_type TEXT,
|
|
31
|
+
source_ref JSONB,
|
|
32
|
+
confidence NUMERIC,
|
|
33
|
+
original_content TEXT,
|
|
34
|
+
extraction_id UUID,
|
|
35
|
+
extraction_tier TEXT,
|
|
36
|
+
modality TEXT,
|
|
37
|
+
tags TEXT[],
|
|
38
|
+
metadata JSONB,
|
|
39
|
+
created_at TIMESTAMPTZ
|
|
40
|
+
)
|
|
41
|
+
LANGUAGE plpgsql
|
|
42
|
+
AS $$
|
|
43
|
+
BEGIN
|
|
44
|
+
RETURN QUERY
|
|
45
|
+
SELECT
|
|
46
|
+
ranked.entity_id,
|
|
47
|
+
ranked.fact_id,
|
|
48
|
+
ranked.tenant_id,
|
|
49
|
+
ranked.scope,
|
|
50
|
+
ranked.scope_id,
|
|
51
|
+
ranked.session_id,
|
|
52
|
+
ranked.content,
|
|
53
|
+
ranked.embedding_model,
|
|
54
|
+
ranked.embedding_dim,
|
|
55
|
+
ranked.version,
|
|
56
|
+
ranked.lineage_id,
|
|
57
|
+
ranked.valid_from,
|
|
58
|
+
ranked.valid_until,
|
|
59
|
+
ranked.operation,
|
|
60
|
+
ranked.parent_id,
|
|
61
|
+
ranked.importance,
|
|
62
|
+
ranked.frequency,
|
|
63
|
+
ranked.last_accessed,
|
|
64
|
+
ranked.decay_score,
|
|
65
|
+
ranked.contradiction_status,
|
|
66
|
+
ranked.contradicts_id,
|
|
67
|
+
ranked.source_type,
|
|
68
|
+
ranked.source_ref,
|
|
69
|
+
ranked.confidence,
|
|
70
|
+
ranked.original_content,
|
|
71
|
+
ranked.extraction_id,
|
|
72
|
+
ranked.extraction_tier,
|
|
73
|
+
ranked.modality,
|
|
74
|
+
ranked.tags,
|
|
75
|
+
ranked.metadata,
|
|
76
|
+
ranked.created_at
|
|
77
|
+
FROM (
|
|
78
|
+
SELECT
|
|
79
|
+
fe.entity_id,
|
|
80
|
+
f.id AS fact_id,
|
|
81
|
+
f.tenant_id,
|
|
82
|
+
f.scope,
|
|
83
|
+
f.scope_id,
|
|
84
|
+
f.session_id,
|
|
85
|
+
f.content,
|
|
86
|
+
f.embedding_model,
|
|
87
|
+
f.embedding_dim,
|
|
88
|
+
f.version,
|
|
89
|
+
f.lineage_id,
|
|
90
|
+
f.valid_from,
|
|
91
|
+
f.valid_until,
|
|
92
|
+
f.operation,
|
|
93
|
+
f.parent_id,
|
|
94
|
+
f.importance,
|
|
95
|
+
f.frequency,
|
|
96
|
+
f.last_accessed,
|
|
97
|
+
f.decay_score,
|
|
98
|
+
f.contradiction_status,
|
|
99
|
+
f.contradicts_id,
|
|
100
|
+
f.source_type,
|
|
101
|
+
f.source_ref,
|
|
102
|
+
f.confidence,
|
|
103
|
+
f.original_content,
|
|
104
|
+
f.extraction_id,
|
|
105
|
+
f.extraction_tier,
|
|
106
|
+
f.modality,
|
|
107
|
+
f.tags,
|
|
108
|
+
f.metadata,
|
|
109
|
+
f.created_at,
|
|
110
|
+
ROW_NUMBER() OVER (
|
|
111
|
+
PARTITION BY fe.entity_id
|
|
112
|
+
ORDER BY f.importance DESC, f.created_at DESC
|
|
113
|
+
) AS rn
|
|
114
|
+
FROM fact_entities fe
|
|
115
|
+
JOIN facts f ON f.id = fe.fact_id
|
|
116
|
+
WHERE fe.entity_id = ANY(entity_ids)
|
|
117
|
+
AND f.tenant_id = match_tenant_id
|
|
118
|
+
AND f.valid_until IS NULL
|
|
119
|
+
AND NOT ('raw_chunk' = ANY(f.tags))
|
|
120
|
+
) ranked
|
|
121
|
+
WHERE ranked.rn <= per_entity_limit;
|
|
122
|
+
END;
|
|
123
|
+
$$;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Dual timestamps: document_date (when conversation happened) + event_date (when the event occurred)
|
|
2
|
+
-- Like Hydra DB's temporal grounding for better temporal reasoning.
|
|
3
|
+
ALTER TABLE facts ADD COLUMN IF NOT EXISTS event_date TIMESTAMPTZ;
|
|
4
|
+
ALTER TABLE facts ADD COLUMN IF NOT EXISTS document_date TIMESTAMPTZ;
|
|
5
|
+
|
|
6
|
+
-- Index for temporal queries
|
|
7
|
+
CREATE INDEX IF NOT EXISTS idx_facts_event_date ON facts (event_date) WHERE event_date IS NOT NULL;
|
|
8
|
+
CREATE INDEX IF NOT EXISTS idx_facts_document_date ON facts (document_date) WHERE document_date IS NOT NULL;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Update edge_type constraint to include new relational versioning types
|
|
2
|
+
-- and fix legacy types (semantic, contradicts, supports → contradictory)
|
|
3
|
+
ALTER TABLE edges DROP CONSTRAINT IF EXISTS edges_edge_type_check;
|
|
4
|
+
ALTER TABLE edges ADD CONSTRAINT edges_edge_type_check CHECK (
|
|
5
|
+
edge_type = ANY (ARRAY[
|
|
6
|
+
'associative', 'causal', 'temporal', 'contradictory', 'hierarchical',
|
|
7
|
+
'updates', 'extends', 'derives',
|
|
8
|
+
-- Legacy types kept for backward compatibility
|
|
9
|
+
'semantic', 'contradicts', 'supports'
|
|
10
|
+
])
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
-- Add missing signing_key column to webhooks
|
|
14
|
+
ALTER TABLE webhooks ADD COLUMN IF NOT EXISTS signing_key TEXT;
|
package/src/storage.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
import type { StorageAdapter, PaginationOptions, PaginatedResult, VectorSearchOptions, VectorSearchResult, KeywordSearchOptions, KeywordSearchResult, CompoundSearchOptions, CompoundSearchResult, GraphTraversalOptions, GraphTraversalResult } from '@steno-ai/engine';
|
|
3
|
+
import type { Fact, CreateFact, Entity, CreateEntity, Edge, CreateEdge, Trigger, CreateTrigger, MemoryAccess, CreateMemoryAccess, Extraction, CreateExtraction, Session, CreateSession, Tenant, CreateTenant, ApiKey, CreateApiKey, UsageRecord, Webhook, CreateWebhook } from '@steno-ai/engine';
|
|
4
|
+
/**
|
|
5
|
+
* Convert all top-level keys of a plain object from camelCase to snake_case.
|
|
6
|
+
* Nested objects (metadata, config, properties, condition) are preserved as-is.
|
|
7
|
+
* Arrays and null values are preserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toSnakeCase(obj: Record<string, unknown>): Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Convert all top-level keys of a plain object from snake_case to camelCase.
|
|
12
|
+
* Nested objects (metadata, config, properties, condition) are preserved as-is.
|
|
13
|
+
* Arrays and null values are preserved.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toCamelCase(obj: Record<string, unknown>): Record<string, unknown>;
|
|
16
|
+
export declare class SupabaseStorageAdapter implements StorageAdapter {
|
|
17
|
+
private client;
|
|
18
|
+
constructor(client: SupabaseClient);
|
|
19
|
+
ping(): Promise<boolean>;
|
|
20
|
+
createTenant(tenant: CreateTenant & {
|
|
21
|
+
id: string;
|
|
22
|
+
}): Promise<Tenant>;
|
|
23
|
+
getTenant(id: string): Promise<Tenant | null>;
|
|
24
|
+
getTenantBySlug(slug: string): Promise<Tenant | null>;
|
|
25
|
+
updateTenant(id: string, updates: Partial<Tenant>): Promise<Tenant>;
|
|
26
|
+
createApiKey(apiKey: CreateApiKey & {
|
|
27
|
+
id: string;
|
|
28
|
+
keyHash: string;
|
|
29
|
+
keyPrefix: string;
|
|
30
|
+
}): Promise<ApiKey>;
|
|
31
|
+
getApiKeyByPrefix(prefix: string): Promise<ApiKey | null>;
|
|
32
|
+
getApiKeysForTenant(tenantId: string): Promise<ApiKey[]>;
|
|
33
|
+
revokeApiKey(tenantId: string, id: string): Promise<void>;
|
|
34
|
+
updateApiKeyLastUsed(id: string): Promise<void>;
|
|
35
|
+
createExtraction(extraction: CreateExtraction & {
|
|
36
|
+
id: string;
|
|
37
|
+
}): Promise<Extraction>;
|
|
38
|
+
getExtraction(tenantId: string, id: string): Promise<Extraction | null>;
|
|
39
|
+
updateExtraction(tenantId: string, id: string, updates: Partial<Extraction>): Promise<Extraction>;
|
|
40
|
+
getExtractionByHash(tenantId: string, inputHash: string): Promise<Extraction | null>;
|
|
41
|
+
getExtractionsByTenant(tenantId: string, options: PaginationOptions): Promise<PaginatedResult<Extraction>>;
|
|
42
|
+
createFact(fact: CreateFact & {
|
|
43
|
+
id: string;
|
|
44
|
+
lineageId: string;
|
|
45
|
+
embeddingModel: string;
|
|
46
|
+
embeddingDim: number;
|
|
47
|
+
embedding?: number[];
|
|
48
|
+
}): Promise<Fact>;
|
|
49
|
+
getFact(tenantId: string, id: string): Promise<Fact | null>;
|
|
50
|
+
getFactsByIds(tenantId: string, ids: string[]): Promise<Fact[]>;
|
|
51
|
+
getFactsByLineage(tenantId: string, lineageId: string): Promise<Fact[]>;
|
|
52
|
+
invalidateFact(tenantId: string, id: string): Promise<void>;
|
|
53
|
+
createEntity(entity: CreateEntity & {
|
|
54
|
+
id: string;
|
|
55
|
+
embedding?: number[];
|
|
56
|
+
embeddingModel?: string;
|
|
57
|
+
embeddingDim?: number;
|
|
58
|
+
}): Promise<Entity>;
|
|
59
|
+
getEntity(tenantId: string, id: string): Promise<Entity | null>;
|
|
60
|
+
findEntityByCanonicalName(tenantId: string, canonicalName: string, entityType: string): Promise<Entity | null>;
|
|
61
|
+
findEntitiesByEmbedding(tenantId: string, embedding: number[], limit: number, minSimilarity?: number): Promise<Array<{
|
|
62
|
+
entity: Entity;
|
|
63
|
+
similarity: number;
|
|
64
|
+
}>>;
|
|
65
|
+
linkFactEntity(factId: string, entityId: string, role: string): Promise<void>;
|
|
66
|
+
createEdge(edge: CreateEdge & {
|
|
67
|
+
id: string;
|
|
68
|
+
}): Promise<Edge>;
|
|
69
|
+
vectorSearch(options: VectorSearchOptions): Promise<VectorSearchResult[]>;
|
|
70
|
+
incrementUsage(tenantId: string, tokens: number, queries: number, extractions: number, costUsd: number): Promise<void>;
|
|
71
|
+
getUsage(tenantId: string, periodStart: Date): Promise<UsageRecord | null>;
|
|
72
|
+
getCurrentUsage(tenantId: string): Promise<UsageRecord | null>;
|
|
73
|
+
getFactsByScope(tenantId: string, scope: string, scopeId: string, options: PaginationOptions): Promise<PaginatedResult<Fact>>;
|
|
74
|
+
purgeFacts(tenantId: string, scope: string, scopeId: string): Promise<number>;
|
|
75
|
+
updateDecayScores(tenantId: string, facts: Array<{
|
|
76
|
+
id: string;
|
|
77
|
+
decayScore: number;
|
|
78
|
+
lastAccessed?: Date;
|
|
79
|
+
frequency?: number;
|
|
80
|
+
importance?: number;
|
|
81
|
+
}>): Promise<void>;
|
|
82
|
+
keywordSearch(options: KeywordSearchOptions): Promise<KeywordSearchResult[]>;
|
|
83
|
+
compoundSearch(options: CompoundSearchOptions): Promise<CompoundSearchResult[]>;
|
|
84
|
+
getEntitiesForTenant(tenantId: string, options: PaginationOptions): Promise<PaginatedResult<Entity>>;
|
|
85
|
+
getEntitiesForFact(factId: string): Promise<Entity[]>;
|
|
86
|
+
getFactsForEntity(tenantId: string, entityId: string, options: PaginationOptions): Promise<PaginatedResult<Fact>>;
|
|
87
|
+
getFactsForEntities(tenantId: string, entityIds: string[], perEntityLimit: number): Promise<Array<{
|
|
88
|
+
entityId: string;
|
|
89
|
+
fact: Fact;
|
|
90
|
+
}>>;
|
|
91
|
+
getEdgesForEntity(tenantId: string, entityId: string): Promise<Edge[]>;
|
|
92
|
+
graphTraversal(options: GraphTraversalOptions): Promise<GraphTraversalResult>;
|
|
93
|
+
createTrigger(trigger: CreateTrigger & {
|
|
94
|
+
id: string;
|
|
95
|
+
}): Promise<Trigger>;
|
|
96
|
+
getTrigger(tenantId: string, id: string): Promise<Trigger | null>;
|
|
97
|
+
getActiveTriggers(tenantId: string, scope: string, scopeId: string): Promise<Trigger[]>;
|
|
98
|
+
updateTrigger(tenantId: string, id: string, updates: Partial<Trigger>): Promise<Trigger>;
|
|
99
|
+
deleteTrigger(tenantId: string, id: string): Promise<void>;
|
|
100
|
+
incrementTriggerFired(tenantId: string, id: string): Promise<void>;
|
|
101
|
+
createMemoryAccess(access: CreateMemoryAccess & {
|
|
102
|
+
id: string;
|
|
103
|
+
}): Promise<MemoryAccess>;
|
|
104
|
+
updateFeedback(tenantId: string, factId: string, feedback: {
|
|
105
|
+
wasUseful: boolean;
|
|
106
|
+
feedbackType: string;
|
|
107
|
+
feedbackDetail?: string;
|
|
108
|
+
wasCorrected?: boolean;
|
|
109
|
+
}): Promise<void>;
|
|
110
|
+
createSession(session: CreateSession & {
|
|
111
|
+
id: string;
|
|
112
|
+
}): Promise<Session>;
|
|
113
|
+
getSession(tenantId: string, id: string): Promise<Session | null>;
|
|
114
|
+
endSession(tenantId: string, id: string, summary?: string, topics?: string[]): Promise<Session>;
|
|
115
|
+
getSessionsByScope(tenantId: string, scope: string, scopeId: string, options: PaginationOptions): Promise<PaginatedResult<Session>>;
|
|
116
|
+
createWebhook(webhook: CreateWebhook & {
|
|
117
|
+
id: string;
|
|
118
|
+
secretHash: string;
|
|
119
|
+
signingKey: string;
|
|
120
|
+
}): Promise<Webhook>;
|
|
121
|
+
getWebhook(tenantId: string, id: string): Promise<Webhook | null>;
|
|
122
|
+
getWebhooksForTenant(tenantId: string): Promise<Webhook[]>;
|
|
123
|
+
getWebhooksByEvent(tenantId: string, event: string): Promise<Webhook[]>;
|
|
124
|
+
deleteWebhook(tenantId: string, id: string): Promise<void>;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,IAAI,EACJ,UAAU,EACV,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,MAAM,EACN,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,WAAW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