ltcai 4.1.0 → 4.2.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/README.md +28 -24
- package/docs/CHANGELOG.md +42 -0
- package/docs/V4_2_BRAIN_CORE_ARCHITECTURE.md +97 -0
- package/docs/V4_2_STORAGE_MIGRATION_REPORT.md +91 -0
- package/docs/V4_2_VALIDATION_REPORT.md +89 -0
- package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +31 -33
- package/frontend/openapi.json +247 -1
- package/frontend/src/api/client.ts +3 -0
- package/frontend/src/api/openapi.ts +284 -0
- package/frontend/src/pages/System.tsx +34 -0
- package/kg_schema.py +1 -1
- package/knowledge_graph.py +4 -4
- package/lattice_brain/__init__.py +70 -0
- package/lattice_brain/_kg_common.py +1 -0
- package/lattice_brain/archive.py +133 -0
- package/lattice_brain/context.py +3 -0
- package/lattice_brain/conversations.py +3 -0
- package/lattice_brain/core.py +82 -0
- package/lattice_brain/discovery.py +1 -0
- package/lattice_brain/documents.py +1 -0
- package/lattice_brain/embeddings.py +82 -0
- package/lattice_brain/identity.py +13 -0
- package/lattice_brain/ingest.py +1 -0
- package/lattice_brain/memory.py +3 -0
- package/lattice_brain/network.py +1 -0
- package/lattice_brain/projection.py +1 -0
- package/lattice_brain/provenance.py +1 -0
- package/lattice_brain/retrieval.py +1 -0
- package/lattice_brain/schema.py +1 -0
- package/lattice_brain/storage/__init__.py +22 -0
- package/lattice_brain/storage/base.py +72 -0
- package/lattice_brain/storage/docker.py +105 -0
- package/lattice_brain/storage/factory.py +31 -0
- package/lattice_brain/storage/migration.py +190 -0
- package/lattice_brain/storage/postgres.py +123 -0
- package/lattice_brain/storage/sqlite.py +128 -0
- package/lattice_brain/store.py +3 -0
- package/lattice_brain/write_master.py +1 -0
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/portability.py +69 -0
- package/latticeai/app_factory.py +17 -10
- package/latticeai/brain/__init__.py +6 -6
- package/latticeai/brain/_kg_common.py +1 -1
- package/latticeai/brain/network.py +1 -1
- package/latticeai/brain/retrieval.py +15 -0
- package/latticeai/brain/store.py +22 -6
- package/latticeai/core/config.py +8 -0
- package/latticeai/core/marketplace.py +1 -1
- package/latticeai/core/multi_agent.py +1 -1
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/services/kg_portability.py +82 -1
- package/package.json +2 -1
- package/scripts/bump_version.py +3 -0
- package/scripts/lint_frontend.mjs +5 -0
- package/scripts/migrate_brain_storage.py +53 -0
- package/scripts/wheel_smoke.py +3 -0
- package/src-tauri/Cargo.lock +1 -1
- package/src-tauri/Cargo.toml +1 -1
- package/src-tauri/tauri.conf.json +5 -2
- package/static/app/asset-manifest.json +5 -5
- package/static/app/assets/index-CDjiH_se.css +2 -0
- package/static/app/assets/{index-CJRAzNnf.js → index-C_HAkbAg.js} +3 -3
- package/static/app/assets/index-C_HAkbAg.js.map +1 -0
- package/static/app/index.html +2 -2
- package/static/app/assets/index-CJRAzNnf.js.map +0 -1
- package/static/app/assets/index-CSwBBgf4.css +0 -2
package/frontend/openapi.json
CHANGED
|
@@ -686,6 +686,69 @@
|
|
|
686
686
|
"title": "CuTypeRequest",
|
|
687
687
|
"type": "object"
|
|
688
688
|
},
|
|
689
|
+
"DockerPostgresRequest": {
|
|
690
|
+
"properties": {
|
|
691
|
+
"consent": {
|
|
692
|
+
"default": false,
|
|
693
|
+
"title": "Consent",
|
|
694
|
+
"type": "boolean"
|
|
695
|
+
},
|
|
696
|
+
"dry_run": {
|
|
697
|
+
"default": false,
|
|
698
|
+
"title": "Dry Run",
|
|
699
|
+
"type": "boolean"
|
|
700
|
+
},
|
|
701
|
+
"port": {
|
|
702
|
+
"default": 5432,
|
|
703
|
+
"title": "Port",
|
|
704
|
+
"type": "integer"
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
"title": "DockerPostgresRequest",
|
|
708
|
+
"type": "object"
|
|
709
|
+
},
|
|
710
|
+
"EncryptedArchiveRequest": {
|
|
711
|
+
"properties": {
|
|
712
|
+
"passphrase": {
|
|
713
|
+
"title": "Passphrase",
|
|
714
|
+
"type": "string"
|
|
715
|
+
},
|
|
716
|
+
"path": {
|
|
717
|
+
"anyOf": [
|
|
718
|
+
{
|
|
719
|
+
"type": "string"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"type": "null"
|
|
723
|
+
}
|
|
724
|
+
],
|
|
725
|
+
"title": "Path"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
"required": [
|
|
729
|
+
"passphrase"
|
|
730
|
+
],
|
|
731
|
+
"title": "EncryptedArchiveRequest",
|
|
732
|
+
"type": "object"
|
|
733
|
+
},
|
|
734
|
+
"EncryptedRestoreRequest": {
|
|
735
|
+
"properties": {
|
|
736
|
+
"passphrase": {
|
|
737
|
+
"title": "Passphrase",
|
|
738
|
+
"type": "string"
|
|
739
|
+
},
|
|
740
|
+
"path": {
|
|
741
|
+
"title": "Path",
|
|
742
|
+
"type": "string"
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"required": [
|
|
746
|
+
"path",
|
|
747
|
+
"passphrase"
|
|
748
|
+
],
|
|
749
|
+
"title": "EncryptedRestoreRequest",
|
|
750
|
+
"type": "object"
|
|
751
|
+
},
|
|
689
752
|
"ExportRequest": {
|
|
690
753
|
"properties": {
|
|
691
754
|
"filters": {
|
|
@@ -1899,6 +1962,29 @@
|
|
|
1899
1962
|
"title": "RestoreRequest",
|
|
1900
1963
|
"type": "object"
|
|
1901
1964
|
},
|
|
1965
|
+
"SQLiteToPostgresRequest": {
|
|
1966
|
+
"properties": {
|
|
1967
|
+
"dry_run": {
|
|
1968
|
+
"default": true,
|
|
1969
|
+
"title": "Dry Run",
|
|
1970
|
+
"type": "boolean"
|
|
1971
|
+
},
|
|
1972
|
+
"dsn": {
|
|
1973
|
+
"title": "Dsn",
|
|
1974
|
+
"type": "string"
|
|
1975
|
+
},
|
|
1976
|
+
"schema_name": {
|
|
1977
|
+
"default": "lattice_brain",
|
|
1978
|
+
"title": "Schema Name",
|
|
1979
|
+
"type": "string"
|
|
1980
|
+
}
|
|
1981
|
+
},
|
|
1982
|
+
"required": [
|
|
1983
|
+
"dsn"
|
|
1984
|
+
],
|
|
1985
|
+
"title": "SQLiteToPostgresRequest",
|
|
1986
|
+
"type": "object"
|
|
1987
|
+
},
|
|
1902
1988
|
"SearchRequest": {
|
|
1903
1989
|
"properties": {
|
|
1904
1990
|
"limit": {
|
|
@@ -3395,7 +3481,7 @@
|
|
|
3395
3481
|
},
|
|
3396
3482
|
"info": {
|
|
3397
3483
|
"title": "Lattice AI Server (local)",
|
|
3398
|
-
"version": "4.
|
|
3484
|
+
"version": "4.2.0"
|
|
3399
3485
|
},
|
|
3400
3486
|
"openapi": "3.1.0",
|
|
3401
3487
|
"paths": {
|
|
@@ -5102,6 +5188,94 @@
|
|
|
5102
5188
|
"summary": "Agent Runtime Status"
|
|
5103
5189
|
}
|
|
5104
5190
|
},
|
|
5191
|
+
"/api/brain/storage": {
|
|
5192
|
+
"get": {
|
|
5193
|
+
"operationId": "brain_storage_status_api_brain_storage_get",
|
|
5194
|
+
"responses": {
|
|
5195
|
+
"200": {
|
|
5196
|
+
"content": {
|
|
5197
|
+
"application/json": {
|
|
5198
|
+
"schema": {}
|
|
5199
|
+
}
|
|
5200
|
+
},
|
|
5201
|
+
"description": "Successful Response"
|
|
5202
|
+
}
|
|
5203
|
+
},
|
|
5204
|
+
"summary": "Brain Storage Status"
|
|
5205
|
+
}
|
|
5206
|
+
},
|
|
5207
|
+
"/api/brain/storage/migrate-postgres": {
|
|
5208
|
+
"post": {
|
|
5209
|
+
"operationId": "migrate_sqlite_to_postgres_api_brain_storage_migrate_postgres_post",
|
|
5210
|
+
"requestBody": {
|
|
5211
|
+
"content": {
|
|
5212
|
+
"application/json": {
|
|
5213
|
+
"schema": {
|
|
5214
|
+
"$ref": "#/components/schemas/SQLiteToPostgresRequest"
|
|
5215
|
+
}
|
|
5216
|
+
}
|
|
5217
|
+
},
|
|
5218
|
+
"required": true
|
|
5219
|
+
},
|
|
5220
|
+
"responses": {
|
|
5221
|
+
"200": {
|
|
5222
|
+
"content": {
|
|
5223
|
+
"application/json": {
|
|
5224
|
+
"schema": {}
|
|
5225
|
+
}
|
|
5226
|
+
},
|
|
5227
|
+
"description": "Successful Response"
|
|
5228
|
+
},
|
|
5229
|
+
"422": {
|
|
5230
|
+
"content": {
|
|
5231
|
+
"application/json": {
|
|
5232
|
+
"schema": {
|
|
5233
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5236
|
+
},
|
|
5237
|
+
"description": "Validation Error"
|
|
5238
|
+
}
|
|
5239
|
+
},
|
|
5240
|
+
"summary": "Migrate Sqlite To Postgres"
|
|
5241
|
+
}
|
|
5242
|
+
},
|
|
5243
|
+
"/api/brain/storage/postgres/docker": {
|
|
5244
|
+
"post": {
|
|
5245
|
+
"operationId": "setup_postgres_docker_api_brain_storage_postgres_docker_post",
|
|
5246
|
+
"requestBody": {
|
|
5247
|
+
"content": {
|
|
5248
|
+
"application/json": {
|
|
5249
|
+
"schema": {
|
|
5250
|
+
"$ref": "#/components/schemas/DockerPostgresRequest"
|
|
5251
|
+
}
|
|
5252
|
+
}
|
|
5253
|
+
},
|
|
5254
|
+
"required": true
|
|
5255
|
+
},
|
|
5256
|
+
"responses": {
|
|
5257
|
+
"200": {
|
|
5258
|
+
"content": {
|
|
5259
|
+
"application/json": {
|
|
5260
|
+
"schema": {}
|
|
5261
|
+
}
|
|
5262
|
+
},
|
|
5263
|
+
"description": "Successful Response"
|
|
5264
|
+
},
|
|
5265
|
+
"422": {
|
|
5266
|
+
"content": {
|
|
5267
|
+
"application/json": {
|
|
5268
|
+
"schema": {
|
|
5269
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
},
|
|
5273
|
+
"description": "Validation Error"
|
|
5274
|
+
}
|
|
5275
|
+
},
|
|
5276
|
+
"summary": "Setup Postgres Docker"
|
|
5277
|
+
}
|
|
5278
|
+
},
|
|
5105
5279
|
"/api/browser/ingest-current-tab": {
|
|
5106
5280
|
"post": {
|
|
5107
5281
|
"description": "Ingest a payload captured from the local browser extension.",
|
|
@@ -5946,6 +6120,78 @@
|
|
|
5946
6120
|
"summary": "Index Status"
|
|
5947
6121
|
}
|
|
5948
6122
|
},
|
|
6123
|
+
"/api/knowledge-graph/archive": {
|
|
6124
|
+
"post": {
|
|
6125
|
+
"operationId": "encrypted_archive_api_knowledge_graph_archive_post",
|
|
6126
|
+
"requestBody": {
|
|
6127
|
+
"content": {
|
|
6128
|
+
"application/json": {
|
|
6129
|
+
"schema": {
|
|
6130
|
+
"$ref": "#/components/schemas/EncryptedArchiveRequest"
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
},
|
|
6134
|
+
"required": true
|
|
6135
|
+
},
|
|
6136
|
+
"responses": {
|
|
6137
|
+
"200": {
|
|
6138
|
+
"content": {
|
|
6139
|
+
"application/json": {
|
|
6140
|
+
"schema": {}
|
|
6141
|
+
}
|
|
6142
|
+
},
|
|
6143
|
+
"description": "Successful Response"
|
|
6144
|
+
},
|
|
6145
|
+
"422": {
|
|
6146
|
+
"content": {
|
|
6147
|
+
"application/json": {
|
|
6148
|
+
"schema": {
|
|
6149
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
},
|
|
6153
|
+
"description": "Validation Error"
|
|
6154
|
+
}
|
|
6155
|
+
},
|
|
6156
|
+
"summary": "Encrypted Archive"
|
|
6157
|
+
}
|
|
6158
|
+
},
|
|
6159
|
+
"/api/knowledge-graph/archive/restore": {
|
|
6160
|
+
"post": {
|
|
6161
|
+
"operationId": "restore_encrypted_archive_api_knowledge_graph_archive_restore_post",
|
|
6162
|
+
"requestBody": {
|
|
6163
|
+
"content": {
|
|
6164
|
+
"application/json": {
|
|
6165
|
+
"schema": {
|
|
6166
|
+
"$ref": "#/components/schemas/EncryptedRestoreRequest"
|
|
6167
|
+
}
|
|
6168
|
+
}
|
|
6169
|
+
},
|
|
6170
|
+
"required": true
|
|
6171
|
+
},
|
|
6172
|
+
"responses": {
|
|
6173
|
+
"200": {
|
|
6174
|
+
"content": {
|
|
6175
|
+
"application/json": {
|
|
6176
|
+
"schema": {}
|
|
6177
|
+
}
|
|
6178
|
+
},
|
|
6179
|
+
"description": "Successful Response"
|
|
6180
|
+
},
|
|
6181
|
+
"422": {
|
|
6182
|
+
"content": {
|
|
6183
|
+
"application/json": {
|
|
6184
|
+
"schema": {
|
|
6185
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
6186
|
+
}
|
|
6187
|
+
}
|
|
6188
|
+
},
|
|
6189
|
+
"description": "Validation Error"
|
|
6190
|
+
}
|
|
6191
|
+
},
|
|
6192
|
+
"summary": "Restore Encrypted Archive"
|
|
6193
|
+
}
|
|
6194
|
+
},
|
|
5949
6195
|
"/api/knowledge-graph/backup": {
|
|
5950
6196
|
"post": {
|
|
5951
6197
|
"operationId": "backup_graph_api_knowledge_graph_backup_post",
|
|
@@ -210,6 +210,9 @@ export const latticeApi = {
|
|
|
210
210
|
graph: () => get("/knowledge-graph/graph", { nodes: [], edges: [] }),
|
|
211
211
|
graphStats: () => get("/knowledge-graph/stats", { nodes: {}, edges: {}, total_nodes: 0, total_edges: 0 }),
|
|
212
212
|
graphPortability: () => get("/api/knowledge-graph/portability", {}),
|
|
213
|
+
brainStorage: () => get("/api/brain/storage", {}),
|
|
214
|
+
dockerPostgres: (body: { consent: boolean; dry_run?: boolean; port?: number }) => post("/api/brain/storage/postgres/docker", body, {}),
|
|
215
|
+
migratePostgres: (body: { dsn: string; schema_name?: string; dry_run?: boolean }) => post("/api/brain/storage/migrate-postgres", body, {}),
|
|
213
216
|
graphProvenance: (limit = 50) => get("/api/knowledge-graph/provenance", { items: [] }, { limit }),
|
|
214
217
|
graphCoverage: () => get("/knowledge-graph/provenance/coverage", {}),
|
|
215
218
|
graphExport: () => post("/api/knowledge-graph/export", {}, {}),
|
|
@@ -892,6 +892,57 @@ export interface paths {
|
|
|
892
892
|
patch?: never;
|
|
893
893
|
trace?: never;
|
|
894
894
|
};
|
|
895
|
+
"/api/brain/storage": {
|
|
896
|
+
parameters: {
|
|
897
|
+
query?: never;
|
|
898
|
+
header?: never;
|
|
899
|
+
path?: never;
|
|
900
|
+
cookie?: never;
|
|
901
|
+
};
|
|
902
|
+
/** Brain Storage Status */
|
|
903
|
+
get: operations["brain_storage_status_api_brain_storage_get"];
|
|
904
|
+
put?: never;
|
|
905
|
+
post?: never;
|
|
906
|
+
delete?: never;
|
|
907
|
+
options?: never;
|
|
908
|
+
head?: never;
|
|
909
|
+
patch?: never;
|
|
910
|
+
trace?: never;
|
|
911
|
+
};
|
|
912
|
+
"/api/brain/storage/migrate-postgres": {
|
|
913
|
+
parameters: {
|
|
914
|
+
query?: never;
|
|
915
|
+
header?: never;
|
|
916
|
+
path?: never;
|
|
917
|
+
cookie?: never;
|
|
918
|
+
};
|
|
919
|
+
get?: never;
|
|
920
|
+
put?: never;
|
|
921
|
+
/** Migrate Sqlite To Postgres */
|
|
922
|
+
post: operations["migrate_sqlite_to_postgres_api_brain_storage_migrate_postgres_post"];
|
|
923
|
+
delete?: never;
|
|
924
|
+
options?: never;
|
|
925
|
+
head?: never;
|
|
926
|
+
patch?: never;
|
|
927
|
+
trace?: never;
|
|
928
|
+
};
|
|
929
|
+
"/api/brain/storage/postgres/docker": {
|
|
930
|
+
parameters: {
|
|
931
|
+
query?: never;
|
|
932
|
+
header?: never;
|
|
933
|
+
path?: never;
|
|
934
|
+
cookie?: never;
|
|
935
|
+
};
|
|
936
|
+
get?: never;
|
|
937
|
+
put?: never;
|
|
938
|
+
/** Setup Postgres Docker */
|
|
939
|
+
post: operations["setup_postgres_docker_api_brain_storage_postgres_docker_post"];
|
|
940
|
+
delete?: never;
|
|
941
|
+
options?: never;
|
|
942
|
+
head?: never;
|
|
943
|
+
patch?: never;
|
|
944
|
+
trace?: never;
|
|
945
|
+
};
|
|
895
946
|
"/api/browser/ingest-current-tab": {
|
|
896
947
|
parameters: {
|
|
897
948
|
query?: never;
|
|
@@ -1212,6 +1263,40 @@ export interface paths {
|
|
|
1212
1263
|
patch?: never;
|
|
1213
1264
|
trace?: never;
|
|
1214
1265
|
};
|
|
1266
|
+
"/api/knowledge-graph/archive": {
|
|
1267
|
+
parameters: {
|
|
1268
|
+
query?: never;
|
|
1269
|
+
header?: never;
|
|
1270
|
+
path?: never;
|
|
1271
|
+
cookie?: never;
|
|
1272
|
+
};
|
|
1273
|
+
get?: never;
|
|
1274
|
+
put?: never;
|
|
1275
|
+
/** Encrypted Archive */
|
|
1276
|
+
post: operations["encrypted_archive_api_knowledge_graph_archive_post"];
|
|
1277
|
+
delete?: never;
|
|
1278
|
+
options?: never;
|
|
1279
|
+
head?: never;
|
|
1280
|
+
patch?: never;
|
|
1281
|
+
trace?: never;
|
|
1282
|
+
};
|
|
1283
|
+
"/api/knowledge-graph/archive/restore": {
|
|
1284
|
+
parameters: {
|
|
1285
|
+
query?: never;
|
|
1286
|
+
header?: never;
|
|
1287
|
+
path?: never;
|
|
1288
|
+
cookie?: never;
|
|
1289
|
+
};
|
|
1290
|
+
get?: never;
|
|
1291
|
+
put?: never;
|
|
1292
|
+
/** Restore Encrypted Archive */
|
|
1293
|
+
post: operations["restore_encrypted_archive_api_knowledge_graph_archive_restore_post"];
|
|
1294
|
+
delete?: never;
|
|
1295
|
+
options?: never;
|
|
1296
|
+
head?: never;
|
|
1297
|
+
patch?: never;
|
|
1298
|
+
trace?: never;
|
|
1299
|
+
};
|
|
1215
1300
|
"/api/knowledge-graph/backup": {
|
|
1216
1301
|
parameters: {
|
|
1217
1302
|
query?: never;
|
|
@@ -5712,6 +5797,38 @@ export interface components {
|
|
|
5712
5797
|
/** Text */
|
|
5713
5798
|
text: string;
|
|
5714
5799
|
};
|
|
5800
|
+
/** DockerPostgresRequest */
|
|
5801
|
+
DockerPostgresRequest: {
|
|
5802
|
+
/**
|
|
5803
|
+
* Consent
|
|
5804
|
+
* @default false
|
|
5805
|
+
*/
|
|
5806
|
+
consent: boolean;
|
|
5807
|
+
/**
|
|
5808
|
+
* Dry Run
|
|
5809
|
+
* @default false
|
|
5810
|
+
*/
|
|
5811
|
+
dry_run: boolean;
|
|
5812
|
+
/**
|
|
5813
|
+
* Port
|
|
5814
|
+
* @default 5432
|
|
5815
|
+
*/
|
|
5816
|
+
port: number;
|
|
5817
|
+
};
|
|
5818
|
+
/** EncryptedArchiveRequest */
|
|
5819
|
+
EncryptedArchiveRequest: {
|
|
5820
|
+
/** Passphrase */
|
|
5821
|
+
passphrase: string;
|
|
5822
|
+
/** Path */
|
|
5823
|
+
path?: string | null;
|
|
5824
|
+
};
|
|
5825
|
+
/** EncryptedRestoreRequest */
|
|
5826
|
+
EncryptedRestoreRequest: {
|
|
5827
|
+
/** Passphrase */
|
|
5828
|
+
passphrase: string;
|
|
5829
|
+
/** Path */
|
|
5830
|
+
path: string;
|
|
5831
|
+
};
|
|
5715
5832
|
/** ExportRequest */
|
|
5716
5833
|
ExportRequest: {
|
|
5717
5834
|
/** Filters */
|
|
@@ -6280,6 +6397,21 @@ export interface components {
|
|
|
6280
6397
|
*/
|
|
6281
6398
|
verify: boolean;
|
|
6282
6399
|
};
|
|
6400
|
+
/** SQLiteToPostgresRequest */
|
|
6401
|
+
SQLiteToPostgresRequest: {
|
|
6402
|
+
/**
|
|
6403
|
+
* Dry Run
|
|
6404
|
+
* @default true
|
|
6405
|
+
*/
|
|
6406
|
+
dry_run: boolean;
|
|
6407
|
+
/** Dsn */
|
|
6408
|
+
dsn: string;
|
|
6409
|
+
/**
|
|
6410
|
+
* Schema Name
|
|
6411
|
+
* @default lattice_brain
|
|
6412
|
+
*/
|
|
6413
|
+
schema_name: string;
|
|
6414
|
+
};
|
|
6283
6415
|
/** SearchRequest */
|
|
6284
6416
|
SearchRequest: {
|
|
6285
6417
|
/**
|
|
@@ -8576,6 +8708,92 @@ export interface operations {
|
|
|
8576
8708
|
};
|
|
8577
8709
|
};
|
|
8578
8710
|
};
|
|
8711
|
+
brain_storage_status_api_brain_storage_get: {
|
|
8712
|
+
parameters: {
|
|
8713
|
+
query?: never;
|
|
8714
|
+
header?: never;
|
|
8715
|
+
path?: never;
|
|
8716
|
+
cookie?: never;
|
|
8717
|
+
};
|
|
8718
|
+
requestBody?: never;
|
|
8719
|
+
responses: {
|
|
8720
|
+
/** @description Successful Response */
|
|
8721
|
+
200: {
|
|
8722
|
+
headers: {
|
|
8723
|
+
[name: string]: unknown;
|
|
8724
|
+
};
|
|
8725
|
+
content: {
|
|
8726
|
+
"application/json": unknown;
|
|
8727
|
+
};
|
|
8728
|
+
};
|
|
8729
|
+
};
|
|
8730
|
+
};
|
|
8731
|
+
migrate_sqlite_to_postgres_api_brain_storage_migrate_postgres_post: {
|
|
8732
|
+
parameters: {
|
|
8733
|
+
query?: never;
|
|
8734
|
+
header?: never;
|
|
8735
|
+
path?: never;
|
|
8736
|
+
cookie?: never;
|
|
8737
|
+
};
|
|
8738
|
+
requestBody: {
|
|
8739
|
+
content: {
|
|
8740
|
+
"application/json": components["schemas"]["SQLiteToPostgresRequest"];
|
|
8741
|
+
};
|
|
8742
|
+
};
|
|
8743
|
+
responses: {
|
|
8744
|
+
/** @description Successful Response */
|
|
8745
|
+
200: {
|
|
8746
|
+
headers: {
|
|
8747
|
+
[name: string]: unknown;
|
|
8748
|
+
};
|
|
8749
|
+
content: {
|
|
8750
|
+
"application/json": unknown;
|
|
8751
|
+
};
|
|
8752
|
+
};
|
|
8753
|
+
/** @description Validation Error */
|
|
8754
|
+
422: {
|
|
8755
|
+
headers: {
|
|
8756
|
+
[name: string]: unknown;
|
|
8757
|
+
};
|
|
8758
|
+
content: {
|
|
8759
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
8760
|
+
};
|
|
8761
|
+
};
|
|
8762
|
+
};
|
|
8763
|
+
};
|
|
8764
|
+
setup_postgres_docker_api_brain_storage_postgres_docker_post: {
|
|
8765
|
+
parameters: {
|
|
8766
|
+
query?: never;
|
|
8767
|
+
header?: never;
|
|
8768
|
+
path?: never;
|
|
8769
|
+
cookie?: never;
|
|
8770
|
+
};
|
|
8771
|
+
requestBody: {
|
|
8772
|
+
content: {
|
|
8773
|
+
"application/json": components["schemas"]["DockerPostgresRequest"];
|
|
8774
|
+
};
|
|
8775
|
+
};
|
|
8776
|
+
responses: {
|
|
8777
|
+
/** @description Successful Response */
|
|
8778
|
+
200: {
|
|
8779
|
+
headers: {
|
|
8780
|
+
[name: string]: unknown;
|
|
8781
|
+
};
|
|
8782
|
+
content: {
|
|
8783
|
+
"application/json": unknown;
|
|
8784
|
+
};
|
|
8785
|
+
};
|
|
8786
|
+
/** @description Validation Error */
|
|
8787
|
+
422: {
|
|
8788
|
+
headers: {
|
|
8789
|
+
[name: string]: unknown;
|
|
8790
|
+
};
|
|
8791
|
+
content: {
|
|
8792
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
8793
|
+
};
|
|
8794
|
+
};
|
|
8795
|
+
};
|
|
8796
|
+
};
|
|
8579
8797
|
ingest_current_tab_api_browser_ingest_current_tab_post: {
|
|
8580
8798
|
parameters: {
|
|
8581
8799
|
query?: never;
|
|
@@ -9252,6 +9470,72 @@ export interface operations {
|
|
|
9252
9470
|
};
|
|
9253
9471
|
};
|
|
9254
9472
|
};
|
|
9473
|
+
encrypted_archive_api_knowledge_graph_archive_post: {
|
|
9474
|
+
parameters: {
|
|
9475
|
+
query?: never;
|
|
9476
|
+
header?: never;
|
|
9477
|
+
path?: never;
|
|
9478
|
+
cookie?: never;
|
|
9479
|
+
};
|
|
9480
|
+
requestBody: {
|
|
9481
|
+
content: {
|
|
9482
|
+
"application/json": components["schemas"]["EncryptedArchiveRequest"];
|
|
9483
|
+
};
|
|
9484
|
+
};
|
|
9485
|
+
responses: {
|
|
9486
|
+
/** @description Successful Response */
|
|
9487
|
+
200: {
|
|
9488
|
+
headers: {
|
|
9489
|
+
[name: string]: unknown;
|
|
9490
|
+
};
|
|
9491
|
+
content: {
|
|
9492
|
+
"application/json": unknown;
|
|
9493
|
+
};
|
|
9494
|
+
};
|
|
9495
|
+
/** @description Validation Error */
|
|
9496
|
+
422: {
|
|
9497
|
+
headers: {
|
|
9498
|
+
[name: string]: unknown;
|
|
9499
|
+
};
|
|
9500
|
+
content: {
|
|
9501
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
9502
|
+
};
|
|
9503
|
+
};
|
|
9504
|
+
};
|
|
9505
|
+
};
|
|
9506
|
+
restore_encrypted_archive_api_knowledge_graph_archive_restore_post: {
|
|
9507
|
+
parameters: {
|
|
9508
|
+
query?: never;
|
|
9509
|
+
header?: never;
|
|
9510
|
+
path?: never;
|
|
9511
|
+
cookie?: never;
|
|
9512
|
+
};
|
|
9513
|
+
requestBody: {
|
|
9514
|
+
content: {
|
|
9515
|
+
"application/json": components["schemas"]["EncryptedRestoreRequest"];
|
|
9516
|
+
};
|
|
9517
|
+
};
|
|
9518
|
+
responses: {
|
|
9519
|
+
/** @description Successful Response */
|
|
9520
|
+
200: {
|
|
9521
|
+
headers: {
|
|
9522
|
+
[name: string]: unknown;
|
|
9523
|
+
};
|
|
9524
|
+
content: {
|
|
9525
|
+
"application/json": unknown;
|
|
9526
|
+
};
|
|
9527
|
+
};
|
|
9528
|
+
/** @description Validation Error */
|
|
9529
|
+
422: {
|
|
9530
|
+
headers: {
|
|
9531
|
+
[name: string]: unknown;
|
|
9532
|
+
};
|
|
9533
|
+
content: {
|
|
9534
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
9535
|
+
};
|
|
9536
|
+
};
|
|
9537
|
+
};
|
|
9538
|
+
};
|
|
9255
9539
|
backup_graph_api_knowledge_graph_backup_post: {
|
|
9256
9540
|
parameters: {
|
|
9257
9541
|
query?: never;
|
|
@@ -279,6 +279,14 @@ function SettingsPanel() {
|
|
|
279
279
|
const health = useQuery({ queryKey: ["health"], queryFn: latticeApi.health });
|
|
280
280
|
const sys = useQuery({ queryKey: ["sysinfo"], queryFn: latticeApi.sysinfo });
|
|
281
281
|
const comp = useQuery({ queryKey: ["computerMemory"], queryFn: latticeApi.computerMemory });
|
|
282
|
+
const storage = useQuery({ queryKey: ["brainStorage"], queryFn: latticeApi.brainStorage });
|
|
283
|
+
const [dsn, setDsn] = React.useState("");
|
|
284
|
+
const [schema, setSchema] = React.useState("lattice_brain");
|
|
285
|
+
const [dockerConsent, setDockerConsent] = React.useState(false);
|
|
286
|
+
const docker = useMutation({ mutationFn: (consent: boolean) => latticeApi.dockerPostgres({ consent, dry_run: !consent, port: 5432 }) });
|
|
287
|
+
const migration = useMutation({
|
|
288
|
+
mutationFn: () => latticeApi.migratePostgres({ dsn, schema_name: schema || "lattice_brain", dry_run: true }),
|
|
289
|
+
});
|
|
282
290
|
return (
|
|
283
291
|
<div className="grid gap-4 xl:grid-cols-3">
|
|
284
292
|
<Card>
|
|
@@ -300,6 +308,32 @@ function SettingsPanel() {
|
|
|
300
308
|
<DataPanel title="Host telemetry" result={sys.data}>
|
|
301
309
|
{(data) => <JsonView value={data} />}
|
|
302
310
|
</DataPanel>
|
|
311
|
+
<DataPanel title="Brain storage" result={storage.data} className="xl:col-span-3">
|
|
312
|
+
{(data) => <JsonView value={data} />}
|
|
313
|
+
</DataPanel>
|
|
314
|
+
<Card className="xl:col-span-3">
|
|
315
|
+
<CardHeader>
|
|
316
|
+
<CardTitle>Postgres scale mode</CardTitle>
|
|
317
|
+
<CardDescription>Opt-in migration and Docker setup; SQLite remains the default.</CardDescription>
|
|
318
|
+
</CardHeader>
|
|
319
|
+
<CardContent className="grid gap-3">
|
|
320
|
+
<div className="grid gap-2 sm:grid-cols-[1fr_220px]">
|
|
321
|
+
<Input value={dsn} onChange={(e) => setDsn(e.target.value)} placeholder="postgresql://user:pass@127.0.0.1:5432/lattice_brain" />
|
|
322
|
+
<Input value={schema} onChange={(e) => setSchema(e.target.value)} placeholder="schema" />
|
|
323
|
+
</div>
|
|
324
|
+
<div className="flex flex-wrap gap-2">
|
|
325
|
+
<Button variant="outline" onClick={() => docker.mutate(false)} disabled={docker.isPending}>Docker plan</Button>
|
|
326
|
+
<label className="flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm">
|
|
327
|
+
<input type="checkbox" checked={dockerConsent} onChange={(e) => setDockerConsent(e.target.checked)} />
|
|
328
|
+
Consent to start Docker
|
|
329
|
+
</label>
|
|
330
|
+
<Button onClick={() => docker.mutate(true)} disabled={!dockerConsent || docker.isPending}>Start Docker</Button>
|
|
331
|
+
<Button variant="outline" onClick={() => migration.mutate()} disabled={!dsn || migration.isPending}>Plan migration</Button>
|
|
332
|
+
</div>
|
|
333
|
+
{docker.data ? <JsonView value={docker.data.data || docker.data.error} /> : null}
|
|
334
|
+
{migration.data ? <JsonView value={migration.data.data || migration.data.error} /> : null}
|
|
335
|
+
</CardContent>
|
|
336
|
+
</Card>
|
|
303
337
|
<DataPanel title="Computer memory" result={comp.data} className="xl:col-span-3">
|
|
304
338
|
{(data) => (
|
|
305
339
|
<div className="space-y-3">
|
package/kg_schema.py
CHANGED
package/knowledge_graph.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"""Compatibility shim for the v4 brain store.
|
|
1
|
+
"""Compatibility shim for the v4.2 lattice-brain store.
|
|
2
2
|
|
|
3
|
-
The implementation now lives under :mod:`
|
|
3
|
+
The implementation now lives under :mod:`lattice_brain`. Root imports are
|
|
4
4
|
kept for older integrations and tests.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from lattice_brain._kg_common import ( # noqa: F401
|
|
8
8
|
EDGE_VERB,
|
|
9
9
|
GRAPH_SCHEMA_VERSION,
|
|
10
10
|
LOCAL_CODE_EXTENSIONS,
|
|
@@ -24,7 +24,7 @@ from latticeai.brain._kg_common import ( # noqa: F401
|
|
|
24
24
|
_slug,
|
|
25
25
|
set_llm_router,
|
|
26
26
|
)
|
|
27
|
-
from
|
|
27
|
+
from lattice_brain.store import KnowledgeGraphStore
|
|
28
28
|
|
|
29
29
|
__all__ = [
|
|
30
30
|
"KnowledgeGraphStore",
|