@workglow/dataset 0.0.110 → 0.0.114
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 +504 -968
- package/dist/browser.js +376 -490
- package/dist/browser.js.map +13 -13
- package/dist/bun.js +376 -490
- package/dist/bun.js.map +13 -13
- package/dist/chunk/ChunkSchema.d.ts +206 -0
- package/dist/chunk/ChunkSchema.d.ts.map +1 -0
- package/dist/chunk/ChunkVectorStorageSchema.d.ts +64 -0
- package/dist/chunk/ChunkVectorStorageSchema.d.ts.map +1 -0
- package/dist/common.d.ts +5 -5
- package/dist/common.d.ts.map +1 -1
- package/dist/document/Document.d.ts +7 -6
- package/dist/document/Document.d.ts.map +1 -1
- package/dist/document/DocumentSchema.d.ts +0 -465
- package/dist/document/DocumentSchema.d.ts.map +1 -1
- package/dist/knowledge-base/KnowledgeBase.d.ts +122 -0
- package/dist/knowledge-base/KnowledgeBase.d.ts.map +1 -0
- package/dist/knowledge-base/KnowledgeBaseRegistry.d.ts +24 -0
- package/dist/knowledge-base/KnowledgeBaseRegistry.d.ts.map +1 -0
- package/dist/knowledge-base/createKnowledgeBase.d.ts +28 -0
- package/dist/knowledge-base/createKnowledgeBase.d.ts.map +1 -0
- package/dist/node.js +376 -490
- package/dist/node.js.map +13 -13
- package/dist/util/DatasetSchema.d.ts +9 -49
- package/dist/util/DatasetSchema.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/document/DocumentDataset.d.ts +0 -79
- package/dist/document/DocumentDataset.d.ts.map +0 -1
- package/dist/document/DocumentDatasetRegistry.d.ts +0 -29
- package/dist/document/DocumentDatasetRegistry.d.ts.map +0 -1
- package/dist/document-chunk/DocumentChunkDataset.d.ts +0 -79
- package/dist/document-chunk/DocumentChunkDataset.d.ts.map +0 -1
- package/dist/document-chunk/DocumentChunkDatasetRegistry.d.ts +0 -29
- package/dist/document-chunk/DocumentChunkDatasetRegistry.d.ts.map +0 -1
- package/dist/document-chunk/DocumentChunkSchema.d.ts +0 -56
- package/dist/document-chunk/DocumentChunkSchema.d.ts.map +0 -1
- package/src/document-chunk/README.md +0 -362
|
@@ -1173,471 +1173,6 @@ export declare const TokenBudgetSchema: {
|
|
|
1173
1173
|
readonly additionalProperties: false;
|
|
1174
1174
|
};
|
|
1175
1175
|
export type TokenBudget = FromSchema<typeof TokenBudgetSchema>;
|
|
1176
|
-
/**
|
|
1177
|
-
* Schema for chunk enrichment
|
|
1178
|
-
*/
|
|
1179
|
-
export declare const ChunkEnrichmentSchema: {
|
|
1180
|
-
readonly type: "object";
|
|
1181
|
-
readonly properties: {
|
|
1182
|
-
readonly summary: {
|
|
1183
|
-
readonly type: "string";
|
|
1184
|
-
readonly title: "Summary";
|
|
1185
|
-
readonly description: "Summary of the chunk content";
|
|
1186
|
-
};
|
|
1187
|
-
readonly entities: {
|
|
1188
|
-
readonly type: "array";
|
|
1189
|
-
readonly items: {
|
|
1190
|
-
readonly type: "object";
|
|
1191
|
-
readonly properties: {
|
|
1192
|
-
readonly text: {
|
|
1193
|
-
readonly type: "string";
|
|
1194
|
-
readonly title: "Text";
|
|
1195
|
-
readonly description: "Entity text";
|
|
1196
|
-
};
|
|
1197
|
-
readonly type: {
|
|
1198
|
-
readonly type: "string";
|
|
1199
|
-
readonly title: "Type";
|
|
1200
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1201
|
-
};
|
|
1202
|
-
readonly score: {
|
|
1203
|
-
readonly type: "number";
|
|
1204
|
-
readonly title: "Score";
|
|
1205
|
-
readonly description: "Confidence score";
|
|
1206
|
-
};
|
|
1207
|
-
};
|
|
1208
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1209
|
-
readonly additionalProperties: false;
|
|
1210
|
-
};
|
|
1211
|
-
readonly title: "Entities";
|
|
1212
|
-
readonly description: "Named entities extracted from the chunk";
|
|
1213
|
-
};
|
|
1214
|
-
};
|
|
1215
|
-
readonly additionalProperties: false;
|
|
1216
|
-
};
|
|
1217
|
-
export type ChunkEnrichment = FromSchema<typeof ChunkEnrichmentSchema>;
|
|
1218
|
-
/**
|
|
1219
|
-
* Schema for chunk node (output of HierarchicalChunker)
|
|
1220
|
-
*/
|
|
1221
|
-
export declare const ChunkNodeSchema: () => {
|
|
1222
|
-
readonly type: "object";
|
|
1223
|
-
readonly properties: {
|
|
1224
|
-
readonly chunkId: {
|
|
1225
|
-
readonly type: "string";
|
|
1226
|
-
readonly title: "Chunk ID";
|
|
1227
|
-
readonly description: "Unique identifier for this chunk";
|
|
1228
|
-
};
|
|
1229
|
-
readonly doc_id: {
|
|
1230
|
-
readonly type: "string";
|
|
1231
|
-
readonly title: "Document ID";
|
|
1232
|
-
readonly description: "ID of the parent document";
|
|
1233
|
-
};
|
|
1234
|
-
readonly text: {
|
|
1235
|
-
readonly type: "string";
|
|
1236
|
-
readonly title: "Text";
|
|
1237
|
-
readonly description: "Text content of the chunk";
|
|
1238
|
-
};
|
|
1239
|
-
readonly nodePath: {
|
|
1240
|
-
readonly type: "array";
|
|
1241
|
-
readonly items: {
|
|
1242
|
-
readonly type: "string";
|
|
1243
|
-
};
|
|
1244
|
-
readonly title: "Node Path";
|
|
1245
|
-
readonly description: "Node IDs from root to leaf";
|
|
1246
|
-
};
|
|
1247
|
-
readonly depth: {
|
|
1248
|
-
readonly type: "integer";
|
|
1249
|
-
readonly title: "Depth";
|
|
1250
|
-
readonly description: "Depth in the document tree";
|
|
1251
|
-
};
|
|
1252
|
-
readonly enrichment: {
|
|
1253
|
-
readonly type: "object";
|
|
1254
|
-
readonly properties: {
|
|
1255
|
-
readonly summary: {
|
|
1256
|
-
readonly type: "string";
|
|
1257
|
-
readonly title: "Summary";
|
|
1258
|
-
readonly description: "Summary of the chunk content";
|
|
1259
|
-
};
|
|
1260
|
-
readonly entities: {
|
|
1261
|
-
readonly type: "array";
|
|
1262
|
-
readonly items: {
|
|
1263
|
-
readonly type: "object";
|
|
1264
|
-
readonly properties: {
|
|
1265
|
-
readonly text: {
|
|
1266
|
-
readonly type: "string";
|
|
1267
|
-
readonly title: "Text";
|
|
1268
|
-
readonly description: "Entity text";
|
|
1269
|
-
};
|
|
1270
|
-
readonly type: {
|
|
1271
|
-
readonly type: "string";
|
|
1272
|
-
readonly title: "Type";
|
|
1273
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1274
|
-
};
|
|
1275
|
-
readonly score: {
|
|
1276
|
-
readonly type: "number";
|
|
1277
|
-
readonly title: "Score";
|
|
1278
|
-
readonly description: "Confidence score";
|
|
1279
|
-
};
|
|
1280
|
-
};
|
|
1281
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1282
|
-
readonly additionalProperties: false;
|
|
1283
|
-
};
|
|
1284
|
-
readonly title: "Entities";
|
|
1285
|
-
readonly description: "Named entities extracted from the chunk";
|
|
1286
|
-
};
|
|
1287
|
-
};
|
|
1288
|
-
readonly additionalProperties: false;
|
|
1289
|
-
};
|
|
1290
|
-
};
|
|
1291
|
-
readonly required: readonly ["chunkId", "doc_id", "text", "nodePath", "depth"];
|
|
1292
|
-
readonly additionalProperties: false;
|
|
1293
|
-
};
|
|
1294
|
-
export type ChunkNode = FromSchema<ReturnType<typeof ChunkNodeSchema>>;
|
|
1295
|
-
/**
|
|
1296
|
-
* Schema for chunk metadata stored in vector database
|
|
1297
|
-
* This is the metadata output from ChunkToVectorTask
|
|
1298
|
-
*/
|
|
1299
|
-
export declare const ChunkMetadataSchema: {
|
|
1300
|
-
readonly type: "object";
|
|
1301
|
-
readonly properties: {
|
|
1302
|
-
readonly doc_id: {
|
|
1303
|
-
readonly type: "string";
|
|
1304
|
-
readonly title: "Document ID";
|
|
1305
|
-
readonly description: "ID of the parent document";
|
|
1306
|
-
};
|
|
1307
|
-
readonly chunkId: {
|
|
1308
|
-
readonly type: "string";
|
|
1309
|
-
readonly title: "Chunk ID";
|
|
1310
|
-
readonly description: "Unique identifier for this chunk";
|
|
1311
|
-
};
|
|
1312
|
-
readonly leafNodeId: {
|
|
1313
|
-
readonly type: "string";
|
|
1314
|
-
readonly title: "Leaf Node ID";
|
|
1315
|
-
readonly description: "ID of the leaf node this chunk belongs to";
|
|
1316
|
-
};
|
|
1317
|
-
readonly depth: {
|
|
1318
|
-
readonly type: "integer";
|
|
1319
|
-
readonly title: "Depth";
|
|
1320
|
-
readonly description: "Depth in the document tree";
|
|
1321
|
-
};
|
|
1322
|
-
readonly text: {
|
|
1323
|
-
readonly type: "string";
|
|
1324
|
-
readonly title: "Text";
|
|
1325
|
-
readonly description: "Text content of the chunk";
|
|
1326
|
-
};
|
|
1327
|
-
readonly nodePath: {
|
|
1328
|
-
readonly type: "array";
|
|
1329
|
-
readonly items: {
|
|
1330
|
-
readonly type: "string";
|
|
1331
|
-
};
|
|
1332
|
-
readonly title: "Node Path";
|
|
1333
|
-
readonly description: "Node IDs from root to leaf";
|
|
1334
|
-
};
|
|
1335
|
-
readonly summary: {
|
|
1336
|
-
readonly type: "string";
|
|
1337
|
-
readonly title: "Summary";
|
|
1338
|
-
readonly description: "Summary of the chunk content";
|
|
1339
|
-
};
|
|
1340
|
-
readonly entities: {
|
|
1341
|
-
readonly type: "array";
|
|
1342
|
-
readonly items: {
|
|
1343
|
-
readonly type: "object";
|
|
1344
|
-
readonly properties: {
|
|
1345
|
-
readonly text: {
|
|
1346
|
-
readonly type: "string";
|
|
1347
|
-
readonly title: "Text";
|
|
1348
|
-
readonly description: "Entity text";
|
|
1349
|
-
};
|
|
1350
|
-
readonly type: {
|
|
1351
|
-
readonly type: "string";
|
|
1352
|
-
readonly title: "Type";
|
|
1353
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1354
|
-
};
|
|
1355
|
-
readonly score: {
|
|
1356
|
-
readonly type: "number";
|
|
1357
|
-
readonly title: "Score";
|
|
1358
|
-
readonly description: "Confidence score";
|
|
1359
|
-
};
|
|
1360
|
-
};
|
|
1361
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1362
|
-
readonly additionalProperties: false;
|
|
1363
|
-
};
|
|
1364
|
-
readonly title: "Entities";
|
|
1365
|
-
readonly description: "Named entities extracted from the chunk";
|
|
1366
|
-
};
|
|
1367
|
-
};
|
|
1368
|
-
readonly required: readonly ["doc_id", "chunkId", "leafNodeId", "depth", "text", "nodePath"];
|
|
1369
|
-
readonly additionalProperties: true;
|
|
1370
|
-
};
|
|
1371
|
-
export type ChunkMetadata = FromSchema<typeof ChunkMetadataSchema>;
|
|
1372
|
-
/**
|
|
1373
|
-
* Schema for chunk metadata array (for use in task schemas)
|
|
1374
|
-
*/
|
|
1375
|
-
export declare const ChunkMetadataArraySchema: {
|
|
1376
|
-
readonly type: "array";
|
|
1377
|
-
readonly items: {
|
|
1378
|
-
readonly type: "object";
|
|
1379
|
-
readonly properties: {
|
|
1380
|
-
readonly doc_id: {
|
|
1381
|
-
readonly type: "string";
|
|
1382
|
-
readonly title: "Document ID";
|
|
1383
|
-
readonly description: "ID of the parent document";
|
|
1384
|
-
};
|
|
1385
|
-
readonly chunkId: {
|
|
1386
|
-
readonly type: "string";
|
|
1387
|
-
readonly title: "Chunk ID";
|
|
1388
|
-
readonly description: "Unique identifier for this chunk";
|
|
1389
|
-
};
|
|
1390
|
-
readonly leafNodeId: {
|
|
1391
|
-
readonly type: "string";
|
|
1392
|
-
readonly title: "Leaf Node ID";
|
|
1393
|
-
readonly description: "ID of the leaf node this chunk belongs to";
|
|
1394
|
-
};
|
|
1395
|
-
readonly depth: {
|
|
1396
|
-
readonly type: "integer";
|
|
1397
|
-
readonly title: "Depth";
|
|
1398
|
-
readonly description: "Depth in the document tree";
|
|
1399
|
-
};
|
|
1400
|
-
readonly text: {
|
|
1401
|
-
readonly type: "string";
|
|
1402
|
-
readonly title: "Text";
|
|
1403
|
-
readonly description: "Text content of the chunk";
|
|
1404
|
-
};
|
|
1405
|
-
readonly nodePath: {
|
|
1406
|
-
readonly type: "array";
|
|
1407
|
-
readonly items: {
|
|
1408
|
-
readonly type: "string";
|
|
1409
|
-
};
|
|
1410
|
-
readonly title: "Node Path";
|
|
1411
|
-
readonly description: "Node IDs from root to leaf";
|
|
1412
|
-
};
|
|
1413
|
-
readonly summary: {
|
|
1414
|
-
readonly type: "string";
|
|
1415
|
-
readonly title: "Summary";
|
|
1416
|
-
readonly description: "Summary of the chunk content";
|
|
1417
|
-
};
|
|
1418
|
-
readonly entities: {
|
|
1419
|
-
readonly type: "array";
|
|
1420
|
-
readonly items: {
|
|
1421
|
-
readonly type: "object";
|
|
1422
|
-
readonly properties: {
|
|
1423
|
-
readonly text: {
|
|
1424
|
-
readonly type: "string";
|
|
1425
|
-
readonly title: "Text";
|
|
1426
|
-
readonly description: "Entity text";
|
|
1427
|
-
};
|
|
1428
|
-
readonly type: {
|
|
1429
|
-
readonly type: "string";
|
|
1430
|
-
readonly title: "Type";
|
|
1431
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1432
|
-
};
|
|
1433
|
-
readonly score: {
|
|
1434
|
-
readonly type: "number";
|
|
1435
|
-
readonly title: "Score";
|
|
1436
|
-
readonly description: "Confidence score";
|
|
1437
|
-
};
|
|
1438
|
-
};
|
|
1439
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1440
|
-
readonly additionalProperties: false;
|
|
1441
|
-
};
|
|
1442
|
-
readonly title: "Entities";
|
|
1443
|
-
readonly description: "Named entities extracted from the chunk";
|
|
1444
|
-
};
|
|
1445
|
-
};
|
|
1446
|
-
readonly required: readonly ["doc_id", "chunkId", "leafNodeId", "depth", "text", "nodePath"];
|
|
1447
|
-
readonly additionalProperties: true;
|
|
1448
|
-
};
|
|
1449
|
-
readonly title: "Chunk Metadata";
|
|
1450
|
-
readonly description: "Metadata for each chunk";
|
|
1451
|
-
};
|
|
1452
|
-
/**
|
|
1453
|
-
* Schema for enriched chunk metadata (after HierarchyJoinTask)
|
|
1454
|
-
* Extends ChunkMetadata with hierarchy information from document repository
|
|
1455
|
-
*/
|
|
1456
|
-
export declare const EnrichedChunkMetadataSchema: {
|
|
1457
|
-
readonly type: "object";
|
|
1458
|
-
readonly properties: {
|
|
1459
|
-
readonly doc_id: {
|
|
1460
|
-
readonly type: "string";
|
|
1461
|
-
readonly title: "Document ID";
|
|
1462
|
-
readonly description: "ID of the parent document";
|
|
1463
|
-
};
|
|
1464
|
-
readonly chunkId: {
|
|
1465
|
-
readonly type: "string";
|
|
1466
|
-
readonly title: "Chunk ID";
|
|
1467
|
-
readonly description: "Unique identifier for this chunk";
|
|
1468
|
-
};
|
|
1469
|
-
readonly leafNodeId: {
|
|
1470
|
-
readonly type: "string";
|
|
1471
|
-
readonly title: "Leaf Node ID";
|
|
1472
|
-
readonly description: "ID of the leaf node this chunk belongs to";
|
|
1473
|
-
};
|
|
1474
|
-
readonly depth: {
|
|
1475
|
-
readonly type: "integer";
|
|
1476
|
-
readonly title: "Depth";
|
|
1477
|
-
readonly description: "Depth in the document tree";
|
|
1478
|
-
};
|
|
1479
|
-
readonly text: {
|
|
1480
|
-
readonly type: "string";
|
|
1481
|
-
readonly title: "Text";
|
|
1482
|
-
readonly description: "Text content of the chunk";
|
|
1483
|
-
};
|
|
1484
|
-
readonly nodePath: {
|
|
1485
|
-
readonly type: "array";
|
|
1486
|
-
readonly items: {
|
|
1487
|
-
readonly type: "string";
|
|
1488
|
-
};
|
|
1489
|
-
readonly title: "Node Path";
|
|
1490
|
-
readonly description: "Node IDs from root to leaf";
|
|
1491
|
-
};
|
|
1492
|
-
readonly summary: {
|
|
1493
|
-
readonly type: "string";
|
|
1494
|
-
readonly title: "Summary";
|
|
1495
|
-
readonly description: "Summary of the chunk content";
|
|
1496
|
-
};
|
|
1497
|
-
readonly entities: {
|
|
1498
|
-
readonly type: "array";
|
|
1499
|
-
readonly items: {
|
|
1500
|
-
readonly type: "object";
|
|
1501
|
-
readonly properties: {
|
|
1502
|
-
readonly text: {
|
|
1503
|
-
readonly type: "string";
|
|
1504
|
-
readonly title: "Text";
|
|
1505
|
-
readonly description: "Entity text";
|
|
1506
|
-
};
|
|
1507
|
-
readonly type: {
|
|
1508
|
-
readonly type: "string";
|
|
1509
|
-
readonly title: "Type";
|
|
1510
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1511
|
-
};
|
|
1512
|
-
readonly score: {
|
|
1513
|
-
readonly type: "number";
|
|
1514
|
-
readonly title: "Score";
|
|
1515
|
-
readonly description: "Confidence score";
|
|
1516
|
-
};
|
|
1517
|
-
};
|
|
1518
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1519
|
-
readonly additionalProperties: false;
|
|
1520
|
-
};
|
|
1521
|
-
readonly title: "Entities";
|
|
1522
|
-
readonly description: "Named entities (rolled up from hierarchy)";
|
|
1523
|
-
};
|
|
1524
|
-
readonly parentSummaries: {
|
|
1525
|
-
readonly type: "array";
|
|
1526
|
-
readonly items: {
|
|
1527
|
-
readonly type: "string";
|
|
1528
|
-
};
|
|
1529
|
-
readonly title: "Parent Summaries";
|
|
1530
|
-
readonly description: "Summaries from ancestor nodes";
|
|
1531
|
-
};
|
|
1532
|
-
readonly sectionTitles: {
|
|
1533
|
-
readonly type: "array";
|
|
1534
|
-
readonly items: {
|
|
1535
|
-
readonly type: "string";
|
|
1536
|
-
};
|
|
1537
|
-
readonly title: "Section Titles";
|
|
1538
|
-
readonly description: "Titles of ancestor section nodes";
|
|
1539
|
-
};
|
|
1540
|
-
};
|
|
1541
|
-
readonly required: readonly ["doc_id", "chunkId", "leafNodeId", "depth", "text", "nodePath"];
|
|
1542
|
-
readonly additionalProperties: true;
|
|
1543
|
-
};
|
|
1544
|
-
export type EnrichedChunkMetadata = FromSchema<typeof EnrichedChunkMetadataSchema>;
|
|
1545
|
-
/**
|
|
1546
|
-
* Schema for enriched chunk metadata array (for use in task schemas)
|
|
1547
|
-
*/
|
|
1548
|
-
export declare const EnrichedChunkMetadataArraySchema: {
|
|
1549
|
-
readonly type: "array";
|
|
1550
|
-
readonly items: {
|
|
1551
|
-
readonly type: "object";
|
|
1552
|
-
readonly properties: {
|
|
1553
|
-
readonly doc_id: {
|
|
1554
|
-
readonly type: "string";
|
|
1555
|
-
readonly title: "Document ID";
|
|
1556
|
-
readonly description: "ID of the parent document";
|
|
1557
|
-
};
|
|
1558
|
-
readonly chunkId: {
|
|
1559
|
-
readonly type: "string";
|
|
1560
|
-
readonly title: "Chunk ID";
|
|
1561
|
-
readonly description: "Unique identifier for this chunk";
|
|
1562
|
-
};
|
|
1563
|
-
readonly leafNodeId: {
|
|
1564
|
-
readonly type: "string";
|
|
1565
|
-
readonly title: "Leaf Node ID";
|
|
1566
|
-
readonly description: "ID of the leaf node this chunk belongs to";
|
|
1567
|
-
};
|
|
1568
|
-
readonly depth: {
|
|
1569
|
-
readonly type: "integer";
|
|
1570
|
-
readonly title: "Depth";
|
|
1571
|
-
readonly description: "Depth in the document tree";
|
|
1572
|
-
};
|
|
1573
|
-
readonly text: {
|
|
1574
|
-
readonly type: "string";
|
|
1575
|
-
readonly title: "Text";
|
|
1576
|
-
readonly description: "Text content of the chunk";
|
|
1577
|
-
};
|
|
1578
|
-
readonly nodePath: {
|
|
1579
|
-
readonly type: "array";
|
|
1580
|
-
readonly items: {
|
|
1581
|
-
readonly type: "string";
|
|
1582
|
-
};
|
|
1583
|
-
readonly title: "Node Path";
|
|
1584
|
-
readonly description: "Node IDs from root to leaf";
|
|
1585
|
-
};
|
|
1586
|
-
readonly summary: {
|
|
1587
|
-
readonly type: "string";
|
|
1588
|
-
readonly title: "Summary";
|
|
1589
|
-
readonly description: "Summary of the chunk content";
|
|
1590
|
-
};
|
|
1591
|
-
readonly entities: {
|
|
1592
|
-
readonly type: "array";
|
|
1593
|
-
readonly items: {
|
|
1594
|
-
readonly type: "object";
|
|
1595
|
-
readonly properties: {
|
|
1596
|
-
readonly text: {
|
|
1597
|
-
readonly type: "string";
|
|
1598
|
-
readonly title: "Text";
|
|
1599
|
-
readonly description: "Entity text";
|
|
1600
|
-
};
|
|
1601
|
-
readonly type: {
|
|
1602
|
-
readonly type: "string";
|
|
1603
|
-
readonly title: "Type";
|
|
1604
|
-
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
1605
|
-
};
|
|
1606
|
-
readonly score: {
|
|
1607
|
-
readonly type: "number";
|
|
1608
|
-
readonly title: "Score";
|
|
1609
|
-
readonly description: "Confidence score";
|
|
1610
|
-
};
|
|
1611
|
-
};
|
|
1612
|
-
readonly required: readonly ["text", "type", "score"];
|
|
1613
|
-
readonly additionalProperties: false;
|
|
1614
|
-
};
|
|
1615
|
-
readonly title: "Entities";
|
|
1616
|
-
readonly description: "Named entities (rolled up from hierarchy)";
|
|
1617
|
-
};
|
|
1618
|
-
readonly parentSummaries: {
|
|
1619
|
-
readonly type: "array";
|
|
1620
|
-
readonly items: {
|
|
1621
|
-
readonly type: "string";
|
|
1622
|
-
};
|
|
1623
|
-
readonly title: "Parent Summaries";
|
|
1624
|
-
readonly description: "Summaries from ancestor nodes";
|
|
1625
|
-
};
|
|
1626
|
-
readonly sectionTitles: {
|
|
1627
|
-
readonly type: "array";
|
|
1628
|
-
readonly items: {
|
|
1629
|
-
readonly type: "string";
|
|
1630
|
-
};
|
|
1631
|
-
readonly title: "Section Titles";
|
|
1632
|
-
readonly description: "Titles of ancestor section nodes";
|
|
1633
|
-
};
|
|
1634
|
-
};
|
|
1635
|
-
readonly required: readonly ["doc_id", "chunkId", "leafNodeId", "depth", "text", "nodePath"];
|
|
1636
|
-
readonly additionalProperties: true;
|
|
1637
|
-
};
|
|
1638
|
-
readonly title: "Enriched Metadata";
|
|
1639
|
-
readonly description: "Metadata enriched with hierarchy information";
|
|
1640
|
-
};
|
|
1641
1176
|
/**
|
|
1642
1177
|
* Schema for document metadata
|
|
1643
1178
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSchema.d.ts","sourceRoot":"","sources":["../../src/document/DocumentSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAkB,UAAU,
|
|
1
|
+
{"version":3,"file":"DocumentSchema.d.ts","sourceRoot":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;AAEpC,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { HybridSearchOptions, VectorSearchOptions } from "@workglow/storage";
|
|
7
|
+
import type { TypedArray } from "@workglow/util";
|
|
8
|
+
import type { ChunkRecord } from "../chunk/ChunkSchema";
|
|
9
|
+
import type { ChunkSearchResult, ChunkVectorEntity, ChunkVectorStorage, InsertChunkVectorEntity } from "../chunk/ChunkVectorStorageSchema";
|
|
10
|
+
import { Document } from "../document/Document";
|
|
11
|
+
import type { DocumentNode } from "../document/DocumentSchema";
|
|
12
|
+
import type { DocumentTabularStorage } from "../document/DocumentStorageSchema";
|
|
13
|
+
/**
|
|
14
|
+
* Unified KnowledgeBase that owns both document and vector storage.
|
|
15
|
+
* Replaces DocumentDataset and DocumentChunkDataset with a single cohesive class
|
|
16
|
+
* that provides lifecycle management and cascading deletes.
|
|
17
|
+
*/
|
|
18
|
+
export declare class KnowledgeBase {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
private tabularStorage;
|
|
21
|
+
private chunkStorage;
|
|
22
|
+
constructor(name: string, documentStorage: DocumentTabularStorage, chunkStorage: ChunkVectorStorage);
|
|
23
|
+
/**
|
|
24
|
+
* Upsert a document.
|
|
25
|
+
* @returns The document with the generated doc_id if it was auto-generated
|
|
26
|
+
*/
|
|
27
|
+
upsertDocument(document: Document): Promise<Document>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a document by ID
|
|
30
|
+
*/
|
|
31
|
+
getDocument(doc_id: string): Promise<Document | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete a document and all its chunks (cascading delete).
|
|
34
|
+
*/
|
|
35
|
+
deleteDocument(doc_id: string): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* List all document IDs
|
|
38
|
+
*/
|
|
39
|
+
listDocuments(): Promise<string[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a specific node by ID from a document
|
|
42
|
+
*/
|
|
43
|
+
getNode(doc_id: string, nodeId: string): Promise<DocumentNode | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Get ancestors of a node (from root to target node)
|
|
46
|
+
*/
|
|
47
|
+
getAncestors(doc_id: string, nodeId: string): Promise<DocumentNode[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Upsert a single chunk vector entity
|
|
50
|
+
*/
|
|
51
|
+
upsertChunk(chunk: InsertChunkVectorEntity): Promise<ChunkVectorEntity>;
|
|
52
|
+
/**
|
|
53
|
+
* Upsert multiple chunk vector entities
|
|
54
|
+
*/
|
|
55
|
+
upsertChunksBulk(chunks: InsertChunkVectorEntity[]): Promise<ChunkVectorEntity[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete all chunks for a specific document
|
|
58
|
+
*/
|
|
59
|
+
deleteChunksForDocument(doc_id: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Get all chunks for a specific document
|
|
62
|
+
*/
|
|
63
|
+
getChunksForDocument(doc_id: string): Promise<ChunkVectorEntity[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Search for similar chunks using vector similarity
|
|
66
|
+
*/
|
|
67
|
+
similaritySearch(query: TypedArray, options?: VectorSearchOptions<ChunkRecord>): Promise<ChunkSearchResult[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Hybrid search combining vector similarity and full-text search
|
|
70
|
+
*/
|
|
71
|
+
hybridSearch(query: TypedArray, options: HybridSearchOptions<ChunkRecord>): Promise<ChunkSearchResult[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Prepare a document for re-indexing: deletes all chunks but keeps the document.
|
|
74
|
+
* @returns The document if found, undefined otherwise
|
|
75
|
+
*/
|
|
76
|
+
prepareReindex(doc_id: string): Promise<Document | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Setup the underlying databases
|
|
79
|
+
*/
|
|
80
|
+
setupDatabase(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Destroy storage instances
|
|
83
|
+
*/
|
|
84
|
+
destroy(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get a chunk by ID
|
|
87
|
+
*/
|
|
88
|
+
getChunk(chunk_id: string): Promise<ChunkVectorEntity | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Store a single chunk (alias for upsertChunk)
|
|
91
|
+
*/
|
|
92
|
+
put(chunk: InsertChunkVectorEntity): Promise<ChunkVectorEntity>;
|
|
93
|
+
/**
|
|
94
|
+
* Store multiple chunks (alias for upsertChunksBulk)
|
|
95
|
+
*/
|
|
96
|
+
putBulk(chunks: InsertChunkVectorEntity[]): Promise<ChunkVectorEntity[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Get all chunks
|
|
99
|
+
*/
|
|
100
|
+
getAllChunks(): Promise<ChunkVectorEntity[] | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Get chunk count
|
|
103
|
+
*/
|
|
104
|
+
chunkCount(): Promise<number>;
|
|
105
|
+
/**
|
|
106
|
+
* Clear all chunks
|
|
107
|
+
*/
|
|
108
|
+
clearChunks(): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Get vector dimensions
|
|
111
|
+
*/
|
|
112
|
+
getVectorDimensions(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Get chunks from the document JSON (not from vector storage)
|
|
115
|
+
*/
|
|
116
|
+
getDocumentChunks(doc_id: string): Promise<ChunkRecord[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Find chunks in document JSON that contain a specific nodeId in their path
|
|
119
|
+
*/
|
|
120
|
+
findChunksByNodeId(doc_id: string, nodeId: string): Promise<ChunkRecord[]>;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=KnowledgeBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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iB,EAAE,GAAG,SAAS,CAAC;IAI9D;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC;;OAEG;IACH,mBAAmB,IAAI,MAAM;IAQ7B;;OAEG;IACG,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAQ/D;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAOjF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { KnowledgeBase } from "./KnowledgeBase";
|
|
7
|
+
/**
|
|
8
|
+
* Service token for the knowledge base registry
|
|
9
|
+
* Maps knowledge base IDs to KnowledgeBase instances
|
|
10
|
+
*/
|
|
11
|
+
export declare const KNOWLEDGE_BASES: import("@workglow/util").ServiceToken<Map<string, KnowledgeBase>>;
|
|
12
|
+
/**
|
|
13
|
+
* Gets the global knowledge base registry
|
|
14
|
+
*/
|
|
15
|
+
export declare function getGlobalKnowledgeBases(): Map<string, KnowledgeBase>;
|
|
16
|
+
/**
|
|
17
|
+
* Registers a knowledge base globally by ID
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerKnowledgeBase(id: string, kb: KnowledgeBase): void;
|
|
20
|
+
/**
|
|
21
|
+
* Gets a knowledge base by ID from the global registry
|
|
22
|
+
*/
|
|
23
|
+
export declare function getKnowledgeBase(id: string): KnowledgeBase | undefined;
|
|
24
|
+
//# sourceMappingURL=KnowledgeBaseRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KnowledgeBaseRegistry.d.ts","sourceRoot":"","sources":["../../src/knowledge-base/KnowledgeBaseRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,eAAe,mEAC+C,CAAC;AAW5E;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAEpE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,GAAG,IAAI,CAGzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEtE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { TypedArray } from "@workglow/util";
|
|
7
|
+
import { KnowledgeBase } from "./KnowledgeBase";
|
|
8
|
+
export interface CreateKnowledgeBaseOptions {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly vectorDimensions: number;
|
|
11
|
+
readonly vectorType?: {
|
|
12
|
+
new (array: number[]): TypedArray;
|
|
13
|
+
};
|
|
14
|
+
readonly register?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Factory function to create a KnowledgeBase with minimal configuration.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const kb = await createKnowledgeBase({
|
|
22
|
+
* name: "my-kb",
|
|
23
|
+
* vectorDimensions: 1024,
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function createKnowledgeBase(options: CreateKnowledgeBaseOptions): Promise<KnowledgeBase>;
|
|
28
|
+
//# sourceMappingURL=createKnowledgeBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createKnowledgeBase.d.ts","sourceRoot":"","sources":["../../src/knowledge-base/createKnowledgeBase.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,KAAK,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;KAAE,CAAC;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,aAAa,CAAC,CAkCxB"}
|