@twelvehart/supermemory-runtime 1.0.0-next.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/.env.example +57 -0
- package/README.md +374 -0
- package/dist/index.js +189 -0
- package/dist/mcp/index.js +1132 -0
- package/docker-compose.prod.yml +91 -0
- package/docker-compose.yml +358 -0
- package/drizzle/0000_dapper_the_professor.sql +159 -0
- package/drizzle/0001_api_keys.sql +51 -0
- package/drizzle/meta/0000_snapshot.json +1532 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +20 -0
- package/package.json +114 -0
- package/scripts/add-extraction-job.ts +122 -0
- package/scripts/benchmark-pgvector.ts +122 -0
- package/scripts/bootstrap.sh +209 -0
- package/scripts/check-runtime-pack.ts +111 -0
- package/scripts/claude-mcp-config.ts +336 -0
- package/scripts/docker-entrypoint.sh +183 -0
- package/scripts/doctor.ts +377 -0
- package/scripts/init-db.sql +33 -0
- package/scripts/install.sh +1110 -0
- package/scripts/mcp-setup.ts +271 -0
- package/scripts/migrations/001_create_pgvector_extension.sql +31 -0
- package/scripts/migrations/002_create_memory_embeddings_table.sql +75 -0
- package/scripts/migrations/003_create_hnsw_index.sql +94 -0
- package/scripts/migrations/004_create_memory_embeddings_standalone.sql +70 -0
- package/scripts/migrations/005_create_chunks_table.sql +95 -0
- package/scripts/migrations/006_create_processing_queue.sql +45 -0
- package/scripts/migrations/generate_test_data.sql +42 -0
- package/scripts/migrations/phase1_comprehensive_test.sql +204 -0
- package/scripts/migrations/run_migrations.sh +286 -0
- package/scripts/migrations/test_hnsw_index.sql +255 -0
- package/scripts/pre-commit-secrets +282 -0
- package/scripts/run-extraction-worker.ts +46 -0
- package/scripts/run-phase1-tests.sh +291 -0
- package/scripts/setup.ts +222 -0
- package/scripts/smoke-install.sh +12 -0
- package/scripts/test-health-endpoint.sh +328 -0
- package/src/api/index.ts +2 -0
- package/src/api/middleware/auth.ts +80 -0
- package/src/api/middleware/csrf.ts +308 -0
- package/src/api/middleware/errorHandler.ts +166 -0
- package/src/api/middleware/rateLimit.ts +360 -0
- package/src/api/middleware/validation.ts +514 -0
- package/src/api/routes/documents.ts +286 -0
- package/src/api/routes/profiles.ts +237 -0
- package/src/api/routes/search.ts +71 -0
- package/src/api/stores/index.ts +58 -0
- package/src/config/bootstrap-env.ts +3 -0
- package/src/config/env.ts +71 -0
- package/src/config/feature-flags.ts +25 -0
- package/src/config/index.ts +140 -0
- package/src/config/secrets.config.ts +291 -0
- package/src/db/client.ts +92 -0
- package/src/db/index.ts +73 -0
- package/src/db/postgres.ts +72 -0
- package/src/db/schema/chunks.schema.ts +31 -0
- package/src/db/schema/containers.schema.ts +46 -0
- package/src/db/schema/documents.schema.ts +49 -0
- package/src/db/schema/embeddings.schema.ts +32 -0
- package/src/db/schema/index.ts +11 -0
- package/src/db/schema/memories.schema.ts +72 -0
- package/src/db/schema/profiles.schema.ts +34 -0
- package/src/db/schema/queue.schema.ts +59 -0
- package/src/db/schema/relationships.schema.ts +42 -0
- package/src/db/schema.ts +223 -0
- package/src/db/worker-connection.ts +47 -0
- package/src/index.ts +235 -0
- package/src/mcp/CLAUDE.md +1 -0
- package/src/mcp/index.ts +1380 -0
- package/src/mcp/legacyState.ts +22 -0
- package/src/mcp/rateLimit.ts +358 -0
- package/src/mcp/resources.ts +309 -0
- package/src/mcp/results.ts +104 -0
- package/src/mcp/tools.ts +401 -0
- package/src/queues/config.ts +119 -0
- package/src/queues/index.ts +289 -0
- package/src/sdk/client.ts +225 -0
- package/src/sdk/errors.ts +266 -0
- package/src/sdk/http.ts +560 -0
- package/src/sdk/index.ts +244 -0
- package/src/sdk/resources/base.ts +65 -0
- package/src/sdk/resources/connections.ts +204 -0
- package/src/sdk/resources/documents.ts +163 -0
- package/src/sdk/resources/index.ts +10 -0
- package/src/sdk/resources/memories.ts +150 -0
- package/src/sdk/resources/search.ts +60 -0
- package/src/sdk/resources/settings.ts +36 -0
- package/src/sdk/types.ts +674 -0
- package/src/services/chunking/index.ts +451 -0
- package/src/services/chunking.service.ts +650 -0
- package/src/services/csrf.service.ts +252 -0
- package/src/services/documents.repository.ts +219 -0
- package/src/services/documents.service.ts +191 -0
- package/src/services/embedding.service.ts +404 -0
- package/src/services/extraction.service.ts +300 -0
- package/src/services/extractors/code.extractor.ts +451 -0
- package/src/services/extractors/index.ts +9 -0
- package/src/services/extractors/markdown.extractor.ts +461 -0
- package/src/services/extractors/pdf.extractor.ts +315 -0
- package/src/services/extractors/text.extractor.ts +118 -0
- package/src/services/extractors/url.extractor.ts +243 -0
- package/src/services/index.ts +235 -0
- package/src/services/ingestion.service.ts +177 -0
- package/src/services/llm/anthropic.ts +400 -0
- package/src/services/llm/base.ts +460 -0
- package/src/services/llm/contradiction-detector.service.ts +526 -0
- package/src/services/llm/heuristics.ts +148 -0
- package/src/services/llm/index.ts +309 -0
- package/src/services/llm/memory-classifier.service.ts +383 -0
- package/src/services/llm/memory-extension-detector.service.ts +523 -0
- package/src/services/llm/mock.ts +470 -0
- package/src/services/llm/openai.ts +398 -0
- package/src/services/llm/prompts.ts +438 -0
- package/src/services/llm/types.ts +373 -0
- package/src/services/memory.repository.ts +1769 -0
- package/src/services/memory.service.ts +1338 -0
- package/src/services/memory.types.ts +234 -0
- package/src/services/persistence/index.ts +295 -0
- package/src/services/pipeline.service.ts +509 -0
- package/src/services/profile.repository.ts +436 -0
- package/src/services/profile.service.ts +560 -0
- package/src/services/profile.types.ts +270 -0
- package/src/services/relationships/detector.ts +1128 -0
- package/src/services/relationships/index.ts +268 -0
- package/src/services/relationships/memory-integration.ts +459 -0
- package/src/services/relationships/strategies.ts +132 -0
- package/src/services/relationships/types.ts +370 -0
- package/src/services/search.service.ts +761 -0
- package/src/services/search.types.ts +220 -0
- package/src/services/secrets.service.ts +384 -0
- package/src/services/vectorstore/base.ts +327 -0
- package/src/services/vectorstore/index.ts +444 -0
- package/src/services/vectorstore/memory.ts +286 -0
- package/src/services/vectorstore/migration.ts +295 -0
- package/src/services/vectorstore/mock.ts +403 -0
- package/src/services/vectorstore/pgvector.ts +695 -0
- package/src/services/vectorstore/types.ts +247 -0
- package/src/startup.ts +389 -0
- package/src/types/api.types.ts +193 -0
- package/src/types/document.types.ts +103 -0
- package/src/types/index.ts +241 -0
- package/src/types/profile.base.ts +133 -0
- package/src/utils/errors.ts +447 -0
- package/src/utils/id.ts +15 -0
- package/src/utils/index.ts +101 -0
- package/src/utils/logger.ts +313 -0
- package/src/utils/sanitization.ts +501 -0
- package/src/utils/secret-validation.ts +273 -0
- package/src/utils/synonyms.ts +188 -0
- package/src/utils/validation.ts +581 -0
- package/src/workers/chunking.worker.ts +242 -0
- package/src/workers/embedding.worker.ts +358 -0
- package/src/workers/extraction.worker.ts +346 -0
- package/src/workers/indexing.worker.ts +505 -0
- package/tsconfig.json +38 -0
|
@@ -0,0 +1,1532 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "e744b117-317c-46ba-bb5e-d4369c7c647c",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.container_tags": {
|
|
8
|
+
"name": "container_tags",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "uuid",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true,
|
|
16
|
+
"default": "gen_random_uuid()"
|
|
17
|
+
},
|
|
18
|
+
"tag": {
|
|
19
|
+
"name": "tag",
|
|
20
|
+
"type": "varchar(255)",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"parent_tag": {
|
|
25
|
+
"name": "parent_tag",
|
|
26
|
+
"type": "varchar(255)",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false
|
|
29
|
+
},
|
|
30
|
+
"display_name": {
|
|
31
|
+
"name": "display_name",
|
|
32
|
+
"type": "varchar(255)",
|
|
33
|
+
"primaryKey": false,
|
|
34
|
+
"notNull": false
|
|
35
|
+
},
|
|
36
|
+
"description": {
|
|
37
|
+
"name": "description",
|
|
38
|
+
"type": "text",
|
|
39
|
+
"primaryKey": false,
|
|
40
|
+
"notNull": false
|
|
41
|
+
},
|
|
42
|
+
"metadata": {
|
|
43
|
+
"name": "metadata",
|
|
44
|
+
"type": "jsonb",
|
|
45
|
+
"primaryKey": false,
|
|
46
|
+
"notNull": false,
|
|
47
|
+
"default": "'{}'::jsonb"
|
|
48
|
+
},
|
|
49
|
+
"settings": {
|
|
50
|
+
"name": "settings",
|
|
51
|
+
"type": "jsonb",
|
|
52
|
+
"primaryKey": false,
|
|
53
|
+
"notNull": false,
|
|
54
|
+
"default": "'{}'::jsonb"
|
|
55
|
+
},
|
|
56
|
+
"is_active": {
|
|
57
|
+
"name": "is_active",
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"primaryKey": false,
|
|
60
|
+
"notNull": true,
|
|
61
|
+
"default": true
|
|
62
|
+
},
|
|
63
|
+
"created_at": {
|
|
64
|
+
"name": "created_at",
|
|
65
|
+
"type": "timestamp with time zone",
|
|
66
|
+
"primaryKey": false,
|
|
67
|
+
"notNull": true,
|
|
68
|
+
"default": "now()"
|
|
69
|
+
},
|
|
70
|
+
"updated_at": {
|
|
71
|
+
"name": "updated_at",
|
|
72
|
+
"type": "timestamp with time zone",
|
|
73
|
+
"primaryKey": false,
|
|
74
|
+
"notNull": true,
|
|
75
|
+
"default": "now()"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"indexes": {
|
|
79
|
+
"idx_container_tags_parent": {
|
|
80
|
+
"name": "idx_container_tags_parent",
|
|
81
|
+
"columns": [
|
|
82
|
+
{
|
|
83
|
+
"expression": "parent_tag",
|
|
84
|
+
"isExpression": false,
|
|
85
|
+
"asc": true,
|
|
86
|
+
"nulls": "last"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"isUnique": false,
|
|
90
|
+
"concurrently": false,
|
|
91
|
+
"method": "btree",
|
|
92
|
+
"with": {}
|
|
93
|
+
},
|
|
94
|
+
"idx_container_tags_active": {
|
|
95
|
+
"name": "idx_container_tags_active",
|
|
96
|
+
"columns": [
|
|
97
|
+
{
|
|
98
|
+
"expression": "is_active",
|
|
99
|
+
"isExpression": false,
|
|
100
|
+
"asc": true,
|
|
101
|
+
"nulls": "last"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"isUnique": false,
|
|
105
|
+
"where": "\"container_tags\".\"is_active\" = TRUE",
|
|
106
|
+
"concurrently": false,
|
|
107
|
+
"method": "btree",
|
|
108
|
+
"with": {}
|
|
109
|
+
},
|
|
110
|
+
"idx_container_tags_metadata": {
|
|
111
|
+
"name": "idx_container_tags_metadata",
|
|
112
|
+
"columns": [
|
|
113
|
+
{
|
|
114
|
+
"expression": "metadata",
|
|
115
|
+
"isExpression": false,
|
|
116
|
+
"asc": true,
|
|
117
|
+
"nulls": "last"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"isUnique": false,
|
|
121
|
+
"concurrently": false,
|
|
122
|
+
"method": "gin",
|
|
123
|
+
"with": {}
|
|
124
|
+
},
|
|
125
|
+
"idx_container_tags_hierarchy": {
|
|
126
|
+
"name": "idx_container_tags_hierarchy",
|
|
127
|
+
"columns": [
|
|
128
|
+
{
|
|
129
|
+
"expression": "tag",
|
|
130
|
+
"isExpression": false,
|
|
131
|
+
"asc": true,
|
|
132
|
+
"nulls": "last"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"expression": "parent_tag",
|
|
136
|
+
"isExpression": false,
|
|
137
|
+
"asc": true,
|
|
138
|
+
"nulls": "last"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"isUnique": false,
|
|
142
|
+
"concurrently": false,
|
|
143
|
+
"method": "btree",
|
|
144
|
+
"with": {}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"foreignKeys": {
|
|
148
|
+
"container_tags_parent_tag_container_tags_tag_fk": {
|
|
149
|
+
"name": "container_tags_parent_tag_container_tags_tag_fk",
|
|
150
|
+
"tableFrom": "container_tags",
|
|
151
|
+
"tableTo": "container_tags",
|
|
152
|
+
"columnsFrom": [
|
|
153
|
+
"parent_tag"
|
|
154
|
+
],
|
|
155
|
+
"columnsTo": [
|
|
156
|
+
"tag"
|
|
157
|
+
],
|
|
158
|
+
"onDelete": "set null",
|
|
159
|
+
"onUpdate": "no action"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"compositePrimaryKeys": {},
|
|
163
|
+
"uniqueConstraints": {
|
|
164
|
+
"container_tags_tag_unique": {
|
|
165
|
+
"name": "container_tags_tag_unique",
|
|
166
|
+
"nullsNotDistinct": false,
|
|
167
|
+
"columns": [
|
|
168
|
+
"tag"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"policies": {},
|
|
173
|
+
"checkConstraints": {
|
|
174
|
+
"container_tags_no_self_parent": {
|
|
175
|
+
"name": "container_tags_no_self_parent",
|
|
176
|
+
"value": "\"container_tags\".\"tag\" != \"container_tags\".\"parent_tag\""
|
|
177
|
+
},
|
|
178
|
+
"container_tags_tag_format": {
|
|
179
|
+
"name": "container_tags_tag_format",
|
|
180
|
+
"value": "\"container_tags\".\"tag\" ~ '^[a-zA-Z0-9_-]+$'"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"isRLSEnabled": false
|
|
184
|
+
},
|
|
185
|
+
"public.documents": {
|
|
186
|
+
"name": "documents",
|
|
187
|
+
"schema": "",
|
|
188
|
+
"columns": {
|
|
189
|
+
"id": {
|
|
190
|
+
"name": "id",
|
|
191
|
+
"type": "uuid",
|
|
192
|
+
"primaryKey": true,
|
|
193
|
+
"notNull": true,
|
|
194
|
+
"default": "gen_random_uuid()"
|
|
195
|
+
},
|
|
196
|
+
"custom_id": {
|
|
197
|
+
"name": "custom_id",
|
|
198
|
+
"type": "varchar(255)",
|
|
199
|
+
"primaryKey": false,
|
|
200
|
+
"notNull": false
|
|
201
|
+
},
|
|
202
|
+
"content": {
|
|
203
|
+
"name": "content",
|
|
204
|
+
"type": "text",
|
|
205
|
+
"primaryKey": false,
|
|
206
|
+
"notNull": true
|
|
207
|
+
},
|
|
208
|
+
"content_type": {
|
|
209
|
+
"name": "content_type",
|
|
210
|
+
"type": "varchar(50)",
|
|
211
|
+
"primaryKey": false,
|
|
212
|
+
"notNull": true,
|
|
213
|
+
"default": "'text/plain'"
|
|
214
|
+
},
|
|
215
|
+
"status": {
|
|
216
|
+
"name": "status",
|
|
217
|
+
"type": "varchar(20)",
|
|
218
|
+
"primaryKey": false,
|
|
219
|
+
"notNull": true,
|
|
220
|
+
"default": "'pending'"
|
|
221
|
+
},
|
|
222
|
+
"container_tag": {
|
|
223
|
+
"name": "container_tag",
|
|
224
|
+
"type": "varchar(255)",
|
|
225
|
+
"primaryKey": false,
|
|
226
|
+
"notNull": true
|
|
227
|
+
},
|
|
228
|
+
"metadata": {
|
|
229
|
+
"name": "metadata",
|
|
230
|
+
"type": "jsonb",
|
|
231
|
+
"primaryKey": false,
|
|
232
|
+
"notNull": false,
|
|
233
|
+
"default": "'{}'::jsonb"
|
|
234
|
+
},
|
|
235
|
+
"content_hash": {
|
|
236
|
+
"name": "content_hash",
|
|
237
|
+
"type": "varchar(64)",
|
|
238
|
+
"primaryKey": false,
|
|
239
|
+
"notNull": true,
|
|
240
|
+
"generated": {
|
|
241
|
+
"as": "encode(sha256(content::bytea), 'hex')",
|
|
242
|
+
"type": "stored"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"word_count": {
|
|
246
|
+
"name": "word_count",
|
|
247
|
+
"type": "integer",
|
|
248
|
+
"primaryKey": false,
|
|
249
|
+
"notNull": true,
|
|
250
|
+
"generated": {
|
|
251
|
+
"as": "array_length(regexp_split_to_array(content, '\\s+'), 1)",
|
|
252
|
+
"type": "stored"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"created_at": {
|
|
256
|
+
"name": "created_at",
|
|
257
|
+
"type": "timestamp with time zone",
|
|
258
|
+
"primaryKey": false,
|
|
259
|
+
"notNull": true,
|
|
260
|
+
"default": "now()"
|
|
261
|
+
},
|
|
262
|
+
"updated_at": {
|
|
263
|
+
"name": "updated_at",
|
|
264
|
+
"type": "timestamp with time zone",
|
|
265
|
+
"primaryKey": false,
|
|
266
|
+
"notNull": true,
|
|
267
|
+
"default": "now()"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"indexes": {
|
|
271
|
+
"idx_documents_container_tag": {
|
|
272
|
+
"name": "idx_documents_container_tag",
|
|
273
|
+
"columns": [
|
|
274
|
+
{
|
|
275
|
+
"expression": "container_tag",
|
|
276
|
+
"isExpression": false,
|
|
277
|
+
"asc": true,
|
|
278
|
+
"nulls": "last"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"isUnique": false,
|
|
282
|
+
"concurrently": false,
|
|
283
|
+
"method": "btree",
|
|
284
|
+
"with": {}
|
|
285
|
+
},
|
|
286
|
+
"idx_documents_status": {
|
|
287
|
+
"name": "idx_documents_status",
|
|
288
|
+
"columns": [
|
|
289
|
+
{
|
|
290
|
+
"expression": "status",
|
|
291
|
+
"isExpression": false,
|
|
292
|
+
"asc": true,
|
|
293
|
+
"nulls": "last"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"isUnique": false,
|
|
297
|
+
"where": "\"documents\".\"status\" != 'processed'",
|
|
298
|
+
"concurrently": false,
|
|
299
|
+
"method": "btree",
|
|
300
|
+
"with": {}
|
|
301
|
+
},
|
|
302
|
+
"idx_documents_custom_id": {
|
|
303
|
+
"name": "idx_documents_custom_id",
|
|
304
|
+
"columns": [
|
|
305
|
+
{
|
|
306
|
+
"expression": "custom_id",
|
|
307
|
+
"isExpression": false,
|
|
308
|
+
"asc": true,
|
|
309
|
+
"nulls": "last"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"isUnique": false,
|
|
313
|
+
"where": "\"documents\".\"custom_id\" IS NOT NULL",
|
|
314
|
+
"concurrently": false,
|
|
315
|
+
"method": "btree",
|
|
316
|
+
"with": {}
|
|
317
|
+
},
|
|
318
|
+
"idx_documents_content_hash": {
|
|
319
|
+
"name": "idx_documents_content_hash",
|
|
320
|
+
"columns": [
|
|
321
|
+
{
|
|
322
|
+
"expression": "content_hash",
|
|
323
|
+
"isExpression": false,
|
|
324
|
+
"asc": true,
|
|
325
|
+
"nulls": "last"
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"isUnique": false,
|
|
329
|
+
"concurrently": false,
|
|
330
|
+
"method": "btree",
|
|
331
|
+
"with": {}
|
|
332
|
+
},
|
|
333
|
+
"idx_documents_created_at": {
|
|
334
|
+
"name": "idx_documents_created_at",
|
|
335
|
+
"columns": [
|
|
336
|
+
{
|
|
337
|
+
"expression": "created_at",
|
|
338
|
+
"isExpression": false,
|
|
339
|
+
"asc": false,
|
|
340
|
+
"nulls": "last"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"isUnique": false,
|
|
344
|
+
"concurrently": false,
|
|
345
|
+
"method": "btree",
|
|
346
|
+
"with": {}
|
|
347
|
+
},
|
|
348
|
+
"idx_documents_metadata": {
|
|
349
|
+
"name": "idx_documents_metadata",
|
|
350
|
+
"columns": [
|
|
351
|
+
{
|
|
352
|
+
"expression": "\"metadata\" jsonb_path_ops",
|
|
353
|
+
"asc": true,
|
|
354
|
+
"isExpression": true,
|
|
355
|
+
"nulls": "last"
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"isUnique": false,
|
|
359
|
+
"concurrently": false,
|
|
360
|
+
"method": "gin",
|
|
361
|
+
"with": {}
|
|
362
|
+
},
|
|
363
|
+
"idx_documents_container_status": {
|
|
364
|
+
"name": "idx_documents_container_status",
|
|
365
|
+
"columns": [
|
|
366
|
+
{
|
|
367
|
+
"expression": "container_tag",
|
|
368
|
+
"isExpression": false,
|
|
369
|
+
"asc": true,
|
|
370
|
+
"nulls": "last"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"expression": "status",
|
|
374
|
+
"isExpression": false,
|
|
375
|
+
"asc": true,
|
|
376
|
+
"nulls": "last"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"expression": "created_at",
|
|
380
|
+
"isExpression": false,
|
|
381
|
+
"asc": true,
|
|
382
|
+
"nulls": "last"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"isUnique": false,
|
|
386
|
+
"concurrently": false,
|
|
387
|
+
"method": "btree",
|
|
388
|
+
"with": {}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"foreignKeys": {},
|
|
392
|
+
"compositePrimaryKeys": {},
|
|
393
|
+
"uniqueConstraints": {},
|
|
394
|
+
"policies": {},
|
|
395
|
+
"checkConstraints": {
|
|
396
|
+
"documents_status_check": {
|
|
397
|
+
"name": "documents_status_check",
|
|
398
|
+
"value": "\"documents\".\"status\" IN ('pending', 'processing', 'processed', 'failed', 'archived')"
|
|
399
|
+
},
|
|
400
|
+
"documents_content_type_check": {
|
|
401
|
+
"name": "documents_content_type_check",
|
|
402
|
+
"value": "\"documents\".\"content_type\" IN ('text/plain', 'text/markdown', 'text/html', 'application/pdf', 'application/json', 'image/png', 'image/jpeg', 'audio/mp3', 'video/mp4')"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"isRLSEnabled": false
|
|
406
|
+
},
|
|
407
|
+
"public.memories": {
|
|
408
|
+
"name": "memories",
|
|
409
|
+
"schema": "",
|
|
410
|
+
"columns": {
|
|
411
|
+
"id": {
|
|
412
|
+
"name": "id",
|
|
413
|
+
"type": "uuid",
|
|
414
|
+
"primaryKey": true,
|
|
415
|
+
"notNull": true,
|
|
416
|
+
"default": "gen_random_uuid()"
|
|
417
|
+
},
|
|
418
|
+
"document_id": {
|
|
419
|
+
"name": "document_id",
|
|
420
|
+
"type": "uuid",
|
|
421
|
+
"primaryKey": false,
|
|
422
|
+
"notNull": false
|
|
423
|
+
},
|
|
424
|
+
"content": {
|
|
425
|
+
"name": "content",
|
|
426
|
+
"type": "text",
|
|
427
|
+
"primaryKey": false,
|
|
428
|
+
"notNull": true
|
|
429
|
+
},
|
|
430
|
+
"memory_type": {
|
|
431
|
+
"name": "memory_type",
|
|
432
|
+
"type": "varchar(20)",
|
|
433
|
+
"primaryKey": false,
|
|
434
|
+
"notNull": true,
|
|
435
|
+
"default": "'fact'"
|
|
436
|
+
},
|
|
437
|
+
"is_latest": {
|
|
438
|
+
"name": "is_latest",
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"primaryKey": false,
|
|
441
|
+
"notNull": true,
|
|
442
|
+
"default": true
|
|
443
|
+
},
|
|
444
|
+
"similarity_hash": {
|
|
445
|
+
"name": "similarity_hash",
|
|
446
|
+
"type": "varchar(64)",
|
|
447
|
+
"primaryKey": false,
|
|
448
|
+
"notNull": true
|
|
449
|
+
},
|
|
450
|
+
"version": {
|
|
451
|
+
"name": "version",
|
|
452
|
+
"type": "integer",
|
|
453
|
+
"primaryKey": false,
|
|
454
|
+
"notNull": true,
|
|
455
|
+
"default": 1
|
|
456
|
+
},
|
|
457
|
+
"supersedes_id": {
|
|
458
|
+
"name": "supersedes_id",
|
|
459
|
+
"type": "uuid",
|
|
460
|
+
"primaryKey": false,
|
|
461
|
+
"notNull": false
|
|
462
|
+
},
|
|
463
|
+
"container_tag": {
|
|
464
|
+
"name": "container_tag",
|
|
465
|
+
"type": "varchar(255)",
|
|
466
|
+
"primaryKey": false,
|
|
467
|
+
"notNull": true
|
|
468
|
+
},
|
|
469
|
+
"confidence_score": {
|
|
470
|
+
"name": "confidence_score",
|
|
471
|
+
"type": "numeric(4, 3)",
|
|
472
|
+
"primaryKey": false,
|
|
473
|
+
"notNull": false,
|
|
474
|
+
"default": "'1.000'"
|
|
475
|
+
},
|
|
476
|
+
"metadata": {
|
|
477
|
+
"name": "metadata",
|
|
478
|
+
"type": "jsonb",
|
|
479
|
+
"primaryKey": false,
|
|
480
|
+
"notNull": false,
|
|
481
|
+
"default": "'{}'::jsonb"
|
|
482
|
+
},
|
|
483
|
+
"created_at": {
|
|
484
|
+
"name": "created_at",
|
|
485
|
+
"type": "timestamp with time zone",
|
|
486
|
+
"primaryKey": false,
|
|
487
|
+
"notNull": true,
|
|
488
|
+
"default": "now()"
|
|
489
|
+
},
|
|
490
|
+
"updated_at": {
|
|
491
|
+
"name": "updated_at",
|
|
492
|
+
"type": "timestamp with time zone",
|
|
493
|
+
"primaryKey": false,
|
|
494
|
+
"notNull": true,
|
|
495
|
+
"default": "now()"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"indexes": {
|
|
499
|
+
"idx_memories_document_id": {
|
|
500
|
+
"name": "idx_memories_document_id",
|
|
501
|
+
"columns": [
|
|
502
|
+
{
|
|
503
|
+
"expression": "document_id",
|
|
504
|
+
"isExpression": false,
|
|
505
|
+
"asc": true,
|
|
506
|
+
"nulls": "last"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"isUnique": false,
|
|
510
|
+
"where": "\"memories\".\"document_id\" IS NOT NULL",
|
|
511
|
+
"concurrently": false,
|
|
512
|
+
"method": "btree",
|
|
513
|
+
"with": {}
|
|
514
|
+
},
|
|
515
|
+
"idx_memories_container_tag": {
|
|
516
|
+
"name": "idx_memories_container_tag",
|
|
517
|
+
"columns": [
|
|
518
|
+
{
|
|
519
|
+
"expression": "container_tag",
|
|
520
|
+
"isExpression": false,
|
|
521
|
+
"asc": true,
|
|
522
|
+
"nulls": "last"
|
|
523
|
+
}
|
|
524
|
+
],
|
|
525
|
+
"isUnique": false,
|
|
526
|
+
"concurrently": false,
|
|
527
|
+
"method": "btree",
|
|
528
|
+
"with": {}
|
|
529
|
+
},
|
|
530
|
+
"idx_memories_type": {
|
|
531
|
+
"name": "idx_memories_type",
|
|
532
|
+
"columns": [
|
|
533
|
+
{
|
|
534
|
+
"expression": "memory_type",
|
|
535
|
+
"isExpression": false,
|
|
536
|
+
"asc": true,
|
|
537
|
+
"nulls": "last"
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"isUnique": false,
|
|
541
|
+
"concurrently": false,
|
|
542
|
+
"method": "btree",
|
|
543
|
+
"with": {}
|
|
544
|
+
},
|
|
545
|
+
"idx_memories_is_latest": {
|
|
546
|
+
"name": "idx_memories_is_latest",
|
|
547
|
+
"columns": [
|
|
548
|
+
{
|
|
549
|
+
"expression": "is_latest",
|
|
550
|
+
"isExpression": false,
|
|
551
|
+
"asc": true,
|
|
552
|
+
"nulls": "last"
|
|
553
|
+
}
|
|
554
|
+
],
|
|
555
|
+
"isUnique": false,
|
|
556
|
+
"where": "\"memories\".\"is_latest\" = TRUE",
|
|
557
|
+
"concurrently": false,
|
|
558
|
+
"method": "btree",
|
|
559
|
+
"with": {}
|
|
560
|
+
},
|
|
561
|
+
"idx_memories_similarity_hash": {
|
|
562
|
+
"name": "idx_memories_similarity_hash",
|
|
563
|
+
"columns": [
|
|
564
|
+
{
|
|
565
|
+
"expression": "similarity_hash",
|
|
566
|
+
"isExpression": false,
|
|
567
|
+
"asc": true,
|
|
568
|
+
"nulls": "last"
|
|
569
|
+
}
|
|
570
|
+
],
|
|
571
|
+
"isUnique": false,
|
|
572
|
+
"concurrently": false,
|
|
573
|
+
"method": "btree",
|
|
574
|
+
"with": {}
|
|
575
|
+
},
|
|
576
|
+
"idx_memories_supersedes": {
|
|
577
|
+
"name": "idx_memories_supersedes",
|
|
578
|
+
"columns": [
|
|
579
|
+
{
|
|
580
|
+
"expression": "supersedes_id",
|
|
581
|
+
"isExpression": false,
|
|
582
|
+
"asc": true,
|
|
583
|
+
"nulls": "last"
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"isUnique": false,
|
|
587
|
+
"where": "\"memories\".\"supersedes_id\" IS NOT NULL",
|
|
588
|
+
"concurrently": false,
|
|
589
|
+
"method": "btree",
|
|
590
|
+
"with": {}
|
|
591
|
+
},
|
|
592
|
+
"idx_memories_metadata": {
|
|
593
|
+
"name": "idx_memories_metadata",
|
|
594
|
+
"columns": [
|
|
595
|
+
{
|
|
596
|
+
"expression": "\"metadata\" jsonb_path_ops",
|
|
597
|
+
"asc": true,
|
|
598
|
+
"isExpression": true,
|
|
599
|
+
"nulls": "last"
|
|
600
|
+
}
|
|
601
|
+
],
|
|
602
|
+
"isUnique": false,
|
|
603
|
+
"concurrently": false,
|
|
604
|
+
"method": "gin",
|
|
605
|
+
"with": {}
|
|
606
|
+
},
|
|
607
|
+
"idx_memories_created_at": {
|
|
608
|
+
"name": "idx_memories_created_at",
|
|
609
|
+
"columns": [
|
|
610
|
+
{
|
|
611
|
+
"expression": "created_at",
|
|
612
|
+
"isExpression": false,
|
|
613
|
+
"asc": false,
|
|
614
|
+
"nulls": "last"
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
"isUnique": false,
|
|
618
|
+
"concurrently": false,
|
|
619
|
+
"method": "btree",
|
|
620
|
+
"with": {}
|
|
621
|
+
},
|
|
622
|
+
"idx_memories_container_latest": {
|
|
623
|
+
"name": "idx_memories_container_latest",
|
|
624
|
+
"columns": [
|
|
625
|
+
{
|
|
626
|
+
"expression": "container_tag",
|
|
627
|
+
"isExpression": false,
|
|
628
|
+
"asc": true,
|
|
629
|
+
"nulls": "last"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"expression": "is_latest",
|
|
633
|
+
"isExpression": false,
|
|
634
|
+
"asc": true,
|
|
635
|
+
"nulls": "last"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"expression": "created_at",
|
|
639
|
+
"isExpression": false,
|
|
640
|
+
"asc": true,
|
|
641
|
+
"nulls": "last"
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
"isUnique": false,
|
|
645
|
+
"where": "\"memories\".\"is_latest\" = TRUE",
|
|
646
|
+
"concurrently": false,
|
|
647
|
+
"method": "btree",
|
|
648
|
+
"with": {}
|
|
649
|
+
},
|
|
650
|
+
"idx_memories_container_type_latest": {
|
|
651
|
+
"name": "idx_memories_container_type_latest",
|
|
652
|
+
"columns": [
|
|
653
|
+
{
|
|
654
|
+
"expression": "container_tag",
|
|
655
|
+
"isExpression": false,
|
|
656
|
+
"asc": true,
|
|
657
|
+
"nulls": "last"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"expression": "memory_type",
|
|
661
|
+
"isExpression": false,
|
|
662
|
+
"asc": true,
|
|
663
|
+
"nulls": "last"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"expression": "is_latest",
|
|
667
|
+
"isExpression": false,
|
|
668
|
+
"asc": true,
|
|
669
|
+
"nulls": "last"
|
|
670
|
+
}
|
|
671
|
+
],
|
|
672
|
+
"isUnique": false,
|
|
673
|
+
"where": "\"memories\".\"is_latest\" = TRUE",
|
|
674
|
+
"concurrently": false,
|
|
675
|
+
"method": "btree",
|
|
676
|
+
"with": {}
|
|
677
|
+
},
|
|
678
|
+
"idx_memories_version_chain": {
|
|
679
|
+
"name": "idx_memories_version_chain",
|
|
680
|
+
"columns": [
|
|
681
|
+
{
|
|
682
|
+
"expression": "supersedes_id",
|
|
683
|
+
"isExpression": false,
|
|
684
|
+
"asc": true,
|
|
685
|
+
"nulls": "last"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"expression": "version",
|
|
689
|
+
"isExpression": false,
|
|
690
|
+
"asc": true,
|
|
691
|
+
"nulls": "last"
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"isUnique": false,
|
|
695
|
+
"where": "\"memories\".\"supersedes_id\" IS NOT NULL",
|
|
696
|
+
"concurrently": false,
|
|
697
|
+
"method": "btree",
|
|
698
|
+
"with": {}
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
"foreignKeys": {
|
|
702
|
+
"memories_document_id_documents_id_fk": {
|
|
703
|
+
"name": "memories_document_id_documents_id_fk",
|
|
704
|
+
"tableFrom": "memories",
|
|
705
|
+
"tableTo": "documents",
|
|
706
|
+
"columnsFrom": [
|
|
707
|
+
"document_id"
|
|
708
|
+
],
|
|
709
|
+
"columnsTo": [
|
|
710
|
+
"id"
|
|
711
|
+
],
|
|
712
|
+
"onDelete": "set null",
|
|
713
|
+
"onUpdate": "no action"
|
|
714
|
+
},
|
|
715
|
+
"memories_supersedes_id_memories_id_fk": {
|
|
716
|
+
"name": "memories_supersedes_id_memories_id_fk",
|
|
717
|
+
"tableFrom": "memories",
|
|
718
|
+
"tableTo": "memories",
|
|
719
|
+
"columnsFrom": [
|
|
720
|
+
"supersedes_id"
|
|
721
|
+
],
|
|
722
|
+
"columnsTo": [
|
|
723
|
+
"id"
|
|
724
|
+
],
|
|
725
|
+
"onDelete": "set null",
|
|
726
|
+
"onUpdate": "no action"
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"compositePrimaryKeys": {},
|
|
730
|
+
"uniqueConstraints": {},
|
|
731
|
+
"policies": {},
|
|
732
|
+
"checkConstraints": {
|
|
733
|
+
"memories_type_check": {
|
|
734
|
+
"name": "memories_type_check",
|
|
735
|
+
"value": "\"memories\".\"memory_type\" IN ('fact', 'preference', 'episode', 'belief', 'skill', 'context')"
|
|
736
|
+
},
|
|
737
|
+
"memories_confidence_check": {
|
|
738
|
+
"name": "memories_confidence_check",
|
|
739
|
+
"value": "\"memories\".\"confidence_score\" >= 0 AND \"memories\".\"confidence_score\" <= 1"
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
"isRLSEnabled": false
|
|
743
|
+
},
|
|
744
|
+
"public.memory_embeddings": {
|
|
745
|
+
"name": "memory_embeddings",
|
|
746
|
+
"schema": "",
|
|
747
|
+
"columns": {
|
|
748
|
+
"memory_id": {
|
|
749
|
+
"name": "memory_id",
|
|
750
|
+
"type": "uuid",
|
|
751
|
+
"primaryKey": true,
|
|
752
|
+
"notNull": true
|
|
753
|
+
},
|
|
754
|
+
"embedding": {
|
|
755
|
+
"name": "embedding",
|
|
756
|
+
"type": "vector(1536)",
|
|
757
|
+
"primaryKey": false,
|
|
758
|
+
"notNull": true
|
|
759
|
+
},
|
|
760
|
+
"model": {
|
|
761
|
+
"name": "model",
|
|
762
|
+
"type": "varchar(100)",
|
|
763
|
+
"primaryKey": false,
|
|
764
|
+
"notNull": true,
|
|
765
|
+
"default": "'text-embedding-3-small'"
|
|
766
|
+
},
|
|
767
|
+
"model_version": {
|
|
768
|
+
"name": "model_version",
|
|
769
|
+
"type": "varchar(50)",
|
|
770
|
+
"primaryKey": false,
|
|
771
|
+
"notNull": false
|
|
772
|
+
},
|
|
773
|
+
"normalized": {
|
|
774
|
+
"name": "normalized",
|
|
775
|
+
"type": "boolean",
|
|
776
|
+
"primaryKey": false,
|
|
777
|
+
"notNull": false,
|
|
778
|
+
"default": true
|
|
779
|
+
},
|
|
780
|
+
"created_at": {
|
|
781
|
+
"name": "created_at",
|
|
782
|
+
"type": "timestamp with time zone",
|
|
783
|
+
"primaryKey": false,
|
|
784
|
+
"notNull": true,
|
|
785
|
+
"default": "now()"
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
"indexes": {
|
|
789
|
+
"idx_memory_embeddings_hnsw": {
|
|
790
|
+
"name": "idx_memory_embeddings_hnsw",
|
|
791
|
+
"columns": [
|
|
792
|
+
{
|
|
793
|
+
"expression": "embedding",
|
|
794
|
+
"isExpression": false,
|
|
795
|
+
"asc": true,
|
|
796
|
+
"nulls": "last",
|
|
797
|
+
"opclass": "vector_cosine_ops"
|
|
798
|
+
}
|
|
799
|
+
],
|
|
800
|
+
"isUnique": false,
|
|
801
|
+
"concurrently": false,
|
|
802
|
+
"method": "hnsw",
|
|
803
|
+
"with": {
|
|
804
|
+
"m": 16,
|
|
805
|
+
"ef_construction": 64
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
"idx_memory_embeddings_model": {
|
|
809
|
+
"name": "idx_memory_embeddings_model",
|
|
810
|
+
"columns": [
|
|
811
|
+
{
|
|
812
|
+
"expression": "model",
|
|
813
|
+
"isExpression": false,
|
|
814
|
+
"asc": true,
|
|
815
|
+
"nulls": "last"
|
|
816
|
+
}
|
|
817
|
+
],
|
|
818
|
+
"isUnique": false,
|
|
819
|
+
"concurrently": false,
|
|
820
|
+
"method": "btree",
|
|
821
|
+
"with": {}
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
"foreignKeys": {
|
|
825
|
+
"memory_embeddings_memory_id_memories_id_fk": {
|
|
826
|
+
"name": "memory_embeddings_memory_id_memories_id_fk",
|
|
827
|
+
"tableFrom": "memory_embeddings",
|
|
828
|
+
"tableTo": "memories",
|
|
829
|
+
"columnsFrom": [
|
|
830
|
+
"memory_id"
|
|
831
|
+
],
|
|
832
|
+
"columnsTo": [
|
|
833
|
+
"id"
|
|
834
|
+
],
|
|
835
|
+
"onDelete": "cascade",
|
|
836
|
+
"onUpdate": "no action"
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
"compositePrimaryKeys": {},
|
|
840
|
+
"uniqueConstraints": {},
|
|
841
|
+
"policies": {},
|
|
842
|
+
"checkConstraints": {
|
|
843
|
+
"memory_embeddings_model_check": {
|
|
844
|
+
"name": "memory_embeddings_model_check",
|
|
845
|
+
"value": "\"memory_embeddings\".\"model\" IN ('text-embedding-3-small', 'text-embedding-3-large', 'text-embedding-ada-002', 'voyage-large-2', 'voyage-code-2', 'cohere-embed-v3', 'bge-large-en-v1.5', 'custom')"
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
"isRLSEnabled": false
|
|
849
|
+
},
|
|
850
|
+
"public.memory_relationships": {
|
|
851
|
+
"name": "memory_relationships",
|
|
852
|
+
"schema": "",
|
|
853
|
+
"columns": {
|
|
854
|
+
"id": {
|
|
855
|
+
"name": "id",
|
|
856
|
+
"type": "uuid",
|
|
857
|
+
"primaryKey": true,
|
|
858
|
+
"notNull": true,
|
|
859
|
+
"default": "gen_random_uuid()"
|
|
860
|
+
},
|
|
861
|
+
"source_memory_id": {
|
|
862
|
+
"name": "source_memory_id",
|
|
863
|
+
"type": "uuid",
|
|
864
|
+
"primaryKey": false,
|
|
865
|
+
"notNull": true
|
|
866
|
+
},
|
|
867
|
+
"target_memory_id": {
|
|
868
|
+
"name": "target_memory_id",
|
|
869
|
+
"type": "uuid",
|
|
870
|
+
"primaryKey": false,
|
|
871
|
+
"notNull": true
|
|
872
|
+
},
|
|
873
|
+
"relationship_type": {
|
|
874
|
+
"name": "relationship_type",
|
|
875
|
+
"type": "varchar(30)",
|
|
876
|
+
"primaryKey": false,
|
|
877
|
+
"notNull": true
|
|
878
|
+
},
|
|
879
|
+
"weight": {
|
|
880
|
+
"name": "weight",
|
|
881
|
+
"type": "numeric(4, 3)",
|
|
882
|
+
"primaryKey": false,
|
|
883
|
+
"notNull": false,
|
|
884
|
+
"default": "'1.000'"
|
|
885
|
+
},
|
|
886
|
+
"bidirectional": {
|
|
887
|
+
"name": "bidirectional",
|
|
888
|
+
"type": "boolean",
|
|
889
|
+
"primaryKey": false,
|
|
890
|
+
"notNull": false,
|
|
891
|
+
"default": false
|
|
892
|
+
},
|
|
893
|
+
"metadata": {
|
|
894
|
+
"name": "metadata",
|
|
895
|
+
"type": "jsonb",
|
|
896
|
+
"primaryKey": false,
|
|
897
|
+
"notNull": false,
|
|
898
|
+
"default": "'{}'::jsonb"
|
|
899
|
+
},
|
|
900
|
+
"created_at": {
|
|
901
|
+
"name": "created_at",
|
|
902
|
+
"type": "timestamp with time zone",
|
|
903
|
+
"primaryKey": false,
|
|
904
|
+
"notNull": true,
|
|
905
|
+
"default": "now()"
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
"indexes": {
|
|
909
|
+
"idx_memory_rel_source": {
|
|
910
|
+
"name": "idx_memory_rel_source",
|
|
911
|
+
"columns": [
|
|
912
|
+
{
|
|
913
|
+
"expression": "source_memory_id",
|
|
914
|
+
"isExpression": false,
|
|
915
|
+
"asc": true,
|
|
916
|
+
"nulls": "last"
|
|
917
|
+
}
|
|
918
|
+
],
|
|
919
|
+
"isUnique": false,
|
|
920
|
+
"concurrently": false,
|
|
921
|
+
"method": "btree",
|
|
922
|
+
"with": {}
|
|
923
|
+
},
|
|
924
|
+
"idx_memory_rel_target": {
|
|
925
|
+
"name": "idx_memory_rel_target",
|
|
926
|
+
"columns": [
|
|
927
|
+
{
|
|
928
|
+
"expression": "target_memory_id",
|
|
929
|
+
"isExpression": false,
|
|
930
|
+
"asc": true,
|
|
931
|
+
"nulls": "last"
|
|
932
|
+
}
|
|
933
|
+
],
|
|
934
|
+
"isUnique": false,
|
|
935
|
+
"concurrently": false,
|
|
936
|
+
"method": "btree",
|
|
937
|
+
"with": {}
|
|
938
|
+
},
|
|
939
|
+
"idx_memory_rel_type": {
|
|
940
|
+
"name": "idx_memory_rel_type",
|
|
941
|
+
"columns": [
|
|
942
|
+
{
|
|
943
|
+
"expression": "relationship_type",
|
|
944
|
+
"isExpression": false,
|
|
945
|
+
"asc": true,
|
|
946
|
+
"nulls": "last"
|
|
947
|
+
}
|
|
948
|
+
],
|
|
949
|
+
"isUnique": false,
|
|
950
|
+
"concurrently": false,
|
|
951
|
+
"method": "btree",
|
|
952
|
+
"with": {}
|
|
953
|
+
},
|
|
954
|
+
"idx_memory_rel_bidirectional": {
|
|
955
|
+
"name": "idx_memory_rel_bidirectional",
|
|
956
|
+
"columns": [
|
|
957
|
+
{
|
|
958
|
+
"expression": "source_memory_id",
|
|
959
|
+
"isExpression": false,
|
|
960
|
+
"asc": true,
|
|
961
|
+
"nulls": "last"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"expression": "target_memory_id",
|
|
965
|
+
"isExpression": false,
|
|
966
|
+
"asc": true,
|
|
967
|
+
"nulls": "last"
|
|
968
|
+
}
|
|
969
|
+
],
|
|
970
|
+
"isUnique": false,
|
|
971
|
+
"where": "\"memory_relationships\".\"bidirectional\" = TRUE",
|
|
972
|
+
"concurrently": false,
|
|
973
|
+
"method": "btree",
|
|
974
|
+
"with": {}
|
|
975
|
+
},
|
|
976
|
+
"idx_memory_rel_graph": {
|
|
977
|
+
"name": "idx_memory_rel_graph",
|
|
978
|
+
"columns": [
|
|
979
|
+
{
|
|
980
|
+
"expression": "source_memory_id",
|
|
981
|
+
"isExpression": false,
|
|
982
|
+
"asc": true,
|
|
983
|
+
"nulls": "last"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"expression": "target_memory_id",
|
|
987
|
+
"isExpression": false,
|
|
988
|
+
"asc": true,
|
|
989
|
+
"nulls": "last"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"expression": "relationship_type",
|
|
993
|
+
"isExpression": false,
|
|
994
|
+
"asc": true,
|
|
995
|
+
"nulls": "last"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"expression": "weight",
|
|
999
|
+
"isExpression": false,
|
|
1000
|
+
"asc": true,
|
|
1001
|
+
"nulls": "last"
|
|
1002
|
+
}
|
|
1003
|
+
],
|
|
1004
|
+
"isUnique": false,
|
|
1005
|
+
"concurrently": false,
|
|
1006
|
+
"method": "btree",
|
|
1007
|
+
"with": {}
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
"foreignKeys": {
|
|
1011
|
+
"memory_relationships_source_memory_id_memories_id_fk": {
|
|
1012
|
+
"name": "memory_relationships_source_memory_id_memories_id_fk",
|
|
1013
|
+
"tableFrom": "memory_relationships",
|
|
1014
|
+
"tableTo": "memories",
|
|
1015
|
+
"columnsFrom": [
|
|
1016
|
+
"source_memory_id"
|
|
1017
|
+
],
|
|
1018
|
+
"columnsTo": [
|
|
1019
|
+
"id"
|
|
1020
|
+
],
|
|
1021
|
+
"onDelete": "cascade",
|
|
1022
|
+
"onUpdate": "no action"
|
|
1023
|
+
},
|
|
1024
|
+
"memory_relationships_target_memory_id_memories_id_fk": {
|
|
1025
|
+
"name": "memory_relationships_target_memory_id_memories_id_fk",
|
|
1026
|
+
"tableFrom": "memory_relationships",
|
|
1027
|
+
"tableTo": "memories",
|
|
1028
|
+
"columnsFrom": [
|
|
1029
|
+
"target_memory_id"
|
|
1030
|
+
],
|
|
1031
|
+
"columnsTo": [
|
|
1032
|
+
"id"
|
|
1033
|
+
],
|
|
1034
|
+
"onDelete": "cascade",
|
|
1035
|
+
"onUpdate": "no action"
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
"compositePrimaryKeys": {},
|
|
1039
|
+
"uniqueConstraints": {
|
|
1040
|
+
"memory_relationships_unique_edge": {
|
|
1041
|
+
"name": "memory_relationships_unique_edge",
|
|
1042
|
+
"nullsNotDistinct": false,
|
|
1043
|
+
"columns": [
|
|
1044
|
+
"source_memory_id",
|
|
1045
|
+
"target_memory_id",
|
|
1046
|
+
"relationship_type"
|
|
1047
|
+
]
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
"policies": {},
|
|
1051
|
+
"checkConstraints": {
|
|
1052
|
+
"memory_relationships_type_check": {
|
|
1053
|
+
"name": "memory_relationships_type_check",
|
|
1054
|
+
"value": "\"memory_relationships\".\"relationship_type\" IN ('updates', 'extends', 'derives', 'contradicts', 'supports', 'relates', 'temporal', 'causal', 'part_of', 'similar')"
|
|
1055
|
+
},
|
|
1056
|
+
"memory_relationships_weight_check": {
|
|
1057
|
+
"name": "memory_relationships_weight_check",
|
|
1058
|
+
"value": "\"memory_relationships\".\"weight\" >= 0 AND \"memory_relationships\".\"weight\" <= 1"
|
|
1059
|
+
},
|
|
1060
|
+
"memory_relationships_no_self_loop": {
|
|
1061
|
+
"name": "memory_relationships_no_self_loop",
|
|
1062
|
+
"value": "\"memory_relationships\".\"source_memory_id\" != \"memory_relationships\".\"target_memory_id\""
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
"isRLSEnabled": false
|
|
1066
|
+
},
|
|
1067
|
+
"public.user_profiles": {
|
|
1068
|
+
"name": "user_profiles",
|
|
1069
|
+
"schema": "",
|
|
1070
|
+
"columns": {
|
|
1071
|
+
"id": {
|
|
1072
|
+
"name": "id",
|
|
1073
|
+
"type": "uuid",
|
|
1074
|
+
"primaryKey": true,
|
|
1075
|
+
"notNull": true,
|
|
1076
|
+
"default": "gen_random_uuid()"
|
|
1077
|
+
},
|
|
1078
|
+
"container_tag": {
|
|
1079
|
+
"name": "container_tag",
|
|
1080
|
+
"type": "varchar(255)",
|
|
1081
|
+
"primaryKey": false,
|
|
1082
|
+
"notNull": true
|
|
1083
|
+
},
|
|
1084
|
+
"static_facts": {
|
|
1085
|
+
"name": "static_facts",
|
|
1086
|
+
"type": "jsonb",
|
|
1087
|
+
"primaryKey": false,
|
|
1088
|
+
"notNull": false,
|
|
1089
|
+
"default": "'[]'::jsonb"
|
|
1090
|
+
},
|
|
1091
|
+
"dynamic_facts": {
|
|
1092
|
+
"name": "dynamic_facts",
|
|
1093
|
+
"type": "jsonb",
|
|
1094
|
+
"primaryKey": false,
|
|
1095
|
+
"notNull": false,
|
|
1096
|
+
"default": "'[]'::jsonb"
|
|
1097
|
+
},
|
|
1098
|
+
"preferences": {
|
|
1099
|
+
"name": "preferences",
|
|
1100
|
+
"type": "jsonb",
|
|
1101
|
+
"primaryKey": false,
|
|
1102
|
+
"notNull": false,
|
|
1103
|
+
"default": "'{}'::jsonb"
|
|
1104
|
+
},
|
|
1105
|
+
"computed_traits": {
|
|
1106
|
+
"name": "computed_traits",
|
|
1107
|
+
"type": "jsonb",
|
|
1108
|
+
"primaryKey": false,
|
|
1109
|
+
"notNull": false,
|
|
1110
|
+
"default": "'{}'::jsonb"
|
|
1111
|
+
},
|
|
1112
|
+
"last_interaction_at": {
|
|
1113
|
+
"name": "last_interaction_at",
|
|
1114
|
+
"type": "timestamp with time zone",
|
|
1115
|
+
"primaryKey": false,
|
|
1116
|
+
"notNull": false
|
|
1117
|
+
},
|
|
1118
|
+
"memory_count": {
|
|
1119
|
+
"name": "memory_count",
|
|
1120
|
+
"type": "integer",
|
|
1121
|
+
"primaryKey": false,
|
|
1122
|
+
"notNull": false,
|
|
1123
|
+
"default": 0
|
|
1124
|
+
},
|
|
1125
|
+
"created_at": {
|
|
1126
|
+
"name": "created_at",
|
|
1127
|
+
"type": "timestamp with time zone",
|
|
1128
|
+
"primaryKey": false,
|
|
1129
|
+
"notNull": true,
|
|
1130
|
+
"default": "now()"
|
|
1131
|
+
},
|
|
1132
|
+
"updated_at": {
|
|
1133
|
+
"name": "updated_at",
|
|
1134
|
+
"type": "timestamp with time zone",
|
|
1135
|
+
"primaryKey": false,
|
|
1136
|
+
"notNull": true,
|
|
1137
|
+
"default": "now()"
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
"indexes": {
|
|
1141
|
+
"idx_user_profiles_container": {
|
|
1142
|
+
"name": "idx_user_profiles_container",
|
|
1143
|
+
"columns": [
|
|
1144
|
+
{
|
|
1145
|
+
"expression": "container_tag",
|
|
1146
|
+
"isExpression": false,
|
|
1147
|
+
"asc": true,
|
|
1148
|
+
"nulls": "last"
|
|
1149
|
+
}
|
|
1150
|
+
],
|
|
1151
|
+
"isUnique": false,
|
|
1152
|
+
"concurrently": false,
|
|
1153
|
+
"method": "btree",
|
|
1154
|
+
"with": {}
|
|
1155
|
+
},
|
|
1156
|
+
"idx_user_profiles_static_facts": {
|
|
1157
|
+
"name": "idx_user_profiles_static_facts",
|
|
1158
|
+
"columns": [
|
|
1159
|
+
{
|
|
1160
|
+
"expression": "static_facts",
|
|
1161
|
+
"isExpression": false,
|
|
1162
|
+
"asc": true,
|
|
1163
|
+
"nulls": "last"
|
|
1164
|
+
}
|
|
1165
|
+
],
|
|
1166
|
+
"isUnique": false,
|
|
1167
|
+
"concurrently": false,
|
|
1168
|
+
"method": "gin",
|
|
1169
|
+
"with": {}
|
|
1170
|
+
},
|
|
1171
|
+
"idx_user_profiles_dynamic_facts": {
|
|
1172
|
+
"name": "idx_user_profiles_dynamic_facts",
|
|
1173
|
+
"columns": [
|
|
1174
|
+
{
|
|
1175
|
+
"expression": "dynamic_facts",
|
|
1176
|
+
"isExpression": false,
|
|
1177
|
+
"asc": true,
|
|
1178
|
+
"nulls": "last"
|
|
1179
|
+
}
|
|
1180
|
+
],
|
|
1181
|
+
"isUnique": false,
|
|
1182
|
+
"concurrently": false,
|
|
1183
|
+
"method": "gin",
|
|
1184
|
+
"with": {}
|
|
1185
|
+
},
|
|
1186
|
+
"idx_user_profiles_preferences": {
|
|
1187
|
+
"name": "idx_user_profiles_preferences",
|
|
1188
|
+
"columns": [
|
|
1189
|
+
{
|
|
1190
|
+
"expression": "preferences",
|
|
1191
|
+
"isExpression": false,
|
|
1192
|
+
"asc": true,
|
|
1193
|
+
"nulls": "last"
|
|
1194
|
+
}
|
|
1195
|
+
],
|
|
1196
|
+
"isUnique": false,
|
|
1197
|
+
"concurrently": false,
|
|
1198
|
+
"method": "gin",
|
|
1199
|
+
"with": {}
|
|
1200
|
+
},
|
|
1201
|
+
"idx_user_profiles_updated": {
|
|
1202
|
+
"name": "idx_user_profiles_updated",
|
|
1203
|
+
"columns": [
|
|
1204
|
+
{
|
|
1205
|
+
"expression": "updated_at",
|
|
1206
|
+
"isExpression": false,
|
|
1207
|
+
"asc": false,
|
|
1208
|
+
"nulls": "last"
|
|
1209
|
+
}
|
|
1210
|
+
],
|
|
1211
|
+
"isUnique": false,
|
|
1212
|
+
"concurrently": false,
|
|
1213
|
+
"method": "btree",
|
|
1214
|
+
"with": {}
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
"foreignKeys": {
|
|
1218
|
+
"user_profiles_container_tag_container_tags_tag_fk": {
|
|
1219
|
+
"name": "user_profiles_container_tag_container_tags_tag_fk",
|
|
1220
|
+
"tableFrom": "user_profiles",
|
|
1221
|
+
"tableTo": "container_tags",
|
|
1222
|
+
"columnsFrom": [
|
|
1223
|
+
"container_tag"
|
|
1224
|
+
],
|
|
1225
|
+
"columnsTo": [
|
|
1226
|
+
"tag"
|
|
1227
|
+
],
|
|
1228
|
+
"onDelete": "cascade",
|
|
1229
|
+
"onUpdate": "no action"
|
|
1230
|
+
}
|
|
1231
|
+
},
|
|
1232
|
+
"compositePrimaryKeys": {},
|
|
1233
|
+
"uniqueConstraints": {
|
|
1234
|
+
"user_profiles_container_tag_unique": {
|
|
1235
|
+
"name": "user_profiles_container_tag_unique",
|
|
1236
|
+
"nullsNotDistinct": false,
|
|
1237
|
+
"columns": [
|
|
1238
|
+
"container_tag"
|
|
1239
|
+
]
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
"policies": {},
|
|
1243
|
+
"checkConstraints": {},
|
|
1244
|
+
"isRLSEnabled": false
|
|
1245
|
+
},
|
|
1246
|
+
"public.processing_queue": {
|
|
1247
|
+
"name": "processing_queue",
|
|
1248
|
+
"schema": "",
|
|
1249
|
+
"columns": {
|
|
1250
|
+
"id": {
|
|
1251
|
+
"name": "id",
|
|
1252
|
+
"type": "uuid",
|
|
1253
|
+
"primaryKey": true,
|
|
1254
|
+
"notNull": true,
|
|
1255
|
+
"default": "gen_random_uuid()"
|
|
1256
|
+
},
|
|
1257
|
+
"document_id": {
|
|
1258
|
+
"name": "document_id",
|
|
1259
|
+
"type": "uuid",
|
|
1260
|
+
"primaryKey": false,
|
|
1261
|
+
"notNull": true
|
|
1262
|
+
},
|
|
1263
|
+
"stage": {
|
|
1264
|
+
"name": "stage",
|
|
1265
|
+
"type": "varchar(30)",
|
|
1266
|
+
"primaryKey": false,
|
|
1267
|
+
"notNull": true,
|
|
1268
|
+
"default": "'extraction'"
|
|
1269
|
+
},
|
|
1270
|
+
"status": {
|
|
1271
|
+
"name": "status",
|
|
1272
|
+
"type": "varchar(20)",
|
|
1273
|
+
"primaryKey": false,
|
|
1274
|
+
"notNull": true,
|
|
1275
|
+
"default": "'pending'"
|
|
1276
|
+
},
|
|
1277
|
+
"priority": {
|
|
1278
|
+
"name": "priority",
|
|
1279
|
+
"type": "integer",
|
|
1280
|
+
"primaryKey": false,
|
|
1281
|
+
"notNull": false,
|
|
1282
|
+
"default": 0
|
|
1283
|
+
},
|
|
1284
|
+
"error": {
|
|
1285
|
+
"name": "error",
|
|
1286
|
+
"type": "text",
|
|
1287
|
+
"primaryKey": false,
|
|
1288
|
+
"notNull": false
|
|
1289
|
+
},
|
|
1290
|
+
"error_code": {
|
|
1291
|
+
"name": "error_code",
|
|
1292
|
+
"type": "varchar(50)",
|
|
1293
|
+
"primaryKey": false,
|
|
1294
|
+
"notNull": false
|
|
1295
|
+
},
|
|
1296
|
+
"attempts": {
|
|
1297
|
+
"name": "attempts",
|
|
1298
|
+
"type": "integer",
|
|
1299
|
+
"primaryKey": false,
|
|
1300
|
+
"notNull": false,
|
|
1301
|
+
"default": 0
|
|
1302
|
+
},
|
|
1303
|
+
"max_attempts": {
|
|
1304
|
+
"name": "max_attempts",
|
|
1305
|
+
"type": "integer",
|
|
1306
|
+
"primaryKey": false,
|
|
1307
|
+
"notNull": false,
|
|
1308
|
+
"default": 3
|
|
1309
|
+
},
|
|
1310
|
+
"worker_id": {
|
|
1311
|
+
"name": "worker_id",
|
|
1312
|
+
"type": "varchar(100)",
|
|
1313
|
+
"primaryKey": false,
|
|
1314
|
+
"notNull": false
|
|
1315
|
+
},
|
|
1316
|
+
"metadata": {
|
|
1317
|
+
"name": "metadata",
|
|
1318
|
+
"type": "jsonb",
|
|
1319
|
+
"primaryKey": false,
|
|
1320
|
+
"notNull": false,
|
|
1321
|
+
"default": "'{}'::jsonb"
|
|
1322
|
+
},
|
|
1323
|
+
"created_at": {
|
|
1324
|
+
"name": "created_at",
|
|
1325
|
+
"type": "timestamp with time zone",
|
|
1326
|
+
"primaryKey": false,
|
|
1327
|
+
"notNull": true,
|
|
1328
|
+
"default": "now()"
|
|
1329
|
+
},
|
|
1330
|
+
"started_at": {
|
|
1331
|
+
"name": "started_at",
|
|
1332
|
+
"type": "timestamp with time zone",
|
|
1333
|
+
"primaryKey": false,
|
|
1334
|
+
"notNull": false
|
|
1335
|
+
},
|
|
1336
|
+
"completed_at": {
|
|
1337
|
+
"name": "completed_at",
|
|
1338
|
+
"type": "timestamp with time zone",
|
|
1339
|
+
"primaryKey": false,
|
|
1340
|
+
"notNull": false
|
|
1341
|
+
},
|
|
1342
|
+
"scheduled_at": {
|
|
1343
|
+
"name": "scheduled_at",
|
|
1344
|
+
"type": "timestamp with time zone",
|
|
1345
|
+
"primaryKey": false,
|
|
1346
|
+
"notNull": false,
|
|
1347
|
+
"default": "now()"
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
"indexes": {
|
|
1351
|
+
"idx_processing_queue_document": {
|
|
1352
|
+
"name": "idx_processing_queue_document",
|
|
1353
|
+
"columns": [
|
|
1354
|
+
{
|
|
1355
|
+
"expression": "document_id",
|
|
1356
|
+
"isExpression": false,
|
|
1357
|
+
"asc": true,
|
|
1358
|
+
"nulls": "last"
|
|
1359
|
+
}
|
|
1360
|
+
],
|
|
1361
|
+
"isUnique": false,
|
|
1362
|
+
"concurrently": false,
|
|
1363
|
+
"method": "btree",
|
|
1364
|
+
"with": {}
|
|
1365
|
+
},
|
|
1366
|
+
"idx_processing_queue_status": {
|
|
1367
|
+
"name": "idx_processing_queue_status",
|
|
1368
|
+
"columns": [
|
|
1369
|
+
{
|
|
1370
|
+
"expression": "status",
|
|
1371
|
+
"isExpression": false,
|
|
1372
|
+
"asc": true,
|
|
1373
|
+
"nulls": "last"
|
|
1374
|
+
}
|
|
1375
|
+
],
|
|
1376
|
+
"isUnique": false,
|
|
1377
|
+
"where": "\"processing_queue\".\"status\" IN ('pending', 'retry')",
|
|
1378
|
+
"concurrently": false,
|
|
1379
|
+
"method": "btree",
|
|
1380
|
+
"with": {}
|
|
1381
|
+
},
|
|
1382
|
+
"idx_processing_queue_stage": {
|
|
1383
|
+
"name": "idx_processing_queue_stage",
|
|
1384
|
+
"columns": [
|
|
1385
|
+
{
|
|
1386
|
+
"expression": "stage",
|
|
1387
|
+
"isExpression": false,
|
|
1388
|
+
"asc": true,
|
|
1389
|
+
"nulls": "last"
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
"isUnique": false,
|
|
1393
|
+
"concurrently": false,
|
|
1394
|
+
"method": "btree",
|
|
1395
|
+
"with": {}
|
|
1396
|
+
},
|
|
1397
|
+
"idx_processing_queue_worker": {
|
|
1398
|
+
"name": "idx_processing_queue_worker",
|
|
1399
|
+
"columns": [
|
|
1400
|
+
{
|
|
1401
|
+
"expression": "worker_id",
|
|
1402
|
+
"isExpression": false,
|
|
1403
|
+
"asc": true,
|
|
1404
|
+
"nulls": "last"
|
|
1405
|
+
}
|
|
1406
|
+
],
|
|
1407
|
+
"isUnique": false,
|
|
1408
|
+
"where": "\"processing_queue\".\"worker_id\" IS NOT NULL",
|
|
1409
|
+
"concurrently": false,
|
|
1410
|
+
"method": "btree",
|
|
1411
|
+
"with": {}
|
|
1412
|
+
},
|
|
1413
|
+
"idx_processing_queue_priority": {
|
|
1414
|
+
"name": "idx_processing_queue_priority",
|
|
1415
|
+
"columns": [
|
|
1416
|
+
{
|
|
1417
|
+
"expression": "priority",
|
|
1418
|
+
"isExpression": false,
|
|
1419
|
+
"asc": false,
|
|
1420
|
+
"nulls": "last"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"expression": "scheduled_at",
|
|
1424
|
+
"isExpression": false,
|
|
1425
|
+
"asc": true,
|
|
1426
|
+
"nulls": "last"
|
|
1427
|
+
}
|
|
1428
|
+
],
|
|
1429
|
+
"isUnique": false,
|
|
1430
|
+
"where": "\"processing_queue\".\"status\" IN ('pending', 'retry')",
|
|
1431
|
+
"concurrently": false,
|
|
1432
|
+
"method": "btree",
|
|
1433
|
+
"with": {}
|
|
1434
|
+
},
|
|
1435
|
+
"idx_processing_queue_stale": {
|
|
1436
|
+
"name": "idx_processing_queue_stale",
|
|
1437
|
+
"columns": [
|
|
1438
|
+
{
|
|
1439
|
+
"expression": "started_at",
|
|
1440
|
+
"isExpression": false,
|
|
1441
|
+
"asc": true,
|
|
1442
|
+
"nulls": "last"
|
|
1443
|
+
}
|
|
1444
|
+
],
|
|
1445
|
+
"isUnique": false,
|
|
1446
|
+
"where": "\"processing_queue\".\"status\" = 'processing'",
|
|
1447
|
+
"concurrently": false,
|
|
1448
|
+
"method": "btree",
|
|
1449
|
+
"with": {}
|
|
1450
|
+
},
|
|
1451
|
+
"idx_processing_queue_worker_select": {
|
|
1452
|
+
"name": "idx_processing_queue_worker_select",
|
|
1453
|
+
"columns": [
|
|
1454
|
+
{
|
|
1455
|
+
"expression": "status",
|
|
1456
|
+
"isExpression": false,
|
|
1457
|
+
"asc": true,
|
|
1458
|
+
"nulls": "last"
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
"expression": "stage",
|
|
1462
|
+
"isExpression": false,
|
|
1463
|
+
"asc": true,
|
|
1464
|
+
"nulls": "last"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"expression": "priority",
|
|
1468
|
+
"isExpression": false,
|
|
1469
|
+
"asc": true,
|
|
1470
|
+
"nulls": "last"
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
"expression": "scheduled_at",
|
|
1474
|
+
"isExpression": false,
|
|
1475
|
+
"asc": true,
|
|
1476
|
+
"nulls": "last"
|
|
1477
|
+
}
|
|
1478
|
+
],
|
|
1479
|
+
"isUnique": false,
|
|
1480
|
+
"where": "\"processing_queue\".\"status\" IN ('pending', 'retry')",
|
|
1481
|
+
"concurrently": false,
|
|
1482
|
+
"method": "btree",
|
|
1483
|
+
"with": {}
|
|
1484
|
+
}
|
|
1485
|
+
},
|
|
1486
|
+
"foreignKeys": {
|
|
1487
|
+
"processing_queue_document_id_documents_id_fk": {
|
|
1488
|
+
"name": "processing_queue_document_id_documents_id_fk",
|
|
1489
|
+
"tableFrom": "processing_queue",
|
|
1490
|
+
"tableTo": "documents",
|
|
1491
|
+
"columnsFrom": [
|
|
1492
|
+
"document_id"
|
|
1493
|
+
],
|
|
1494
|
+
"columnsTo": [
|
|
1495
|
+
"id"
|
|
1496
|
+
],
|
|
1497
|
+
"onDelete": "cascade",
|
|
1498
|
+
"onUpdate": "no action"
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
"compositePrimaryKeys": {},
|
|
1502
|
+
"uniqueConstraints": {},
|
|
1503
|
+
"policies": {},
|
|
1504
|
+
"checkConstraints": {
|
|
1505
|
+
"processing_queue_stage_check": {
|
|
1506
|
+
"name": "processing_queue_stage_check",
|
|
1507
|
+
"value": "\"processing_queue\".\"stage\" IN ('extraction', 'embedding', 'deduplication', 'relationship', 'profile_update', 'cleanup')"
|
|
1508
|
+
},
|
|
1509
|
+
"processing_queue_status_check": {
|
|
1510
|
+
"name": "processing_queue_status_check",
|
|
1511
|
+
"value": "\"processing_queue\".\"status\" IN ('pending', 'processing', 'completed', 'failed', 'cancelled', 'retry')"
|
|
1512
|
+
},
|
|
1513
|
+
"processing_queue_attempts_check": {
|
|
1514
|
+
"name": "processing_queue_attempts_check",
|
|
1515
|
+
"value": "\"processing_queue\".\"attempts\" <= \"processing_queue\".\"max_attempts\""
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
"isRLSEnabled": false
|
|
1519
|
+
}
|
|
1520
|
+
},
|
|
1521
|
+
"enums": {},
|
|
1522
|
+
"schemas": {},
|
|
1523
|
+
"sequences": {},
|
|
1524
|
+
"roles": {},
|
|
1525
|
+
"policies": {},
|
|
1526
|
+
"views": {},
|
|
1527
|
+
"_meta": {
|
|
1528
|
+
"columns": {},
|
|
1529
|
+
"schemas": {},
|
|
1530
|
+
"tables": {}
|
|
1531
|
+
}
|
|
1532
|
+
}
|