@arke-institute/sdk 2.3.13 → 2.5.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/openapi/spec.json CHANGED
@@ -778,6 +778,68 @@
778
778
  "pagination"
779
779
  ]
780
780
  },
781
+ "EntityPreview": {
782
+ "type": "object",
783
+ "properties": {
784
+ "id": {
785
+ "type": "string",
786
+ "description": "Entity ID (persistent identifier)",
787
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
788
+ },
789
+ "type": {
790
+ "type": "string",
791
+ "description": "Entity type",
792
+ "example": "document"
793
+ },
794
+ "label": {
795
+ "type": "string",
796
+ "description": "Entity label (from properties.label, filename, or name)",
797
+ "example": "Research Paper.pdf"
798
+ },
799
+ "collection_pi": {
800
+ "type": "string",
801
+ "description": "Collection ID this entity belongs to",
802
+ "example": "01JCOLLECTION123456789ABCD"
803
+ },
804
+ "description_preview": {
805
+ "type": "string",
806
+ "description": "Truncated description (max 200 chars + \"...\")",
807
+ "example": "This document contains research findings from the 2025 study on entity management systems. It covers key architectural decisions and performance benchmarks..."
808
+ },
809
+ "text_preview": {
810
+ "type": "string",
811
+ "description": "Truncated text content (max 200 chars + \"...\")",
812
+ "example": "Introduction: The rise of decentralized entity management systems has created new challenges for data integrity and consistency. This paper explores..."
813
+ },
814
+ "created_at": {
815
+ "type": "string",
816
+ "description": "Entity creation timestamp (ISO 8601)",
817
+ "example": "2025-01-15T10:00:00.000Z"
818
+ },
819
+ "updated_at": {
820
+ "type": "string",
821
+ "description": "Last update timestamp (ISO 8601)",
822
+ "example": "2025-01-20T14:30:00.000Z"
823
+ }
824
+ },
825
+ "required": [
826
+ "id",
827
+ "type",
828
+ "label",
829
+ "created_at",
830
+ "updated_at"
831
+ ],
832
+ "description": "Lightweight entity preview with fresh data. Included by default (expand: \"preview\").",
833
+ "example": {
834
+ "id": "01KDETYWYWM0MJVKM8DK3AEXPY",
835
+ "type": "file",
836
+ "label": "Research Paper.pdf",
837
+ "collection_pi": "01JCOLLECTION123456789AB",
838
+ "description_preview": "A comprehensive study on distributed systems architecture...",
839
+ "created_at": "2026-01-12T00:00:00.000Z",
840
+ "updated_at": "2026-01-12T10:30:00.000Z"
841
+ }
842
+ },
781
843
  "SearchResultItem": {
782
844
  "type": "object",
783
845
  "properties": {
@@ -817,6 +879,19 @@
817
879
  "type": "string",
818
880
  "description": "When the entity was last updated",
819
881
  "example": "2026-01-12T10:30:00.000Z"
882
+ },
883
+ "entity_preview": {
884
+ "$ref": "#/components/schemas/EntityPreview"
885
+ },
886
+ "entity": {
887
+ "allOf": [
888
+ {
889
+ "$ref": "#/components/schemas/EntityResponse"
890
+ },
891
+ {
892
+ "description": "Complete entity manifest with all properties and relationships. Only included when expand: \"full\"."
893
+ }
894
+ ]
820
895
  }
821
896
  },
822
897
  "required": [
@@ -922,6 +997,16 @@
922
997
  "default": 20,
923
998
  "description": "Maximum number of results to return (default: 20, max: 100)",
924
999
  "example": 50
1000
+ },
1001
+ "expand": {
1002
+ "type": "string",
1003
+ "enum": [
1004
+ "preview",
1005
+ "full",
1006
+ "none"
1007
+ ],
1008
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
1009
+ "example": "preview"
925
1010
  }
926
1011
  },
927
1012
  "required": [
@@ -1673,7 +1758,7 @@
1673
1758
  },
1674
1759
  "label": {
1675
1760
  "type": "string",
1676
- "description": "Entity display label",
1761
+ "description": "Entity display label (from GraphDB, may be stale)",
1677
1762
  "example": "My Document"
1678
1763
  },
1679
1764
  "created_at": {
@@ -1684,7 +1769,27 @@
1684
1769
  "updated_at": {
1685
1770
  "type": "string",
1686
1771
  "format": "date-time",
1687
- "description": "When the entity was last updated"
1772
+ "description": "When the entity was last updated (from GraphDB)"
1773
+ },
1774
+ "preview": {
1775
+ "allOf": [
1776
+ {
1777
+ "$ref": "#/components/schemas/EntityPreview"
1778
+ },
1779
+ {
1780
+ "description": "Fresh entity preview (only present when ?expand=preview)"
1781
+ }
1782
+ ]
1783
+ },
1784
+ "entity": {
1785
+ "allOf": [
1786
+ {
1787
+ "$ref": "#/components/schemas/EntityResponse"
1788
+ },
1789
+ {
1790
+ "description": "Full entity manifest (only present when ?expand=full). WARNING: Large payloads with many entities."
1791
+ }
1792
+ ]
1688
1793
  }
1689
1794
  },
1690
1795
  "required": [
@@ -2216,6 +2321,193 @@
2216
2321
  "expect_tip"
2217
2322
  ]
2218
2323
  },
2324
+ "CascadeDeletedEntity": {
2325
+ "type": "object",
2326
+ "properties": {
2327
+ "id": {
2328
+ "type": "string",
2329
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
2330
+ "description": "Entity ID (ULID format)",
2331
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
2332
+ },
2333
+ "cid": {
2334
+ "type": "string",
2335
+ "minLength": 1,
2336
+ "description": "Content Identifier (CID) - content-addressed hash",
2337
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
2338
+ },
2339
+ "type": {
2340
+ "type": "string",
2341
+ "description": "Entity type",
2342
+ "example": "file"
2343
+ },
2344
+ "depth": {
2345
+ "type": "integer",
2346
+ "description": "Depth from root entity at which this entity was found",
2347
+ "example": 1
2348
+ }
2349
+ },
2350
+ "required": [
2351
+ "id",
2352
+ "cid",
2353
+ "type",
2354
+ "depth"
2355
+ ]
2356
+ },
2357
+ "CascadeSkippedEntity": {
2358
+ "type": "object",
2359
+ "properties": {
2360
+ "id": {
2361
+ "type": "string",
2362
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
2363
+ "description": "Entity ID (ULID format)",
2364
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
2365
+ },
2366
+ "type": {
2367
+ "type": "string",
2368
+ "description": "Entity type",
2369
+ "example": "file"
2370
+ },
2371
+ "reason": {
2372
+ "type": "string",
2373
+ "enum": [
2374
+ "not_in_collection",
2375
+ "already_deleted",
2376
+ "edited_by_mismatch",
2377
+ "cas_conflict"
2378
+ ],
2379
+ "description": "Reason an entity was skipped during cascade delete"
2380
+ }
2381
+ },
2382
+ "required": [
2383
+ "id",
2384
+ "type",
2385
+ "reason"
2386
+ ]
2387
+ },
2388
+ "CascadeDeleteResponse": {
2389
+ "type": "object",
2390
+ "properties": {
2391
+ "root": {
2392
+ "allOf": [
2393
+ {
2394
+ "$ref": "#/components/schemas/EntityDeletedResponse"
2395
+ },
2396
+ {
2397
+ "description": "Deletion result for the root entity"
2398
+ }
2399
+ ]
2400
+ },
2401
+ "deleted": {
2402
+ "type": "array",
2403
+ "items": {
2404
+ "$ref": "#/components/schemas/CascadeDeletedEntity"
2405
+ },
2406
+ "description": "Entities successfully deleted (ordered by depth, deepest first)"
2407
+ },
2408
+ "skipped": {
2409
+ "type": "array",
2410
+ "items": {
2411
+ "$ref": "#/components/schemas/CascadeSkippedEntity"
2412
+ },
2413
+ "description": "Entities skipped during traversal with reasons"
2414
+ },
2415
+ "summary": {
2416
+ "type": "object",
2417
+ "properties": {
2418
+ "total_traversed": {
2419
+ "type": "integer",
2420
+ "description": "Total entities visited during BFS traversal"
2421
+ },
2422
+ "total_deleted": {
2423
+ "type": "integer",
2424
+ "description": "Total entities successfully deleted (excluding root)"
2425
+ },
2426
+ "total_skipped": {
2427
+ "type": "integer",
2428
+ "description": "Total entities skipped during traversal"
2429
+ },
2430
+ "max_depth_reached": {
2431
+ "type": "integer",
2432
+ "description": "Maximum depth reached during traversal"
2433
+ }
2434
+ },
2435
+ "required": [
2436
+ "total_traversed",
2437
+ "total_deleted",
2438
+ "total_skipped",
2439
+ "max_depth_reached"
2440
+ ],
2441
+ "description": "Summary statistics for the cascade delete operation"
2442
+ }
2443
+ },
2444
+ "required": [
2445
+ "root",
2446
+ "deleted",
2447
+ "skipped",
2448
+ "summary"
2449
+ ]
2450
+ },
2451
+ "CascadeDeleteRequest": {
2452
+ "type": "object",
2453
+ "properties": {
2454
+ "expect_tip": {
2455
+ "type": "string",
2456
+ "minLength": 1,
2457
+ "description": "Current tip CID for CAS validation. Request fails with 409 if this does not match.",
2458
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
2459
+ },
2460
+ "note": {
2461
+ "type": "string",
2462
+ "description": "Optional note describing this change",
2463
+ "example": "Added Chapter 42: The Whiteness of the Whale"
2464
+ },
2465
+ "collection_id": {
2466
+ "type": "string",
2467
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
2468
+ "description": "Collection to scope the cascade delete. Only entities in this collection will be deleted. Permission check is performed on this collection.",
2469
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
2470
+ },
2471
+ "cascade_predicates": {
2472
+ "type": "array",
2473
+ "items": {
2474
+ "type": "string",
2475
+ "minLength": 1
2476
+ },
2477
+ "minItems": 1,
2478
+ "description": "Predicate patterns to follow during cascade traversal. Supports wildcards:\n- `\"child\"` - exact match only\n- `\"has_*\"` - matches has_document, has_image, etc.\n- `\"*_copy\"` - matches file_copy, document_copy, etc.\n- `\"*\"` - matches ALL predicates\n\n**Important:** The `collection` predicate NEVER cascades, even if `\"*\"` is specified. This protects the collection structure from accidental deletion.",
2479
+ "example": [
2480
+ "child",
2481
+ "has_*"
2482
+ ]
2483
+ },
2484
+ "edited_by_filter": {
2485
+ "type": "string",
2486
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
2487
+ "description": "Only delete entities where edited_by.user_id matches this PI. Useful for cleaning up entities created by a specific agent.",
2488
+ "example": "01KAGENTXXXXXXXXXXXXXXXX"
2489
+ },
2490
+ "max_depth": {
2491
+ "type": "integer",
2492
+ "minimum": 1,
2493
+ "maximum": 20,
2494
+ "default": 10,
2495
+ "description": "Maximum relationship depth to traverse (default: 10, max: 20)",
2496
+ "example": 10
2497
+ },
2498
+ "reason": {
2499
+ "type": "string",
2500
+ "maxLength": 500,
2501
+ "description": "Reason for deleting the entities (applied to all deleted entities)",
2502
+ "example": "Cleanup after agent task"
2503
+ }
2504
+ },
2505
+ "required": [
2506
+ "expect_tip",
2507
+ "collection_id",
2508
+ "cascade_predicates"
2509
+ ]
2510
+ },
2219
2511
  "EntityUpdateResponse": {
2220
2512
  "allOf": [
2221
2513
  {
@@ -6029,6 +6321,26 @@
6029
6321
  "type": "string",
6030
6322
  "description": "Source entity type"
6031
6323
  },
6324
+ "subject_preview": {
6325
+ "allOf": [
6326
+ {
6327
+ "$ref": "#/components/schemas/EntityPreview"
6328
+ },
6329
+ {
6330
+ "description": "Fresh subject preview (default, or expand=preview)"
6331
+ }
6332
+ ]
6333
+ },
6334
+ "subject_entity": {
6335
+ "allOf": [
6336
+ {
6337
+ "$ref": "#/components/schemas/EntityResponse"
6338
+ },
6339
+ {
6340
+ "description": "Full subject manifest (expand=full)"
6341
+ }
6342
+ ]
6343
+ },
6032
6344
  "predicate": {
6033
6345
  "type": "string",
6034
6346
  "description": "Relationship predicate"
@@ -6046,6 +6358,26 @@
6046
6358
  "object_type": {
6047
6359
  "type": "string",
6048
6360
  "description": "Target entity type"
6361
+ },
6362
+ "object_preview": {
6363
+ "allOf": [
6364
+ {
6365
+ "$ref": "#/components/schemas/EntityPreview"
6366
+ },
6367
+ {
6368
+ "description": "Fresh object preview (default, or expand=preview)"
6369
+ }
6370
+ ]
6371
+ },
6372
+ "object_entity": {
6373
+ "allOf": [
6374
+ {
6375
+ "$ref": "#/components/schemas/EntityResponse"
6376
+ },
6377
+ {
6378
+ "description": "Full object manifest (expand=full)"
6379
+ }
6380
+ ]
6049
6381
  }
6050
6382
  },
6051
6383
  "required": [
@@ -6056,7 +6388,34 @@
6056
6388
  "object_pi",
6057
6389
  "object_label",
6058
6390
  "object_type"
6059
- ]
6391
+ ],
6392
+ "example": {
6393
+ "subject_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6394
+ "subject_label": "Project Folder",
6395
+ "subject_type": "folder",
6396
+ "subject_preview": {
6397
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
6398
+ "type": "folder",
6399
+ "label": "Project Folder",
6400
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6401
+ "description_preview": "Main project folder containing research documents...",
6402
+ "created_at": "2025-01-10T08:00:00.000Z",
6403
+ "updated_at": "2025-01-18T16:45:00.000Z"
6404
+ },
6405
+ "predicate": "contains",
6406
+ "object_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6407
+ "object_label": "Research Paper.pdf",
6408
+ "object_type": "file",
6409
+ "object_preview": {
6410
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6411
+ "type": "file",
6412
+ "label": "Research Paper.pdf",
6413
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6414
+ "description_preview": "Analysis of entity management patterns and best practices...",
6415
+ "created_at": "2025-01-15T10:00:00.000Z",
6416
+ "updated_at": "2025-01-20T14:30:00.000Z"
6417
+ }
6418
+ }
6060
6419
  },
6061
6420
  "PathResult": {
6062
6421
  "type": "object",
@@ -6204,6 +6563,26 @@
6204
6563
  "items": {
6205
6564
  "$ref": "#/components/schemas/PathEdge"
6206
6565
  }
6566
+ },
6567
+ "target_preview": {
6568
+ "allOf": [
6569
+ {
6570
+ "$ref": "#/components/schemas/EntityPreview"
6571
+ },
6572
+ {
6573
+ "description": "Fresh target preview (default, or expand=preview)"
6574
+ }
6575
+ ]
6576
+ },
6577
+ "target_entity": {
6578
+ "allOf": [
6579
+ {
6580
+ "$ref": "#/components/schemas/EntityResponse"
6581
+ },
6582
+ {
6583
+ "description": "Full target manifest (expand=full)"
6584
+ }
6585
+ ]
6207
6586
  }
6208
6587
  },
6209
6588
  "required": [
@@ -6213,7 +6592,24 @@
6213
6592
  "target_type",
6214
6593
  "length",
6215
6594
  "edges"
6216
- ]
6595
+ ],
6596
+ "example": {
6597
+ "source_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6598
+ "target_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6599
+ "target_label": "Research Paper.pdf",
6600
+ "target_type": "file",
6601
+ "length": 1,
6602
+ "edges": [],
6603
+ "target_preview": {
6604
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6605
+ "type": "file",
6606
+ "label": "Research Paper.pdf",
6607
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6608
+ "description_preview": "Analysis of entity management patterns and best practices...",
6609
+ "created_at": "2025-01-15T10:00:00.000Z",
6610
+ "updated_at": "2025-01-20T14:30:00.000Z"
6611
+ }
6612
+ }
6217
6613
  },
6218
6614
  "PathsReachableResponse": {
6219
6615
  "type": "object",
@@ -6320,6 +6716,26 @@
6320
6716
  "additionalProperties": {
6321
6717
  "nullable": true
6322
6718
  }
6719
+ },
6720
+ "peer_preview": {
6721
+ "allOf": [
6722
+ {
6723
+ "$ref": "#/components/schemas/EntityPreview"
6724
+ },
6725
+ {
6726
+ "description": "Fresh peer preview (default, or expand=preview)"
6727
+ }
6728
+ ]
6729
+ },
6730
+ "peer_entity": {
6731
+ "allOf": [
6732
+ {
6733
+ "$ref": "#/components/schemas/EntityResponse"
6734
+ },
6735
+ {
6736
+ "description": "Full peer manifest (expand=full)"
6737
+ }
6738
+ ]
6323
6739
  }
6324
6740
  },
6325
6741
  "required": [
@@ -6329,7 +6745,24 @@
6329
6745
  "peer_type",
6330
6746
  "peer_label",
6331
6747
  "properties"
6332
- ]
6748
+ ],
6749
+ "example": {
6750
+ "direction": "outgoing",
6751
+ "predicate": "contains",
6752
+ "peer_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6753
+ "peer_type": "file",
6754
+ "peer_label": "Research Paper.pdf",
6755
+ "properties": {},
6756
+ "peer_preview": {
6757
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6758
+ "type": "file",
6759
+ "label": "Research Paper.pdf",
6760
+ "collection_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6761
+ "description_preview": "Analysis of entity management patterns and best practices...",
6762
+ "created_at": "2025-01-15T10:00:00.000Z",
6763
+ "updated_at": "2025-01-20T14:30:00.000Z"
6764
+ }
6765
+ }
6333
6766
  },
6334
6767
  "GraphEntityResponse": {
6335
6768
  "type": "object",
@@ -6373,54 +6806,34 @@
6373
6806
  "created_at",
6374
6807
  "updated_at",
6375
6808
  "relationships"
6376
- ]
6377
- },
6378
- "QueryEntity": {
6379
- "type": "object",
6380
- "properties": {
6381
- "pi": {
6382
- "type": "string",
6383
- "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6384
- "description": "Entity ID (ULID format)",
6385
- "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6386
- },
6387
- "type": {
6388
- "type": "string"
6389
- },
6390
- "label": {
6391
- "type": "string"
6392
- },
6393
- "collection_pi": {
6394
- "type": "string",
6395
- "nullable": true
6396
- }
6397
- },
6398
- "required": [
6399
- "pi",
6400
- "type",
6401
- "label",
6402
- "collection_pi"
6403
- ]
6404
- },
6405
- "EntityStep": {
6406
- "type": "object",
6407
- "properties": {
6408
- "entity": {
6409
- "type": "string"
6410
- },
6411
- "label": {
6412
- "type": "string"
6413
- },
6414
- "type": {
6415
- "type": "string"
6416
- },
6417
- "score": {
6418
- "type": "number"
6419
- }
6420
- },
6421
- "required": [
6422
- "entity"
6423
- ]
6809
+ ],
6810
+ "example": {
6811
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6812
+ "type": "folder",
6813
+ "label": "Project Folder",
6814
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6815
+ "created_at": "2025-01-10T08:00:00.000Z",
6816
+ "updated_at": "2025-01-18T16:45:00.000Z",
6817
+ "relationships": [
6818
+ {
6819
+ "direction": "outgoing",
6820
+ "predicate": "contains",
6821
+ "peer_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6822
+ "peer_type": "file",
6823
+ "peer_label": "Research Paper.pdf",
6824
+ "properties": {},
6825
+ "peer_preview": {
6826
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6827
+ "type": "file",
6828
+ "label": "Research Paper.pdf",
6829
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6830
+ "description_preview": "Analysis of entity management patterns and best practices...",
6831
+ "created_at": "2025-01-15T10:00:00.000Z",
6832
+ "updated_at": "2025-01-20T14:30:00.000Z"
6833
+ }
6834
+ }
6835
+ ]
6836
+ }
6424
6837
  },
6425
6838
  "EdgeStep": {
6426
6839
  "type": "object",
@@ -6447,35 +6860,71 @@
6447
6860
  "PathStep": {
6448
6861
  "anyOf": [
6449
6862
  {
6450
- "$ref": "#/components/schemas/EntityStep"
6863
+ "type": "object",
6864
+ "properties": {
6865
+ "entity": {
6866
+ "type": "string",
6867
+ "description": "Entity ID",
6868
+ "example": "01KPERSON_EINSTEIN"
6869
+ },
6870
+ "label": {
6871
+ "type": "string",
6872
+ "example": "Albert Einstein"
6873
+ },
6874
+ "type": {
6875
+ "type": "string",
6876
+ "example": "person"
6877
+ },
6878
+ "score": {
6879
+ "type": "number",
6880
+ "description": "Semantic similarity score (0-1)",
6881
+ "example": 0.92
6882
+ },
6883
+ "preview_data": {
6884
+ "allOf": [
6885
+ {
6886
+ "$ref": "#/components/schemas/EntityPreview"
6887
+ },
6888
+ {
6889
+ "description": "Entity preview data (present by default, omit expand or use expand=preview)"
6890
+ }
6891
+ ]
6892
+ },
6893
+ "full_entity": {
6894
+ "allOf": [
6895
+ {
6896
+ "$ref": "#/components/schemas/EntityResponse"
6897
+ },
6898
+ {
6899
+ "description": "Full entity manifest (only present when expand=full)"
6900
+ }
6901
+ ]
6902
+ }
6903
+ },
6904
+ "required": [
6905
+ "entity"
6906
+ ],
6907
+ "description": "Entity step in a query path",
6908
+ "example": {
6909
+ "entity": "01KPERSON_EINSTEIN",
6910
+ "label": "Albert Einstein",
6911
+ "type": "person",
6912
+ "score": 0.92,
6913
+ "preview_data": {
6914
+ "id": "01KPERSON_EINSTEIN",
6915
+ "type": "person",
6916
+ "label": "Albert Einstein",
6917
+ "description_preview": "German-born theoretical physicist...",
6918
+ "created_at": "2025-01-01T00:00:00.000Z",
6919
+ "updated_at": "2025-01-15T12:00:00.000Z"
6920
+ }
6921
+ }
6451
6922
  },
6452
6923
  {
6453
6924
  "$ref": "#/components/schemas/EdgeStep"
6454
6925
  }
6455
6926
  ]
6456
6927
  },
6457
- "QueryResultItem": {
6458
- "type": "object",
6459
- "properties": {
6460
- "entity": {
6461
- "$ref": "#/components/schemas/QueryEntity"
6462
- },
6463
- "path": {
6464
- "type": "array",
6465
- "items": {
6466
- "$ref": "#/components/schemas/PathStep"
6467
- }
6468
- },
6469
- "score": {
6470
- "type": "number"
6471
- }
6472
- },
6473
- "required": [
6474
- "entity",
6475
- "path",
6476
- "score"
6477
- ]
6478
- },
6479
6928
  "QueryMetadata": {
6480
6929
  "type": "object",
6481
6930
  "properties": {
@@ -6531,7 +6980,129 @@
6531
6980
  "results": {
6532
6981
  "type": "array",
6533
6982
  "items": {
6534
- "$ref": "#/components/schemas/QueryResultItem"
6983
+ "type": "object",
6984
+ "properties": {
6985
+ "entity": {
6986
+ "type": "object",
6987
+ "properties": {
6988
+ "pi": {
6989
+ "type": "string",
6990
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6991
+ "description": "Entity ID (ULID format)",
6992
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6993
+ },
6994
+ "type": {
6995
+ "type": "string",
6996
+ "example": "person"
6997
+ },
6998
+ "label": {
6999
+ "type": "string",
7000
+ "example": "Albert Einstein"
7001
+ },
7002
+ "collection_pi": {
7003
+ "type": "string",
7004
+ "nullable": true,
7005
+ "example": "01JCOLL_RESEARCH"
7006
+ },
7007
+ "preview_data": {
7008
+ "allOf": [
7009
+ {
7010
+ "$ref": "#/components/schemas/EntityPreview"
7011
+ },
7012
+ {
7013
+ "description": "Entity preview data (present by default, omit expand or use expand=preview)"
7014
+ }
7015
+ ]
7016
+ },
7017
+ "full_entity": {
7018
+ "allOf": [
7019
+ {
7020
+ "$ref": "#/components/schemas/EntityResponse"
7021
+ },
7022
+ {
7023
+ "description": "Full entity manifest (only present when expand=full)"
7024
+ }
7025
+ ]
7026
+ }
7027
+ },
7028
+ "required": [
7029
+ "pi",
7030
+ "type",
7031
+ "label",
7032
+ "collection_pi"
7033
+ ],
7034
+ "description": "Query result entity with optional expansion data",
7035
+ "example": {
7036
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
7037
+ "type": "person",
7038
+ "label": "Albert Einstein",
7039
+ "collection_pi": "01JCOLL_RESEARCH",
7040
+ "preview_data": {
7041
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
7042
+ "type": "person",
7043
+ "label": "Albert Einstein",
7044
+ "collection_pi": "01JCOLL_RESEARCH",
7045
+ "description_preview": "German-born theoretical physicist who developed the theory of relativity...",
7046
+ "created_at": "2025-01-15T10:00:00.000Z",
7047
+ "updated_at": "2025-01-20T14:30:00.000Z"
7048
+ }
7049
+ }
7050
+ },
7051
+ "path": {
7052
+ "type": "array",
7053
+ "items": {
7054
+ "$ref": "#/components/schemas/PathStep"
7055
+ },
7056
+ "description": "Path from entry point to result entity (empty for zero-hop queries)"
7057
+ },
7058
+ "score": {
7059
+ "type": "number",
7060
+ "description": "Combined relevance score (semantic similarity + path length)",
7061
+ "example": 0.89
7062
+ }
7063
+ },
7064
+ "required": [
7065
+ "entity",
7066
+ "path",
7067
+ "score"
7068
+ ],
7069
+ "description": "A single query result with entity, path, and score",
7070
+ "example": {
7071
+ "entity": {
7072
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
7073
+ "type": "file",
7074
+ "label": "Theory of Relativity.pdf",
7075
+ "collection_pi": "01JCOLL_RESEARCH",
7076
+ "preview_data": {
7077
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
7078
+ "type": "file",
7079
+ "label": "Theory of Relativity.pdf",
7080
+ "collection_pi": "01JCOLL_RESEARCH",
7081
+ "description_preview": "Seminal paper on special and general relativity...",
7082
+ "created_at": "2025-01-10T08:00:00.000Z",
7083
+ "updated_at": "2025-01-10T08:00:00.000Z"
7084
+ }
7085
+ },
7086
+ "path": [
7087
+ {
7088
+ "entity": "01KPERSON_EINSTEIN",
7089
+ "label": "Albert Einstein",
7090
+ "type": "person",
7091
+ "preview_data": {
7092
+ "id": "01KPERSON_EINSTEIN",
7093
+ "type": "person",
7094
+ "label": "Albert Einstein",
7095
+ "created_at": "2025-01-01T00:00:00.000Z",
7096
+ "updated_at": "2025-01-15T12:00:00.000Z"
7097
+ }
7098
+ },
7099
+ {
7100
+ "edge": "authored",
7101
+ "direction": "outgoing"
7102
+ }
7103
+ ],
7104
+ "score": 0.89
7105
+ }
6535
7106
  }
6536
7107
  },
6537
7108
  "metadata": {
@@ -6571,6 +7142,16 @@
6571
7142
  "type": "string",
6572
7143
  "description": "Scope query to collection PI",
6573
7144
  "example": "01JCOLL_MEDICAL"
7145
+ },
7146
+ "expand": {
7147
+ "type": "string",
7148
+ "enum": [
7149
+ "none",
7150
+ "preview",
7151
+ "full"
7152
+ ],
7153
+ "description": "Control entity expansion in results and path steps.\n- **omitted/preview** (default): Attach lightweight preview data (label, timestamps, truncated description/text)\n- **full**: Attach complete entity manifest (all properties, relationships, version info)\n- **none**: No expansion - return only Pinecone metadata (fastest, smallest payload)",
7154
+ "example": "preview"
6574
7155
  }
6575
7156
  },
6576
7157
  "required": [
@@ -7620,7 +8201,7 @@
7620
8201
  "Search"
7621
8202
  ],
7622
8203
  "summary": "Search across user collections",
7623
- "description": "Performs semantic search across all collections the authenticated user has access to.\n\n## Features\n- Searches all user's collections in parallel (up to 25)\n- Optionally includes public-domain entities\n- Filter by entity type or collection role\n- Results ranked by semantic relevance\n\n## Performance\n- Collections are queried in parallel for speed\n- If user has more than 25 collections, queries first 25 (by created_at). Use role filter to narrow down.\n- Response includes metadata showing collections_queried vs collections_total\n\n## Scoring\n- Results use cosine similarity scores (0-1)\n- Scores are comparable across collections\n\n\n---\n**Permission:** `search:execute` \n**Auth:** required",
8204
+ "description": "Performs semantic search across all collections the authenticated user has access to.\n\n## Features\n- Searches all user's collections in parallel (up to 25)\n- Optionally includes public-domain entities\n- Filter by entity type or collection role\n- Results ranked by semantic relevance\n\n## Performance\n- Collections are queried in parallel for speed\n- If user has more than 25 collections, queries first 25 (by created_at). Use role filter to narrow down.\n- Response includes metadata showing collections_queried vs collections_total\n\n## Scoring\n- Results use cosine similarity scores (0-1)\n- Scores are comparable across collections\n\n## Entity Expansion\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n\n---\n**Permission:** `search:execute` \n**Auth:** required",
7624
8205
  "x-arke-action": "search:execute",
7625
8206
  "x-arke-auth": "required",
7626
8207
  "x-arke-tier": "external",
@@ -8766,7 +9347,7 @@
8766
9347
  "Collections"
8767
9348
  ],
8768
9349
  "summary": "List entities in a collection",
8769
- "description": "Returns entities belonging to this collection from the graph database.\n\nSupports pagination and optional type filtering. Results are ordered by creation date (newest first).\n\n---\n**Permission:** `collection:view` \n**Auth:** optional",
9350
+ "description": "Returns entities belonging to this collection from the graph database.\n\nSupports pagination and optional type filtering. Results are ordered by creation date (newest first).\n\n**Expansion Modes:**\n\nBy default, returns lightweight summaries from GraphDB (pi, type, label, timestamps).\n\nUse the `expand` parameter to hydrate entity data from storage:\n\n- **`?expand=preview`**: Adds `preview` field with fresh lightweight data (label, truncated description/text, timestamps). ~5-10KB per entity.\n\n- **`?expand=full`**: Adds `entity` field with complete manifest (all properties, relationships, version history). ~20-50KB per entity.\n\n**Performance Note:** Expansion requires fetching each entity from storage. Limited to 100 entities per request. Use smaller `limit` values when expanding.\n\n---\n**Permission:** `collection:view` \n**Auth:** optional",
8770
9351
  "x-arke-action": "collection:view",
8771
9352
  "x-arke-auth": "optional",
8772
9353
  "x-arke-tier": "external",
@@ -8816,7 +9397,21 @@
8816
9397
  "example": 0
8817
9398
  },
8818
9399
  "required": false,
8819
- "name": "offset",
9400
+ "name": "offset",
9401
+ "in": "query"
9402
+ },
9403
+ {
9404
+ "schema": {
9405
+ "type": "string",
9406
+ "enum": [
9407
+ "preview",
9408
+ "full"
9409
+ ],
9410
+ "description": "Expand entity data. \"preview\" adds lightweight previews, \"full\" adds complete manifests. Maximum 100 entities when using expand.",
9411
+ "example": "preview"
9412
+ },
9413
+ "required": false,
9414
+ "name": "expand",
8820
9415
  "in": "query"
8821
9416
  }
8822
9417
  ],
@@ -8974,7 +9569,7 @@
8974
9569
  "Entities"
8975
9570
  ],
8976
9571
  "summary": "Get entity by ID",
8977
- "description": "Returns any entity by ID. Permission check uses parent collection if entity belongs to one.\n\n---\n**Permission:** `entity:view` \n**Auth:** optional",
9572
+ "description": "Returns any entity by ID. Permission check uses parent collection if entity belongs to one.\n\n**Relationship Expansion:**\n\nUse the `expand=relationships[:mode]` query parameter to hydrate relationship peer data:\n\n- **No expansion (default)**: Returns relationships with stored `peer_label`/`peer_type` (may be stale)\n ```json\n { \"predicate\": \"contains\", \"peer\": \"01KDOC...\", \"peer_label\": \"Old Label\" }\n ```\n\n- **`?expand=relationships:preview`**: Adds `peer_preview` with fresh lightweight data (id, type, label, truncated description/text, timestamps)\n ```json\n {\n \"predicate\": \"contains\",\n \"peer\": \"01KDOC...\",\n \"peer_label\": \"Old Label\",\n \"peer_preview\": {\n \"id\": \"01KDOC...\",\n \"type\": \"document\",\n \"label\": \"Updated Label\",\n \"description_preview\": \"This is a document with...\",\n \"created_at\": \"2025-01-15T10:00:00Z\",\n \"updated_at\": \"2025-01-20T14:30:00Z\"\n }\n }\n ```\n\n- **`?expand=relationships:full`**: Adds `peer_entity` with complete entity manifest (all properties, relationships, version history)\n ```json\n {\n \"predicate\": \"contains\",\n \"peer\": \"01KDOC...\",\n \"peer_label\": \"Old Label\",\n \"peer_entity\": {\n \"id\": \"01KDOC...\",\n \"cid\": \"bafyrei...\",\n \"type\": \"document\",\n \"properties\": { \"label\": \"Updated Label\", \"text\": \"...\" },\n \"relationships\": [...],\n \"ver\": 3,\n \"created_at\": \"2025-01-15T10:00:00Z\",\n \"ts\": 1737380000000,\n \"edited_by\": { \"user_id\": \"01JUSER...\", \"method\": \"manual\" }\n }\n }\n ```\n\n**Performance:** Preview expansion is recommended for most use cases. Full expansion with many large entities can result in multi-MB payloads.\n\n---\n**Permission:** `entity:view` \n**Auth:** optional",
8978
9573
  "x-arke-action": "entity:view",
8979
9574
  "x-arke-auth": "optional",
8980
9575
  "x-arke-tier": "standard",
@@ -8990,6 +9585,16 @@
8990
9585
  "description": "Entity ID (ULID)",
8991
9586
  "name": "id",
8992
9587
  "in": "path"
9588
+ },
9589
+ {
9590
+ "schema": {
9591
+ "type": "string",
9592
+ "example": "relationships:preview"
9593
+ },
9594
+ "required": false,
9595
+ "description": "Comma-separated list of fields to expand. Supports: relationships[:preview|full]",
9596
+ "name": "expand",
9597
+ "in": "query"
8993
9598
  }
8994
9599
  ],
8995
9600
  "responses": {
@@ -9292,6 +9897,70 @@
9292
9897
  }
9293
9898
  }
9294
9899
  },
9900
+ "/entities/{id}/preview": {
9901
+ "get": {
9902
+ "tags": [
9903
+ "Entities"
9904
+ ],
9905
+ "summary": "Get entity preview",
9906
+ "description": "Returns lightweight preview data for an entity. Useful for:\n- Link previews and hover cards\n- Relationship metadata freshness (vs stale peer_label)\n- AI context management (smaller payloads)\n- Search result enhancement\n\nReturns: id, type, label, collection_pi, description_preview (200 chars), text_preview (200 chars), timestamps.\n\n**Performance:** Single KV fetch, ~40-60ms response time, typically <1KB payload.\n\n---\n**Permission:** `entity:view` \n**Auth:** optional",
9907
+ "x-arke-action": "entity:view",
9908
+ "x-arke-auth": "optional",
9909
+ "x-arke-tier": "standard",
9910
+ "parameters": [
9911
+ {
9912
+ "schema": {
9913
+ "type": "string",
9914
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
9915
+ "description": "Entity ID (ULID format)",
9916
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
9917
+ },
9918
+ "required": true,
9919
+ "description": "Entity ID (ULID)",
9920
+ "name": "id",
9921
+ "in": "path"
9922
+ }
9923
+ ],
9924
+ "responses": {
9925
+ "200": {
9926
+ "description": "Entity preview data",
9927
+ "content": {
9928
+ "application/json": {
9929
+ "schema": {
9930
+ "$ref": "#/components/schemas/EntityPreview"
9931
+ }
9932
+ }
9933
+ }
9934
+ },
9935
+ "403": {
9936
+ "description": "Forbidden - Insufficient permissions",
9937
+ "content": {
9938
+ "application/json": {
9939
+ "schema": {
9940
+ "$ref": "#/components/schemas/ErrorResponse"
9941
+ },
9942
+ "example": {
9943
+ "error": "Forbidden: You do not have permission to perform this action"
9944
+ }
9945
+ }
9946
+ }
9947
+ },
9948
+ "404": {
9949
+ "description": "Not Found - Resource does not exist",
9950
+ "content": {
9951
+ "application/json": {
9952
+ "schema": {
9953
+ "$ref": "#/components/schemas/ErrorResponse"
9954
+ },
9955
+ "example": {
9956
+ "error": "Entity not found"
9957
+ }
9958
+ }
9959
+ }
9960
+ }
9961
+ }
9962
+ }
9963
+ },
9295
9964
  "/entities/{id}/tip": {
9296
9965
  "get": {
9297
9966
  "tags": [
@@ -9343,6 +10012,138 @@
9343
10012
  }
9344
10013
  }
9345
10014
  },
10015
+ "/entities/{id}/cascade": {
10016
+ "delete": {
10017
+ "tags": [
10018
+ "Entities"
10019
+ ],
10020
+ "summary": "Cascade delete entity and related entities",
10021
+ "description": "Deletes an entity and all related entities matching predicate patterns within a scoped collection.\n\n**Permission Model:**\n- Requires `entity:delete` permission on the specified `collection_id`\n- Single permission check at the start (not per-entity)\n- Individual entity type permissions are NOT checked during cascade\n\n**Cascade Rules:**\n- `collection` predicate NEVER cascades (hard rule - protects collection structure)\n- Only entities in the specified collection are deleted\n- Entities outside the collection are skipped (reported in `skipped` array)\n\n**Predicate Patterns:**\n- `\"child\"` - exact match only\n- `\"has_*\"` - matches has_document, has_image, etc.\n- `\"*_copy\"` - matches file_copy, document_copy, etc.\n- `\"*\"` - matches ALL predicates (except collection)\n\n**Traversal:**\n- BFS traversal with parallel processing per depth layer\n- Max depth: 20 (default: 10)\n- Optional `edited_by_filter` to only delete entities created by a specific actor (useful for agent cleanup)\n\n**CAS Handling:**\n- Root entity uses the provided `expect_tip`\n- Child entities use re-fetch + single retry strategy\n- CAS conflicts are reported as skipped (not failures)\n\n**Response:**\n- Lists all deleted entities with their depth from root\n- Lists skipped entities with reasons\n- Provides summary statistics\n\n---\n**Permission:** `entity:delete` \n**Auth:** required",
10022
+ "x-arke-action": "entity:delete",
10023
+ "x-arke-auth": "required",
10024
+ "x-arke-tier": "standard",
10025
+ "security": [
10026
+ {
10027
+ "bearerAuth": []
10028
+ }
10029
+ ],
10030
+ "parameters": [
10031
+ {
10032
+ "schema": {
10033
+ "type": "string",
10034
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
10035
+ "description": "Entity ID (ULID format)",
10036
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
10037
+ },
10038
+ "required": true,
10039
+ "description": "Entity ID (ULID)",
10040
+ "name": "id",
10041
+ "in": "path"
10042
+ }
10043
+ ],
10044
+ "requestBody": {
10045
+ "content": {
10046
+ "application/json": {
10047
+ "schema": {
10048
+ "$ref": "#/components/schemas/CascadeDeleteRequest"
10049
+ }
10050
+ }
10051
+ }
10052
+ },
10053
+ "responses": {
10054
+ "200": {
10055
+ "description": "Cascade delete completed",
10056
+ "content": {
10057
+ "application/json": {
10058
+ "schema": {
10059
+ "$ref": "#/components/schemas/CascadeDeleteResponse"
10060
+ }
10061
+ }
10062
+ }
10063
+ },
10064
+ "400": {
10065
+ "description": "Bad Request - Invalid input",
10066
+ "content": {
10067
+ "application/json": {
10068
+ "schema": {
10069
+ "$ref": "#/components/schemas/ValidationErrorResponse"
10070
+ },
10071
+ "example": {
10072
+ "error": "Validation failed",
10073
+ "details": {
10074
+ "issues": [
10075
+ {
10076
+ "path": [
10077
+ "properties",
10078
+ "label"
10079
+ ],
10080
+ "message": "Required"
10081
+ }
10082
+ ]
10083
+ }
10084
+ }
10085
+ }
10086
+ }
10087
+ },
10088
+ "401": {
10089
+ "description": "Unauthorized - Missing or invalid authentication",
10090
+ "content": {
10091
+ "application/json": {
10092
+ "schema": {
10093
+ "$ref": "#/components/schemas/ErrorResponse"
10094
+ },
10095
+ "example": {
10096
+ "error": "Unauthorized: Missing or invalid authentication token"
10097
+ }
10098
+ }
10099
+ }
10100
+ },
10101
+ "403": {
10102
+ "description": "Forbidden - Insufficient permissions",
10103
+ "content": {
10104
+ "application/json": {
10105
+ "schema": {
10106
+ "$ref": "#/components/schemas/ErrorResponse"
10107
+ },
10108
+ "example": {
10109
+ "error": "Forbidden: You do not have permission to perform this action"
10110
+ }
10111
+ }
10112
+ }
10113
+ },
10114
+ "404": {
10115
+ "description": "Not Found - Resource does not exist",
10116
+ "content": {
10117
+ "application/json": {
10118
+ "schema": {
10119
+ "$ref": "#/components/schemas/ErrorResponse"
10120
+ },
10121
+ "example": {
10122
+ "error": "Entity not found"
10123
+ }
10124
+ }
10125
+ }
10126
+ },
10127
+ "409": {
10128
+ "description": "Conflict - CAS validation failed (entity was modified)",
10129
+ "content": {
10130
+ "application/json": {
10131
+ "schema": {
10132
+ "$ref": "#/components/schemas/CASErrorResponse"
10133
+ },
10134
+ "example": {
10135
+ "error": "Conflict: entity was modified",
10136
+ "details": {
10137
+ "expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
10138
+ "actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
10139
+ }
10140
+ }
10141
+ }
10142
+ }
10143
+ }
10144
+ }
10145
+ }
10146
+ },
9346
10147
  "/entities/{id}/restore": {
9347
10148
  "post": {
9348
10149
  "tags": [
@@ -13097,7 +13898,7 @@
13097
13898
  "Graph"
13098
13899
  ],
13099
13900
  "summary": "Find paths between entities",
13100
- "description": "Find shortest paths between source and target entity sets. Returns all paths up to the limit (default 100).\n\nUse this when you know both endpoints and want to discover how they connect - for example, finding the chain of relationships between a person and a document.\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
13901
+ "description": "Find shortest paths between source and target entity sets. Returns all paths up to the limit (default 100).\n\nUse this when you know both endpoints and want to discover how they connect - for example, finding the chain of relationships between a person and a document.\n\n**Entity Expansion (default: preview):**\n- Omit `expand` or use `?expand=preview` - Lightweight previews for all path entities\n- `?expand=full` - Complete entity manifests (use with caution)\n- `?expand=none` - Disable expansion (graph metadata only)\n\n**Performance Warning:** 100 paths can reference 400-800 unique entities, adding 5-10s latency with expansion.\n\n**Recommendations:**\n- Use `limit: 10-20` when using expansion\n- Prefer preview over full\n- Use `expand=none` for large result sets, then fetch specific entities separately\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
13101
13902
  "x-arke-action": "graph:query",
13102
13903
  "x-arke-auth": "required",
13103
13904
  "x-arke-tier": "external",
@@ -13106,6 +13907,23 @@
13106
13907
  "bearerAuth": []
13107
13908
  }
13108
13909
  ],
13910
+ "parameters": [
13911
+ {
13912
+ "schema": {
13913
+ "type": "string",
13914
+ "enum": [
13915
+ "preview",
13916
+ "full",
13917
+ "none"
13918
+ ],
13919
+ "example": "preview"
13920
+ },
13921
+ "required": false,
13922
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
13923
+ "name": "expand",
13924
+ "in": "query"
13925
+ }
13926
+ ],
13109
13927
  "requestBody": {
13110
13928
  "content": {
13111
13929
  "application/json": {
@@ -13159,7 +13977,7 @@
13159
13977
  "Graph"
13160
13978
  ],
13161
13979
  "summary": "Find reachable entities (exhaustive)",
13162
- "description": "Find all entities of a specific type reachable from source entities within N hops. Returns up to 100 results by default.\n\n**When to use this vs POST /query:** This endpoint returns exhaustive, unranked results - all reachable entities up to the limit. Use `POST /query` when you want relevance-ranked results combining semantic similarity with graph structure. Use this endpoint when you need comprehensive graph exploration from known entity IDs.\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
13980
+ "description": "Find all entities of a specific type reachable from source entities within N hops. Returns up to 100 results by default.\n\n**When to use this vs POST /query:** This endpoint returns exhaustive, unranked results - all reachable entities up to the limit. Use `POST /query` when you want relevance-ranked results combining semantic similarity with graph structure. Use this endpoint when you need comprehensive graph exploration from known entity IDs.\n\n**Target Expansion (default: preview):**\n- Omit `expand` or use `?expand=preview` - Lightweight target previews\n- `?expand=full` - Complete target manifests\n- `?expand=none` - Disable expansion (graph metadata only)\n\n**Performance:** With 100 targets, expansion adds ~1s.\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
13163
13981
  "x-arke-action": "graph:query",
13164
13982
  "x-arke-auth": "required",
13165
13983
  "x-arke-tier": "external",
@@ -13168,6 +13986,23 @@
13168
13986
  "bearerAuth": []
13169
13987
  }
13170
13988
  ],
13989
+ "parameters": [
13990
+ {
13991
+ "schema": {
13992
+ "type": "string",
13993
+ "enum": [
13994
+ "preview",
13995
+ "full",
13996
+ "none"
13997
+ ],
13998
+ "example": "preview"
13999
+ },
14000
+ "required": false,
14001
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
14002
+ "name": "expand",
14003
+ "in": "query"
14004
+ }
14005
+ ],
13171
14006
  "requestBody": {
13172
14007
  "content": {
13173
14008
  "application/json": {
@@ -13221,7 +14056,7 @@
13221
14056
  "Graph"
13222
14057
  ],
13223
14058
  "summary": "Get entity from graph",
13224
- "description": "Get entity details with all relationships from the graph database. Unlike the entity manifest, this includes both outgoing and incoming relationships - showing not just what this entity links to, but also what links to it.\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
14059
+ "description": "Get entity details with all relationships from the graph database. Unlike the entity manifest, this includes both outgoing and incoming relationships - showing not just what this entity links to, but also what links to it.\n\n**Peer Expansion (default: preview):**\n- Omit `expand` or use `?expand=preview` - Lightweight peer previews\n- `?expand=full` - Complete peer manifests\n- `?expand=none` - Disable expansion (graph metadata only)\n\n**Performance:** With 50 peers, expansion adds ~500ms.\n\n---\n**Permission:** `graph:query` \n**Auth:** required",
13225
14060
  "x-arke-action": "graph:query",
13226
14061
  "x-arke-auth": "required",
13227
14062
  "x-arke-tier": "external",
@@ -13242,6 +14077,21 @@
13242
14077
  "description": "Entity ID (ULID)",
13243
14078
  "name": "id",
13244
14079
  "in": "path"
14080
+ },
14081
+ {
14082
+ "schema": {
14083
+ "type": "string",
14084
+ "enum": [
14085
+ "preview",
14086
+ "full",
14087
+ "none"
14088
+ ],
14089
+ "example": "preview"
14090
+ },
14091
+ "required": false,
14092
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
14093
+ "name": "expand",
14094
+ "in": "query"
13245
14095
  }
13246
14096
  ],
13247
14097
  "responses": {
@@ -13277,7 +14127,7 @@
13277
14127
  "Query"
13278
14128
  ],
13279
14129
  "summary": "Execute Argo query",
13280
- "description": "Execute an Argo DSL query for path-based graph traversal with relevance ranking.\n\n## When to Use This Endpoint\n\n| Endpoint | Use Case |\n|----------|----------|\n| `POST /query` | Semantic search + graph traversal with **relevance-ranked** results (default k=25) |\n| `POST /graph/reachable` | **Exhaustive** graph exploration from known entities (default limit=100) |\n| `POST /graph/paths` | Find all shortest paths between two entity sets |\n\nThis endpoint combines semantic similarity scores with path length to rank results. For exhaustive graph traversal without ranking, use the `/graph/*` endpoints directly.\n\n## Query Syntax\n\n```\n[SCOPE_PREFIX] ENTRY_POINT [ENTRY_FILTER] [-[RELATION]{DEPTH}-> TARGET_FILTER]...\n```\n\n## Scope Prefixes\n\nControl where semantic search looks for entry points. Default is discovery mode.\n\n| Prefix | Description | Example |\n|--------|-------------|---------|\n| (none) | **Discovery mode** (default) - find relevant collections, then search within each | `\"medical notes\"` |\n| `@:collections` | Search for collections themselves | `@:collections \"columbia archives\"` |\n| `@:collection(id)` | Search within a specific collection | `@:collection(01JCOLL123) \"meeting\"` |\n| `@:discover` | Explicit discovery mode | `@:discover \"research papers\"` |\n| `@:public` | Search public domain only | `@:public \"orphaned data\"` |\n\n**Note:** Graph traversal (hops) is always cross-collection regardless of scope.\n\n### Entry Points\n\n| Syntax | Description | Example |\n|--------|-------------|---------|\n| `\"text\"` | Semantic search | `\"george washington\"` |\n| `@id` | Exact entity ID | `@01KE4ZY69F9R40E88PK9S0TQRQ` |\n| `type:X` | All entities of type | `type:person` |\n| `type:X ~ \"text\"` | Semantic search within type | `type:person ~ \"physician\"` |\n\n### Edges (Hops)\n\n| Syntax | Direction |\n|--------|-----------|\n| `-[*]->` | Outgoing |\n| `<-[*]-` | Incoming |\n| `<-[*]->` | Both |\n| `-[*]{,4}->` | Variable depth (1-4) |\n\n### Examples\n\n```\n\"george washington\" # Discovery mode (default)\n@:collections \"columbia university\" # Find collections\n@:collection(01JCOLL123) \"faculty meeting\" # Within specific collection\n@:discover \"alice\" -[*]{,2}-> type:person # Discover, then traverse\n@01KE4ZY... -[*]{,2}-> type:person # From exact entity\n```\n\n\n---\n**Permission:** `query:execute` \n**Auth:** required",
14130
+ "description": "Execute an Argo DSL query for path-based graph traversal with relevance ranking.\n\n## When to Use This Endpoint\n\n| Endpoint | Use Case |\n|----------|----------|\n| `POST /query` | Semantic search + graph traversal with **relevance-ranked** results (default k=25) |\n| `POST /graph/reachable` | **Exhaustive** graph exploration from known entities (default limit=100) |\n| `POST /graph/paths` | Find all shortest paths between two entity sets |\n\nThis endpoint combines semantic similarity scores with path length to rank results. For exhaustive graph traversal without ranking, use the `/graph/*` endpoints directly.\n\n## Query Syntax\n\n```\n[SCOPE_PREFIX] ENTRY_POINT [ENTRY_FILTER] [-[RELATION]{DEPTH}-> TARGET_FILTER]...\n```\n\n## Scope Prefixes\n\nControl where semantic search looks for entry points. Default is discovery mode.\n\n| Prefix | Description | Example |\n|--------|-------------|---------|\n| (none) | **Discovery mode** (default) - find relevant collections, then search within each | `\"medical notes\"` |\n| `@:collections` | Search for collections themselves | `@:collections \"columbia archives\"` |\n| `@:collection(id)` | Search within a specific collection | `@:collection(01JCOLL123) \"meeting\"` |\n| `@:discover` | Explicit discovery mode | `@:discover \"research papers\"` |\n| `@:public` | Search public domain only | `@:public \"orphaned data\"` |\n\n**Note:** Graph traversal (hops) is always cross-collection regardless of scope.\n\n### Entry Points\n\n| Syntax | Description | Example |\n|--------|-------------|---------|\n| `\"text\"` | Semantic search | `\"george washington\"` |\n| `@id` | Exact entity ID | `@01KE4ZY69F9R40E88PK9S0TQRQ` |\n| `type:X` | All entities of type | `type:person` |\n| `type:X ~ \"text\"` | Semantic search within type | `type:person ~ \"physician\"` |\n\n### Edges (Hops)\n\n| Syntax | Direction |\n|--------|-----------|\n| `-[*]->` | Outgoing |\n| `<-[*]-` | Incoming |\n| `<-[*]->` | Both |\n| `-[*]{,4}->` | Variable depth (1-4) |\n\n### Examples\n\n```\n\"george washington\" # Discovery mode (default)\n@:collections \"columbia university\" # Find collections\n@:collection(01JCOLL123) \"faculty meeting\" # Within specific collection\n@:discover \"alice\" -[*]{,2}-> type:person # Discover, then traverse\n@01KE4ZY... -[*]{,2}-> type:person # From exact entity\n```\n\n## Entity Expansion\n\nControl how much entity data is included in results via the `expand` parameter.\n\n| Value | Description | Use Case |\n|-------|-------------|----------|\n| (omitted) | **Preview** (default) - lightweight preview data | Best balance of detail and payload size |\n| `preview` | Same as omitted - lightweight preview data | Explicit preview mode |\n| `full` | Complete entity manifest | When you need all properties, relationships, versions |\n| `none` | No expansion - Pinecone metadata only | Fastest response, smallest payload |\n\n**Preview mode** includes: label, truncated description/text (200 chars), created_at, updated_at.\n\n**Full mode** includes: all properties, relationships, version info, CID.\n\nBoth result entities and path step entities are expanded.\n\n\n---\n**Permission:** `query:execute` \n**Auth:** required",
13281
14131
  "x-arke-action": "query:execute",
13282
14132
  "x-arke-auth": "required",
13283
14133
  "x-arke-tier": "external",
@@ -13339,7 +14189,7 @@
13339
14189
  "Search"
13340
14190
  ],
13341
14191
  "summary": "Find similar collections",
13342
- "description": "Find collections that are semantically similar to a given collection.\n\nUses the collection's weighted centroid vector (combination of description and entity embeddings) to find related collections.\n\n---\n**Permission:** `search:similar` \n**Auth:** required",
14192
+ "description": "Find collections that are semantically similar to a given collection.\n\nUses the collection's weighted centroid vector (combination of description and entity embeddings) to find related collections.\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:similar` \n**Auth:** required",
13343
14193
  "x-arke-action": "search:similar",
13344
14194
  "x-arke-auth": "required",
13345
14195
  "x-arke-tier": "external",
@@ -13369,6 +14219,16 @@
13369
14219
  "type": "boolean",
13370
14220
  "default": false,
13371
14221
  "description": "Force fresh query, bypassing cache"
14222
+ },
14223
+ "expand": {
14224
+ "type": "string",
14225
+ "enum": [
14226
+ "preview",
14227
+ "full",
14228
+ "none"
14229
+ ],
14230
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14231
+ "example": "preview"
13372
14232
  }
13373
14233
  },
13374
14234
  "required": [
@@ -13405,6 +14265,34 @@
13405
14265
  },
13406
14266
  "updated_at": {
13407
14267
  "type": "string"
14268
+ },
14269
+ "entity_preview": {
14270
+ "allOf": [
14271
+ {
14272
+ "$ref": "#/components/schemas/EntityPreview"
14273
+ },
14274
+ {
14275
+ "description": "Lightweight entity preview (included by default)",
14276
+ "example": {
14277
+ "id": "01KCOLLECTION123456789ABCD",
14278
+ "type": "collection",
14279
+ "label": "Research Papers Collection",
14280
+ "description_preview": "A curated collection of academic research papers...",
14281
+ "created_at": "2026-01-10T00:00:00.000Z",
14282
+ "updated_at": "2026-01-15T12:00:00.000Z"
14283
+ }
14284
+ }
14285
+ ]
14286
+ },
14287
+ "entity": {
14288
+ "allOf": [
14289
+ {
14290
+ "$ref": "#/components/schemas/EntityResponse"
14291
+ },
14292
+ {
14293
+ "description": "Full entity manifest (when expand: \"full\")"
14294
+ }
14295
+ ]
13408
14296
  }
13409
14297
  },
13410
14298
  "required": [
@@ -13506,7 +14394,7 @@
13506
14394
  "Search"
13507
14395
  ],
13508
14396
  "summary": "Find similar items across collections",
13509
- "description": "Find entities that are semantically similar to a given entity, searching across multiple collections.\n\nThis performs a two-tier search:\n1. First finds collections similar to the entity's collection\n2. Then searches within each collection for similar items\n3. Aggregates and ranks results with diversity weighting\n\n---\n**Permission:** `search:similar` \n**Auth:** required",
14397
+ "description": "Find entities that are semantically similar to a given entity, searching across multiple collections.\n\nThis performs a two-tier search:\n1. First finds collections similar to the entity's collection\n2. Then searches within each collection for similar items\n3. Aggregates and ranks results with diversity weighting\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:similar` \n**Auth:** required",
13510
14398
  "x-arke-action": "search:similar",
13511
14399
  "x-arke-auth": "required",
13512
14400
  "x-arke-tier": "external",
@@ -13559,6 +14447,16 @@
13559
14447
  "type": "boolean",
13560
14448
  "default": false,
13561
14449
  "description": "Force fresh query, bypassing cache"
14450
+ },
14451
+ "expand": {
14452
+ "type": "string",
14453
+ "enum": [
14454
+ "preview",
14455
+ "full",
14456
+ "none"
14457
+ ],
14458
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14459
+ "example": "preview"
13562
14460
  }
13563
14461
  },
13564
14462
  "required": [
@@ -13603,6 +14501,35 @@
13603
14501
  },
13604
14502
  "updated_at": {
13605
14503
  "type": "string"
14504
+ },
14505
+ "entity_preview": {
14506
+ "allOf": [
14507
+ {
14508
+ "$ref": "#/components/schemas/EntityPreview"
14509
+ },
14510
+ {
14511
+ "description": "Lightweight entity preview (included by default)",
14512
+ "example": {
14513
+ "id": "01KENTITY123456789ABCDEFGH",
14514
+ "type": "document",
14515
+ "label": "Similar Research Paper",
14516
+ "collection_pi": "01JCOLLECTION123456789AB",
14517
+ "description_preview": "Related findings on distributed systems...",
14518
+ "created_at": "2026-01-08T00:00:00.000Z",
14519
+ "updated_at": "2026-01-12T10:00:00.000Z"
14520
+ }
14521
+ }
14522
+ ]
14523
+ },
14524
+ "entity": {
14525
+ "allOf": [
14526
+ {
14527
+ "$ref": "#/components/schemas/EntityResponse"
14528
+ },
14529
+ {
14530
+ "description": "Full entity manifest (when expand: \"full\")"
14531
+ }
14532
+ ]
13606
14533
  }
13607
14534
  },
13608
14535
  "required": [
@@ -13710,7 +14637,7 @@
13710
14637
  "Search"
13711
14638
  ],
13712
14639
  "summary": "Search collections by text",
13713
- "description": "Search for collections using semantic text search.\n\nUse this endpoint to discover collections about a topic. Results are ranked by semantic similarity to your query.\n\n---\n**Permission:** `search:query` \n**Auth:** required",
14640
+ "description": "Search for collections using semantic text search.\n\nUse this endpoint to discover collections about a topic. Results are ranked by semantic similarity to your query.\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:query` \n**Auth:** required",
13714
14641
  "x-arke-action": "search:query",
13715
14642
  "x-arke-auth": "required",
13716
14643
  "x-arke-tier": "external",
@@ -13744,6 +14671,16 @@
13744
14671
  "type": "string"
13745
14672
  },
13746
14673
  "description": "Filter by collection types"
14674
+ },
14675
+ "expand": {
14676
+ "type": "string",
14677
+ "enum": [
14678
+ "preview",
14679
+ "full",
14680
+ "none"
14681
+ ],
14682
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14683
+ "example": "preview"
13747
14684
  }
13748
14685
  },
13749
14686
  "required": [
@@ -13783,6 +14720,34 @@
13783
14720
  },
13784
14721
  "updated_at": {
13785
14722
  "type": "string"
14723
+ },
14724
+ "entity_preview": {
14725
+ "allOf": [
14726
+ {
14727
+ "$ref": "#/components/schemas/EntityPreview"
14728
+ },
14729
+ {
14730
+ "description": "Lightweight entity preview (included by default)",
14731
+ "example": {
14732
+ "id": "01KCOLLECTION123456789ABCD",
14733
+ "type": "collection",
14734
+ "label": "Machine Learning Papers",
14735
+ "description_preview": "A collection of papers on neural networks and deep learning...",
14736
+ "created_at": "2026-01-05T00:00:00.000Z",
14737
+ "updated_at": "2026-01-10T08:00:00.000Z"
14738
+ }
14739
+ }
14740
+ ]
14741
+ },
14742
+ "entity": {
14743
+ "allOf": [
14744
+ {
14745
+ "$ref": "#/components/schemas/EntityResponse"
14746
+ },
14747
+ {
14748
+ "description": "Full entity manifest (when expand: \"full\")"
14749
+ }
14750
+ ]
13786
14751
  }
13787
14752
  },
13788
14753
  "required": [
@@ -13866,7 +14831,7 @@
13866
14831
  "Search"
13867
14832
  ],
13868
14833
  "summary": "Search agents by text",
13869
- "description": "Search for agents using semantic text search.\n\nUse this endpoint to discover agents across the network. Only active agents are returned. Results are ranked by semantic similarity to your query based on agent descriptions and capabilities.\n\n---\n**Permission:** `search:query` \n**Auth:** required",
14834
+ "description": "Search for agents using semantic text search.\n\nUse this endpoint to discover agents across the network. Only active agents are returned. Results are ranked by semantic similarity to your query based on agent descriptions and capabilities.\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:query` \n**Auth:** required",
13870
14835
  "x-arke-action": "search:query",
13871
14836
  "x-arke-auth": "required",
13872
14837
  "x-arke-tier": "external",
@@ -13893,6 +14858,16 @@
13893
14858
  "maximum": 100,
13894
14859
  "default": 10,
13895
14860
  "description": "Maximum results to return"
14861
+ },
14862
+ "expand": {
14863
+ "type": "string",
14864
+ "enum": [
14865
+ "preview",
14866
+ "full",
14867
+ "none"
14868
+ ],
14869
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14870
+ "example": "preview"
13896
14871
  }
13897
14872
  },
13898
14873
  "required": [
@@ -13936,6 +14911,35 @@
13936
14911
  },
13937
14912
  "updated_at": {
13938
14913
  "type": "string"
14914
+ },
14915
+ "entity_preview": {
14916
+ "allOf": [
14917
+ {
14918
+ "$ref": "#/components/schemas/EntityPreview"
14919
+ },
14920
+ {
14921
+ "description": "Lightweight entity preview (included by default)",
14922
+ "example": {
14923
+ "id": "01KAGENT123456789ABCDEFGHI",
14924
+ "type": "agent",
14925
+ "label": "Document Analyzer Agent",
14926
+ "collection_pi": "01JCOLLECTION123456789AB",
14927
+ "description_preview": "An AI agent that analyzes documents and extracts key insights...",
14928
+ "created_at": "2026-01-01T00:00:00.000Z",
14929
+ "updated_at": "2026-01-15T16:00:00.000Z"
14930
+ }
14931
+ }
14932
+ ]
14933
+ },
14934
+ "entity": {
14935
+ "allOf": [
14936
+ {
14937
+ "$ref": "#/components/schemas/EntityResponse"
14938
+ },
14939
+ {
14940
+ "description": "Full entity manifest (when expand: \"full\")"
14941
+ }
14942
+ ]
13939
14943
  }
13940
14944
  },
13941
14945
  "required": [
@@ -14019,7 +15023,7 @@
14019
15023
  "Search"
14020
15024
  ],
14021
15025
  "summary": "Search entities within collection(s)",
14022
- "description": "Search for entities within one or more collections using semantic text search.\n\nProvide either `collection_pi` for a single collection or `collection_pis` for multiple collections (searched in parallel).\n\nUse `per_collection_limit` to ensure result diversity when searching multiple collections.\n\n---\n**Permission:** `search:query` \n**Auth:** required",
15026
+ "description": "Search for entities within one or more collections using semantic text search.\n\nProvide either `collection_pi` for a single collection or `collection_pis` for multiple collections (searched in parallel).\n\nUse `per_collection_limit` to ensure result diversity when searching multiple collections.\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:query` \n**Auth:** required",
14023
15027
  "x-arke-action": "search:query",
14024
15028
  "x-arke-auth": "required",
14025
15029
  "x-arke-tier": "external",
@@ -14071,6 +15075,16 @@
14071
15075
  "minimum": 1,
14072
15076
  "maximum": 50,
14073
15077
  "description": "Max results per collection for diversity"
15078
+ },
15079
+ "expand": {
15080
+ "type": "string",
15081
+ "enum": [
15082
+ "preview",
15083
+ "full",
15084
+ "none"
15085
+ ],
15086
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
15087
+ "example": "preview"
14074
15088
  }
14075
15089
  },
14076
15090
  "required": [
@@ -14113,6 +15127,35 @@
14113
15127
  },
14114
15128
  "updated_at": {
14115
15129
  "type": "string"
15130
+ },
15131
+ "entity_preview": {
15132
+ "allOf": [
15133
+ {
15134
+ "$ref": "#/components/schemas/EntityPreview"
15135
+ },
15136
+ {
15137
+ "description": "Lightweight entity preview (included by default)",
15138
+ "example": {
15139
+ "id": "01KENTITY123456789ABCDEFGH",
15140
+ "type": "document",
15141
+ "label": "Research Findings Report",
15142
+ "collection_pi": "01JCOLLECTION123456789AB",
15143
+ "description_preview": "Detailed analysis of experimental results...",
15144
+ "created_at": "2026-01-10T00:00:00.000Z",
15145
+ "updated_at": "2026-01-14T09:00:00.000Z"
15146
+ }
15147
+ }
15148
+ ]
15149
+ },
15150
+ "entity": {
15151
+ "allOf": [
15152
+ {
15153
+ "$ref": "#/components/schemas/EntityResponse"
15154
+ },
15155
+ {
15156
+ "description": "Full entity manifest (when expand: \"full\")"
15157
+ }
15158
+ ]
14116
15159
  }
14117
15160
  },
14118
15161
  "required": [
@@ -14208,7 +15251,7 @@
14208
15251
  "Search"
14209
15252
  ],
14210
15253
  "summary": "Discover entities across all collections",
14211
- "description": "Two-step discovery search: first finds relevant collections, then searches within them.\n\nUse this endpoint when you don't know which collections to search. The system will:\n1. Find collections semantically related to your query\n2. Search within each collection in parallel\n3. Aggregate and rank results across all collections\n\nGreat for exploration and AI agents navigating the network.\n\n---\n**Permission:** `search:query` \n**Auth:** required",
15254
+ "description": "Two-step discovery search: first finds relevant collections, then searches within them.\n\nUse this endpoint when you don't know which collections to search. The system will:\n1. Find collections semantically related to your query\n2. Search within each collection in parallel\n3. Aggregate and rank results across all collections\n\nGreat for exploration and AI agents navigating the network.\n\n**Entity Expansion:**\n\nUse `expand` in the request body to fetch entity data inline with search results:\n\n- **`expand: \"preview\"` (default)**: Adds `entity_preview` with fresh lightweight data (id, type, label, timestamps)\n- **`expand: \"full\"`**: Adds `entity` with complete manifest including all properties and relationships\n- **`expand: \"none\"`**: Returns search metadata only (fastest, lowest bandwidth)\n\nPreview mode is recommended for most use cases. Full expansion can result in large payloads.\nGracefully handles deleted or inaccessible entities (returns results without expansion data).\n\n---\n**Permission:** `search:query` \n**Auth:** required",
14212
15255
  "x-arke-action": "search:query",
14213
15256
  "x-arke-auth": "required",
14214
15257
  "x-arke-tier": "external",
@@ -14256,6 +15299,16 @@
14256
15299
  "maximum": 20,
14257
15300
  "default": 5,
14258
15301
  "description": "Max results per collection"
15302
+ },
15303
+ "expand": {
15304
+ "type": "string",
15305
+ "enum": [
15306
+ "preview",
15307
+ "full",
15308
+ "none"
15309
+ ],
15310
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
15311
+ "example": "preview"
14259
15312
  }
14260
15313
  },
14261
15314
  "required": [
@@ -14298,6 +15351,35 @@
14298
15351
  },
14299
15352
  "updated_at": {
14300
15353
  "type": "string"
15354
+ },
15355
+ "entity_preview": {
15356
+ "allOf": [
15357
+ {
15358
+ "$ref": "#/components/schemas/EntityPreview"
15359
+ },
15360
+ {
15361
+ "description": "Lightweight entity preview (included by default)",
15362
+ "example": {
15363
+ "id": "01KENTITY123456789ABCDEFGH",
15364
+ "type": "file",
15365
+ "label": "Discovered Document.pdf",
15366
+ "collection_pi": "01JCOLLECTION123456789AB",
15367
+ "description_preview": "A document discovered through semantic search...",
15368
+ "created_at": "2026-01-08T00:00:00.000Z",
15369
+ "updated_at": "2026-01-12T14:00:00.000Z"
15370
+ }
15371
+ }
15372
+ ]
15373
+ },
15374
+ "entity": {
15375
+ "allOf": [
15376
+ {
15377
+ "$ref": "#/components/schemas/EntityResponse"
15378
+ },
15379
+ {
15380
+ "description": "Full entity manifest (when expand: \"full\")"
15381
+ }
15382
+ ]
14301
15383
  }
14302
15384
  },
14303
15385
  "required": [