@arke-institute/sdk 2.3.14 → 2.6.1

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": [
@@ -6048,95 +6153,77 @@
6048
6153
  }
6049
6154
  }
6050
6155
  },
6051
- "EntityRef": {
6156
+ "JobProgress": {
6052
6157
  "type": "object",
6053
6158
  "properties": {
6054
- "pi": {
6055
- "type": "string",
6056
- "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6057
- "description": "Entity ID (ULID format)",
6058
- "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6159
+ "total": {
6160
+ "type": "integer",
6161
+ "minimum": 0,
6162
+ "description": "Total items to process",
6163
+ "example": 10
6059
6164
  },
6060
- "type": {
6061
- "type": "string"
6165
+ "pending": {
6166
+ "type": "integer",
6167
+ "minimum": 0,
6168
+ "description": "Items not yet started",
6169
+ "example": 3
6062
6170
  },
6063
- "label": {
6064
- "type": "string"
6171
+ "dispatched": {
6172
+ "type": "integer",
6173
+ "minimum": 0,
6174
+ "description": "Items dispatched but not complete",
6175
+ "example": 2
6176
+ },
6177
+ "done": {
6178
+ "type": "integer",
6179
+ "minimum": 0,
6180
+ "description": "Successfully completed items",
6181
+ "example": 4
6182
+ },
6183
+ "error": {
6184
+ "type": "integer",
6185
+ "minimum": 0,
6186
+ "description": "Failed items",
6187
+ "example": 1
6065
6188
  }
6066
6189
  },
6067
6190
  "required": [
6068
- "pi"
6191
+ "total",
6192
+ "pending",
6193
+ "done",
6194
+ "error"
6069
6195
  ]
6070
6196
  },
6071
- "JobStatusResponse": {
6197
+ "JobError": {
6072
6198
  "type": "object",
6073
6199
  "properties": {
6074
- "id": {
6075
- "type": "string",
6076
- "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6077
- "description": "Entity ID (ULID format)",
6078
- "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6079
- },
6080
- "cid": {
6081
- "type": "string",
6082
- "minLength": 1,
6083
- "description": "Content Identifier (CID) - content-addressed hash",
6084
- "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
6085
- },
6086
- "status": {
6200
+ "code": {
6087
6201
  "type": "string",
6088
- "enum": [
6089
- "running",
6090
- "done",
6091
- "error"
6092
- ],
6093
- "description": "Job collection status",
6094
- "example": "running"
6202
+ "description": "Error code",
6203
+ "example": "TIMEOUT"
6095
6204
  },
6096
- "started_at": {
6205
+ "message": {
6097
6206
  "type": "string",
6098
- "format": "date-time",
6099
- "description": "ISO 8601 datetime",
6100
- "example": "2025-12-26T12:00:00.000Z"
6101
- },
6102
- "completed_at": {
6207
+ "description": "Human-readable error message",
6208
+ "example": "Request timed out after 30 seconds"
6209
+ }
6210
+ },
6211
+ "required": [
6212
+ "code",
6213
+ "message"
6214
+ ]
6215
+ },
6216
+ "AgentUnreachableError": {
6217
+ "type": "object",
6218
+ "properties": {
6219
+ "error": {
6103
6220
  "type": "string",
6104
- "nullable": true,
6105
- "format": "date-time",
6106
- "description": "ISO 8601 datetime",
6107
- "example": "2025-12-26T12:00:00.000Z"
6108
- },
6109
- "agent": {
6110
- "$ref": "#/components/schemas/EntityRef"
6111
- },
6112
- "target": {
6113
- "$ref": "#/components/schemas/EntityRef"
6114
- },
6115
- "main_agent": {
6116
- "$ref": "#/components/schemas/EntityRef"
6117
- },
6118
- "files_count": {
6119
- "type": "integer",
6120
- "minimum": 0,
6121
- "description": "Number of files contained in this job collection",
6122
- "example": 5
6123
- },
6124
- "sub_jobs_count": {
6125
- "type": "integer",
6126
- "minimum": 0,
6127
- "description": "Number of sub-job collections",
6128
- "example": 2
6221
+ "description": "Error message",
6222
+ "example": "Failed to reach agent: Connection refused"
6129
6223
  }
6130
6224
  },
6131
6225
  "required": [
6132
- "id",
6133
- "cid",
6134
- "status",
6135
- "started_at",
6136
- "completed_at",
6137
- "agent",
6138
- "files_count",
6139
- "sub_jobs_count"
6226
+ "error"
6140
6227
  ]
6141
6228
  },
6142
6229
  "Event": {
@@ -6216,6 +6303,26 @@
6216
6303
  "type": "string",
6217
6304
  "description": "Source entity type"
6218
6305
  },
6306
+ "subject_preview": {
6307
+ "allOf": [
6308
+ {
6309
+ "$ref": "#/components/schemas/EntityPreview"
6310
+ },
6311
+ {
6312
+ "description": "Fresh subject preview (default, or expand=preview)"
6313
+ }
6314
+ ]
6315
+ },
6316
+ "subject_entity": {
6317
+ "allOf": [
6318
+ {
6319
+ "$ref": "#/components/schemas/EntityResponse"
6320
+ },
6321
+ {
6322
+ "description": "Full subject manifest (expand=full)"
6323
+ }
6324
+ ]
6325
+ },
6219
6326
  "predicate": {
6220
6327
  "type": "string",
6221
6328
  "description": "Relationship predicate"
@@ -6233,6 +6340,26 @@
6233
6340
  "object_type": {
6234
6341
  "type": "string",
6235
6342
  "description": "Target entity type"
6343
+ },
6344
+ "object_preview": {
6345
+ "allOf": [
6346
+ {
6347
+ "$ref": "#/components/schemas/EntityPreview"
6348
+ },
6349
+ {
6350
+ "description": "Fresh object preview (default, or expand=preview)"
6351
+ }
6352
+ ]
6353
+ },
6354
+ "object_entity": {
6355
+ "allOf": [
6356
+ {
6357
+ "$ref": "#/components/schemas/EntityResponse"
6358
+ },
6359
+ {
6360
+ "description": "Full object manifest (expand=full)"
6361
+ }
6362
+ ]
6236
6363
  }
6237
6364
  },
6238
6365
  "required": [
@@ -6243,7 +6370,34 @@
6243
6370
  "object_pi",
6244
6371
  "object_label",
6245
6372
  "object_type"
6246
- ]
6373
+ ],
6374
+ "example": {
6375
+ "subject_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6376
+ "subject_label": "Project Folder",
6377
+ "subject_type": "folder",
6378
+ "subject_preview": {
6379
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
6380
+ "type": "folder",
6381
+ "label": "Project Folder",
6382
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6383
+ "description_preview": "Main project folder containing research documents...",
6384
+ "created_at": "2025-01-10T08:00:00.000Z",
6385
+ "updated_at": "2025-01-18T16:45:00.000Z"
6386
+ },
6387
+ "predicate": "contains",
6388
+ "object_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6389
+ "object_label": "Research Paper.pdf",
6390
+ "object_type": "file",
6391
+ "object_preview": {
6392
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6393
+ "type": "file",
6394
+ "label": "Research Paper.pdf",
6395
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6396
+ "description_preview": "Analysis of entity management patterns and best practices...",
6397
+ "created_at": "2025-01-15T10:00:00.000Z",
6398
+ "updated_at": "2025-01-20T14:30:00.000Z"
6399
+ }
6400
+ }
6247
6401
  },
6248
6402
  "PathResult": {
6249
6403
  "type": "object",
@@ -6391,6 +6545,26 @@
6391
6545
  "items": {
6392
6546
  "$ref": "#/components/schemas/PathEdge"
6393
6547
  }
6548
+ },
6549
+ "target_preview": {
6550
+ "allOf": [
6551
+ {
6552
+ "$ref": "#/components/schemas/EntityPreview"
6553
+ },
6554
+ {
6555
+ "description": "Fresh target preview (default, or expand=preview)"
6556
+ }
6557
+ ]
6558
+ },
6559
+ "target_entity": {
6560
+ "allOf": [
6561
+ {
6562
+ "$ref": "#/components/schemas/EntityResponse"
6563
+ },
6564
+ {
6565
+ "description": "Full target manifest (expand=full)"
6566
+ }
6567
+ ]
6394
6568
  }
6395
6569
  },
6396
6570
  "required": [
@@ -6400,7 +6574,24 @@
6400
6574
  "target_type",
6401
6575
  "length",
6402
6576
  "edges"
6403
- ]
6577
+ ],
6578
+ "example": {
6579
+ "source_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6580
+ "target_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6581
+ "target_label": "Research Paper.pdf",
6582
+ "target_type": "file",
6583
+ "length": 1,
6584
+ "edges": [],
6585
+ "target_preview": {
6586
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6587
+ "type": "file",
6588
+ "label": "Research Paper.pdf",
6589
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6590
+ "description_preview": "Analysis of entity management patterns and best practices...",
6591
+ "created_at": "2025-01-15T10:00:00.000Z",
6592
+ "updated_at": "2025-01-20T14:30:00.000Z"
6593
+ }
6594
+ }
6404
6595
  },
6405
6596
  "PathsReachableResponse": {
6406
6597
  "type": "object",
@@ -6507,6 +6698,26 @@
6507
6698
  "additionalProperties": {
6508
6699
  "nullable": true
6509
6700
  }
6701
+ },
6702
+ "peer_preview": {
6703
+ "allOf": [
6704
+ {
6705
+ "$ref": "#/components/schemas/EntityPreview"
6706
+ },
6707
+ {
6708
+ "description": "Fresh peer preview (default, or expand=preview)"
6709
+ }
6710
+ ]
6711
+ },
6712
+ "peer_entity": {
6713
+ "allOf": [
6714
+ {
6715
+ "$ref": "#/components/schemas/EntityResponse"
6716
+ },
6717
+ {
6718
+ "description": "Full peer manifest (expand=full)"
6719
+ }
6720
+ ]
6510
6721
  }
6511
6722
  },
6512
6723
  "required": [
@@ -6516,7 +6727,24 @@
6516
6727
  "peer_type",
6517
6728
  "peer_label",
6518
6729
  "properties"
6519
- ]
6730
+ ],
6731
+ "example": {
6732
+ "direction": "outgoing",
6733
+ "predicate": "contains",
6734
+ "peer_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6735
+ "peer_type": "file",
6736
+ "peer_label": "Research Paper.pdf",
6737
+ "properties": {},
6738
+ "peer_preview": {
6739
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6740
+ "type": "file",
6741
+ "label": "Research Paper.pdf",
6742
+ "collection_pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6743
+ "description_preview": "Analysis of entity management patterns and best practices...",
6744
+ "created_at": "2025-01-15T10:00:00.000Z",
6745
+ "updated_at": "2025-01-20T14:30:00.000Z"
6746
+ }
6747
+ }
6520
6748
  },
6521
6749
  "GraphEntityResponse": {
6522
6750
  "type": "object",
@@ -6560,54 +6788,34 @@
6560
6788
  "created_at",
6561
6789
  "updated_at",
6562
6790
  "relationships"
6563
- ]
6564
- },
6565
- "QueryEntity": {
6566
- "type": "object",
6567
- "properties": {
6568
- "pi": {
6569
- "type": "string",
6570
- "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6571
- "description": "Entity ID (ULID format)",
6572
- "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6573
- },
6574
- "type": {
6575
- "type": "string"
6576
- },
6577
- "label": {
6578
- "type": "string"
6579
- },
6580
- "collection_pi": {
6581
- "type": "string",
6582
- "nullable": true
6583
- }
6584
- },
6585
- "required": [
6586
- "pi",
6587
- "type",
6588
- "label",
6589
- "collection_pi"
6590
- ]
6591
- },
6592
- "EntityStep": {
6593
- "type": "object",
6594
- "properties": {
6595
- "entity": {
6596
- "type": "string"
6597
- },
6598
- "label": {
6599
- "type": "string"
6600
- },
6601
- "type": {
6602
- "type": "string"
6603
- },
6604
- "score": {
6605
- "type": "number"
6606
- }
6607
- },
6608
- "required": [
6609
- "entity"
6610
- ]
6791
+ ],
6792
+ "example": {
6793
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
6794
+ "type": "folder",
6795
+ "label": "Project Folder",
6796
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6797
+ "created_at": "2025-01-10T08:00:00.000Z",
6798
+ "updated_at": "2025-01-18T16:45:00.000Z",
6799
+ "relationships": [
6800
+ {
6801
+ "direction": "outgoing",
6802
+ "predicate": "contains",
6803
+ "peer_pi": "01KE506KZGD8M2P1XK3VNQT4YR",
6804
+ "peer_type": "file",
6805
+ "peer_label": "Research Paper.pdf",
6806
+ "properties": {},
6807
+ "peer_preview": {
6808
+ "id": "01KE506KZGD8M2P1XK3VNQT4YR",
6809
+ "type": "file",
6810
+ "label": "Research Paper.pdf",
6811
+ "collection_pi": "01JCOLLECTION123456789ABCD",
6812
+ "description_preview": "Analysis of entity management patterns and best practices...",
6813
+ "created_at": "2025-01-15T10:00:00.000Z",
6814
+ "updated_at": "2025-01-20T14:30:00.000Z"
6815
+ }
6816
+ }
6817
+ ]
6818
+ }
6611
6819
  },
6612
6820
  "EdgeStep": {
6613
6821
  "type": "object",
@@ -6634,35 +6842,71 @@
6634
6842
  "PathStep": {
6635
6843
  "anyOf": [
6636
6844
  {
6637
- "$ref": "#/components/schemas/EntityStep"
6845
+ "type": "object",
6846
+ "properties": {
6847
+ "entity": {
6848
+ "type": "string",
6849
+ "description": "Entity ID",
6850
+ "example": "01KPERSON_EINSTEIN"
6851
+ },
6852
+ "label": {
6853
+ "type": "string",
6854
+ "example": "Albert Einstein"
6855
+ },
6856
+ "type": {
6857
+ "type": "string",
6858
+ "example": "person"
6859
+ },
6860
+ "score": {
6861
+ "type": "number",
6862
+ "description": "Semantic similarity score (0-1)",
6863
+ "example": 0.92
6864
+ },
6865
+ "preview_data": {
6866
+ "allOf": [
6867
+ {
6868
+ "$ref": "#/components/schemas/EntityPreview"
6869
+ },
6870
+ {
6871
+ "description": "Entity preview data (present by default, omit expand or use expand=preview)"
6872
+ }
6873
+ ]
6874
+ },
6875
+ "full_entity": {
6876
+ "allOf": [
6877
+ {
6878
+ "$ref": "#/components/schemas/EntityResponse"
6879
+ },
6880
+ {
6881
+ "description": "Full entity manifest (only present when expand=full)"
6882
+ }
6883
+ ]
6884
+ }
6885
+ },
6886
+ "required": [
6887
+ "entity"
6888
+ ],
6889
+ "description": "Entity step in a query path",
6890
+ "example": {
6891
+ "entity": "01KPERSON_EINSTEIN",
6892
+ "label": "Albert Einstein",
6893
+ "type": "person",
6894
+ "score": 0.92,
6895
+ "preview_data": {
6896
+ "id": "01KPERSON_EINSTEIN",
6897
+ "type": "person",
6898
+ "label": "Albert Einstein",
6899
+ "description_preview": "German-born theoretical physicist...",
6900
+ "created_at": "2025-01-01T00:00:00.000Z",
6901
+ "updated_at": "2025-01-15T12:00:00.000Z"
6902
+ }
6903
+ }
6638
6904
  },
6639
6905
  {
6640
6906
  "$ref": "#/components/schemas/EdgeStep"
6641
6907
  }
6642
6908
  ]
6643
6909
  },
6644
- "QueryResultItem": {
6645
- "type": "object",
6646
- "properties": {
6647
- "entity": {
6648
- "$ref": "#/components/schemas/QueryEntity"
6649
- },
6650
- "path": {
6651
- "type": "array",
6652
- "items": {
6653
- "$ref": "#/components/schemas/PathStep"
6654
- }
6655
- },
6656
- "score": {
6657
- "type": "number"
6658
- }
6659
- },
6660
- "required": [
6661
- "entity",
6662
- "path",
6663
- "score"
6664
- ]
6665
- },
6666
6910
  "QueryMetadata": {
6667
6911
  "type": "object",
6668
6912
  "properties": {
@@ -6718,7 +6962,129 @@
6718
6962
  "results": {
6719
6963
  "type": "array",
6720
6964
  "items": {
6721
- "$ref": "#/components/schemas/QueryResultItem"
6965
+ "type": "object",
6966
+ "properties": {
6967
+ "entity": {
6968
+ "type": "object",
6969
+ "properties": {
6970
+ "pi": {
6971
+ "type": "string",
6972
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6973
+ "description": "Entity ID (ULID format)",
6974
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6975
+ },
6976
+ "type": {
6977
+ "type": "string",
6978
+ "example": "person"
6979
+ },
6980
+ "label": {
6981
+ "type": "string",
6982
+ "example": "Albert Einstein"
6983
+ },
6984
+ "collection_pi": {
6985
+ "type": "string",
6986
+ "nullable": true,
6987
+ "example": "01JCOLL_RESEARCH"
6988
+ },
6989
+ "preview_data": {
6990
+ "allOf": [
6991
+ {
6992
+ "$ref": "#/components/schemas/EntityPreview"
6993
+ },
6994
+ {
6995
+ "description": "Entity preview data (present by default, omit expand or use expand=preview)"
6996
+ }
6997
+ ]
6998
+ },
6999
+ "full_entity": {
7000
+ "allOf": [
7001
+ {
7002
+ "$ref": "#/components/schemas/EntityResponse"
7003
+ },
7004
+ {
7005
+ "description": "Full entity manifest (only present when expand=full)"
7006
+ }
7007
+ ]
7008
+ }
7009
+ },
7010
+ "required": [
7011
+ "pi",
7012
+ "type",
7013
+ "label",
7014
+ "collection_pi"
7015
+ ],
7016
+ "description": "Query result entity with optional expansion data",
7017
+ "example": {
7018
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
7019
+ "type": "person",
7020
+ "label": "Albert Einstein",
7021
+ "collection_pi": "01JCOLL_RESEARCH",
7022
+ "preview_data": {
7023
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
7024
+ "type": "person",
7025
+ "label": "Albert Einstein",
7026
+ "collection_pi": "01JCOLL_RESEARCH",
7027
+ "description_preview": "German-born theoretical physicist who developed the theory of relativity...",
7028
+ "created_at": "2025-01-15T10:00:00.000Z",
7029
+ "updated_at": "2025-01-20T14:30:00.000Z"
7030
+ }
7031
+ }
7032
+ },
7033
+ "path": {
7034
+ "type": "array",
7035
+ "items": {
7036
+ "$ref": "#/components/schemas/PathStep"
7037
+ },
7038
+ "description": "Path from entry point to result entity (empty for zero-hop queries)"
7039
+ },
7040
+ "score": {
7041
+ "type": "number",
7042
+ "description": "Combined relevance score (semantic similarity + path length)",
7043
+ "example": 0.89
7044
+ }
7045
+ },
7046
+ "required": [
7047
+ "entity",
7048
+ "path",
7049
+ "score"
7050
+ ],
7051
+ "description": "A single query result with entity, path, and score",
7052
+ "example": {
7053
+ "entity": {
7054
+ "pi": "01KE4ZY69F9R40E88PK9S0TQRQ",
7055
+ "type": "file",
7056
+ "label": "Theory of Relativity.pdf",
7057
+ "collection_pi": "01JCOLL_RESEARCH",
7058
+ "preview_data": {
7059
+ "id": "01KE4ZY69F9R40E88PK9S0TQRQ",
7060
+ "type": "file",
7061
+ "label": "Theory of Relativity.pdf",
7062
+ "collection_pi": "01JCOLL_RESEARCH",
7063
+ "description_preview": "Seminal paper on special and general relativity...",
7064
+ "created_at": "2025-01-10T08:00:00.000Z",
7065
+ "updated_at": "2025-01-10T08:00:00.000Z"
7066
+ }
7067
+ },
7068
+ "path": [
7069
+ {
7070
+ "entity": "01KPERSON_EINSTEIN",
7071
+ "label": "Albert Einstein",
7072
+ "type": "person",
7073
+ "preview_data": {
7074
+ "id": "01KPERSON_EINSTEIN",
7075
+ "type": "person",
7076
+ "label": "Albert Einstein",
7077
+ "created_at": "2025-01-01T00:00:00.000Z",
7078
+ "updated_at": "2025-01-15T12:00:00.000Z"
7079
+ }
7080
+ },
7081
+ {
7082
+ "edge": "authored",
7083
+ "direction": "outgoing"
7084
+ }
7085
+ ],
7086
+ "score": 0.89
7087
+ }
6722
7088
  }
6723
7089
  },
6724
7090
  "metadata": {
@@ -6758,6 +7124,16 @@
6758
7124
  "type": "string",
6759
7125
  "description": "Scope query to collection PI",
6760
7126
  "example": "01JCOLL_MEDICAL"
7127
+ },
7128
+ "expand": {
7129
+ "type": "string",
7130
+ "enum": [
7131
+ "none",
7132
+ "preview",
7133
+ "full"
7134
+ ],
7135
+ "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)",
7136
+ "example": "preview"
6761
7137
  }
6762
7138
  },
6763
7139
  "required": [
@@ -7807,7 +8183,7 @@
7807
8183
  "Search"
7808
8184
  ],
7809
8185
  "summary": "Search across user collections",
7810
- "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",
8186
+ "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",
7811
8187
  "x-arke-action": "search:execute",
7812
8188
  "x-arke-auth": "required",
7813
8189
  "x-arke-tier": "external",
@@ -8953,7 +9329,7 @@
8953
9329
  "Collections"
8954
9330
  ],
8955
9331
  "summary": "List entities in a collection",
8956
- "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",
9332
+ "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",
8957
9333
  "x-arke-action": "collection:view",
8958
9334
  "x-arke-auth": "optional",
8959
9335
  "x-arke-tier": "external",
@@ -9005,6 +9381,20 @@
9005
9381
  "required": false,
9006
9382
  "name": "offset",
9007
9383
  "in": "query"
9384
+ },
9385
+ {
9386
+ "schema": {
9387
+ "type": "string",
9388
+ "enum": [
9389
+ "preview",
9390
+ "full"
9391
+ ],
9392
+ "description": "Expand entity data. \"preview\" adds lightweight previews, \"full\" adds complete manifests. Maximum 100 entities when using expand.",
9393
+ "example": "preview"
9394
+ },
9395
+ "required": false,
9396
+ "name": "expand",
9397
+ "in": "query"
9008
9398
  }
9009
9399
  ],
9010
9400
  "responses": {
@@ -9161,7 +9551,7 @@
9161
9551
  "Entities"
9162
9552
  ],
9163
9553
  "summary": "Get entity by ID",
9164
- "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",
9554
+ "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**Expansion Limit:**\nUse `?expand_limit=N` to control maximum relationships expanded (1-500, default 100). When truncated, the response includes `_expansion_metadata` with counts.\n\n---\n**Permission:** `entity:view` \n**Auth:** optional",
9165
9555
  "x-arke-action": "entity:view",
9166
9556
  "x-arke-auth": "optional",
9167
9557
  "x-arke-tier": "standard",
@@ -9177,6 +9567,28 @@
9177
9567
  "description": "Entity ID (ULID)",
9178
9568
  "name": "id",
9179
9569
  "in": "path"
9570
+ },
9571
+ {
9572
+ "schema": {
9573
+ "type": "string",
9574
+ "example": "relationships:preview"
9575
+ },
9576
+ "required": false,
9577
+ "description": "Comma-separated list of fields to expand. Supports: relationships[:preview|full]",
9578
+ "name": "expand",
9579
+ "in": "query"
9580
+ },
9581
+ {
9582
+ "schema": {
9583
+ "type": "integer",
9584
+ "minimum": 1,
9585
+ "maximum": 500,
9586
+ "example": 100
9587
+ },
9588
+ "required": false,
9589
+ "description": "Maximum number of relationships to expand (1-500, default 100). When exceeded, relationships beyond the limit are returned without peer data.",
9590
+ "name": "expand_limit",
9591
+ "in": "query"
9180
9592
  }
9181
9593
  ],
9182
9594
  "responses": {
@@ -9479,6 +9891,70 @@
9479
9891
  }
9480
9892
  }
9481
9893
  },
9894
+ "/entities/{id}/preview": {
9895
+ "get": {
9896
+ "tags": [
9897
+ "Entities"
9898
+ ],
9899
+ "summary": "Get entity preview",
9900
+ "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",
9901
+ "x-arke-action": "entity:view",
9902
+ "x-arke-auth": "optional",
9903
+ "x-arke-tier": "standard",
9904
+ "parameters": [
9905
+ {
9906
+ "schema": {
9907
+ "type": "string",
9908
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
9909
+ "description": "Entity ID (ULID format)",
9910
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
9911
+ },
9912
+ "required": true,
9913
+ "description": "Entity ID (ULID)",
9914
+ "name": "id",
9915
+ "in": "path"
9916
+ }
9917
+ ],
9918
+ "responses": {
9919
+ "200": {
9920
+ "description": "Entity preview data",
9921
+ "content": {
9922
+ "application/json": {
9923
+ "schema": {
9924
+ "$ref": "#/components/schemas/EntityPreview"
9925
+ }
9926
+ }
9927
+ }
9928
+ },
9929
+ "403": {
9930
+ "description": "Forbidden - Insufficient permissions",
9931
+ "content": {
9932
+ "application/json": {
9933
+ "schema": {
9934
+ "$ref": "#/components/schemas/ErrorResponse"
9935
+ },
9936
+ "example": {
9937
+ "error": "Forbidden: You do not have permission to perform this action"
9938
+ }
9939
+ }
9940
+ }
9941
+ },
9942
+ "404": {
9943
+ "description": "Not Found - Resource does not exist",
9944
+ "content": {
9945
+ "application/json": {
9946
+ "schema": {
9947
+ "$ref": "#/components/schemas/ErrorResponse"
9948
+ },
9949
+ "example": {
9950
+ "error": "Entity not found"
9951
+ }
9952
+ }
9953
+ }
9954
+ }
9955
+ }
9956
+ }
9957
+ },
9482
9958
  "/entities/{id}/tip": {
9483
9959
  "get": {
9484
9960
  "tags": [
@@ -13283,14 +13759,14 @@
13283
13759
  }
13284
13760
  }
13285
13761
  },
13286
- "/jobs/{id}": {
13762
+ "/agents/{id}/jobs/{job_id}/status": {
13287
13763
  "get": {
13288
13764
  "tags": [
13289
- "Jobs"
13765
+ "Agents"
13290
13766
  ],
13291
- "summary": "Get job status",
13292
- "description": "Returns focused job status and summary. Use this endpoint for quick status polling.\n\nReturns 404 if the entity is not a job collection.\n\n**Response includes:**\n- Current status (running/done/error)\n- Timestamps (started_at, completed_at)\n- Agent references (agent, main_agent, target)\n- Counts (files_count, sub_jobs_count)\n\n---\n**Permission:** `collection:view` \n**Auth:** optional",
13293
- "x-arke-action": "collection:view",
13767
+ "summary": "Get job status from agent",
13768
+ "description": "Proxies to the agent's `/status/:job_id` endpoint and returns the response.\n\nUse this endpoint to poll job status after invoking an agent. The `agent_id` and `job_id`\nare both returned in the invoke response.\n\n**Query Parameters (passed through to agent):**\n- `detail=full` - Include detailed sub-job/dispatch information (orchestrators/workflows)\n- `errors=N` - Include last N errors (orchestrators only)\n\n**Response:** Returns the agent's status response directly. Schema varies by agent type\n(service, workflow, orchestrator) but always includes:\n- `job_id` - Job identifier\n- `status` - Current status (pending/running/done/error)\n- `progress` - Progress counters (total/pending/done/error)\n- `started_at` - When the job started\n- `completed_at` - When the job completed (if done/error)\n- `updated_at` - Last state modification\n\nAgent-specific fields (phase, stages, sub_jobs, folders, dispatches) are also included\nwhen applicable.\n\n---\n**Permission:** `agent:view` \n**Auth:** optional",
13769
+ "x-arke-action": "agent:view",
13294
13770
  "x-arke-auth": "optional",
13295
13771
  "x-arke-tier": "standard",
13296
13772
  "parameters": [
@@ -13298,48 +13774,132 @@
13298
13774
  "schema": {
13299
13775
  "type": "string",
13300
13776
  "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
13301
- "description": "Entity ID (ULID format)",
13302
- "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
13777
+ "description": "Agent entity ID"
13303
13778
  },
13304
13779
  "required": true,
13305
- "description": "Entity ID (ULID)",
13306
13780
  "name": "id",
13307
13781
  "in": "path"
13782
+ },
13783
+ {
13784
+ "schema": {
13785
+ "type": "string",
13786
+ "minLength": 1,
13787
+ "description": "Job ID returned from agent invocation (e.g., job_01KFX...)",
13788
+ "example": "job_01KFXPQ3ABCDEFGHIJKLMN"
13789
+ },
13790
+ "required": true,
13791
+ "name": "job_id",
13792
+ "in": "path"
13793
+ },
13794
+ {
13795
+ "schema": {
13796
+ "type": "string",
13797
+ "enum": [
13798
+ "full"
13799
+ ],
13800
+ "description": "Include detailed sub-job information (orchestrators/workflows only)"
13801
+ },
13802
+ "required": false,
13803
+ "name": "detail",
13804
+ "in": "query"
13805
+ },
13806
+ {
13807
+ "schema": {
13808
+ "type": "integer",
13809
+ "nullable": true,
13810
+ "minimum": 0,
13811
+ "maximum": 100,
13812
+ "description": "Include last N errors in response (orchestrators only)"
13813
+ },
13814
+ "required": false,
13815
+ "name": "errors",
13816
+ "in": "query"
13308
13817
  }
13309
13818
  ],
13310
13819
  "responses": {
13311
13820
  "200": {
13312
- "description": "Job status",
13821
+ "description": "Job status from agent",
13313
13822
  "content": {
13314
13823
  "application/json": {
13315
13824
  "schema": {
13316
- "$ref": "#/components/schemas/JobStatusResponse"
13825
+ "type": "object",
13826
+ "properties": {
13827
+ "job_id": {
13828
+ "type": "string",
13829
+ "description": "Unique job identifier",
13830
+ "example": "job_01KFXPQ3ABCDEFGHIJKLMN"
13831
+ },
13832
+ "status": {
13833
+ "type": "string",
13834
+ "enum": [
13835
+ "pending",
13836
+ "running",
13837
+ "done",
13838
+ "error"
13839
+ ],
13840
+ "description": "Current job status",
13841
+ "example": "running"
13842
+ },
13843
+ "progress": {
13844
+ "$ref": "#/components/schemas/JobProgress"
13845
+ },
13846
+ "started_at": {
13847
+ "type": "string",
13848
+ "description": "When this job started (ISO timestamp)",
13849
+ "example": "2026-01-26T17:48:15.000Z"
13850
+ },
13851
+ "completed_at": {
13852
+ "type": "string",
13853
+ "description": "When this job completed (ISO timestamp)",
13854
+ "example": "2026-01-26T17:49:30.000Z"
13855
+ },
13856
+ "updated_at": {
13857
+ "type": "string",
13858
+ "description": "Last state modification (ISO timestamp)",
13859
+ "example": "2026-01-26T17:49:27.000Z"
13860
+ },
13861
+ "result": {
13862
+ "type": "object",
13863
+ "additionalProperties": {
13864
+ "nullable": true
13865
+ },
13866
+ "description": "Final result data (only when status is done)"
13867
+ },
13868
+ "error": {
13869
+ "$ref": "#/components/schemas/JobError"
13870
+ }
13871
+ },
13872
+ "required": [
13873
+ "job_id",
13874
+ "status",
13875
+ "progress",
13876
+ "started_at"
13877
+ ],
13878
+ "description": "Job status response from an agent's /status/:job_id endpoint.\n\nThis schema defines the base fields that all agents return. Agent-specific fields\n(phase, stages, sub_jobs, folders, dispatches, nested_progress, etc.) are also\nallowed and passed through.\n\n**Query parameters (passed through to agent):**\n- `?detail=full` - Include detailed sub-job/dispatch information (orchestrators/workflows)\n- `?errors=N` - Include last N errors (orchestrators only)\n\n**Agent types return different additional fields:**\n- **Services**: May include `nested_progress` for Lambda-backed services\n- **Workflows**: May include `phase`, `stages`, `sub_jobs`\n- **Orchestrators**: May include `phase`, `discovery`, `grouping`, `dispatch`, `folders`, `dispatches`, `recent_errors`",
13879
+ "title": "AgentJobStatusResponse"
13317
13880
  }
13318
13881
  }
13319
13882
  }
13320
13883
  },
13321
- "403": {
13322
- "description": "Forbidden - Insufficient permissions",
13884
+ "404": {
13885
+ "description": "Not Found - Resource does not exist",
13323
13886
  "content": {
13324
13887
  "application/json": {
13325
13888
  "schema": {
13326
13889
  "$ref": "#/components/schemas/ErrorResponse"
13327
13890
  },
13328
13891
  "example": {
13329
- "error": "Forbidden: You do not have permission to perform this action"
13892
+ "error": "Entity not found"
13330
13893
  }
13331
13894
  }
13332
13895
  }
13333
13896
  },
13334
- "404": {
13335
- "description": "Not Found - Resource does not exist",
13897
+ "502": {
13898
+ "description": "Agent unreachable or returned an error",
13336
13899
  "content": {
13337
13900
  "application/json": {
13338
13901
  "schema": {
13339
- "$ref": "#/components/schemas/ErrorResponse"
13340
- },
13341
- "example": {
13342
- "error": "Entity not found"
13902
+ "$ref": "#/components/schemas/AgentUnreachableError"
13343
13903
  }
13344
13904
  }
13345
13905
  }
@@ -13416,7 +13976,7 @@
13416
13976
  "Graph"
13417
13977
  ],
13418
13978
  "summary": "Find paths between entities",
13419
- "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",
13979
+ "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",
13420
13980
  "x-arke-action": "graph:query",
13421
13981
  "x-arke-auth": "required",
13422
13982
  "x-arke-tier": "external",
@@ -13425,6 +13985,23 @@
13425
13985
  "bearerAuth": []
13426
13986
  }
13427
13987
  ],
13988
+ "parameters": [
13989
+ {
13990
+ "schema": {
13991
+ "type": "string",
13992
+ "enum": [
13993
+ "preview",
13994
+ "full",
13995
+ "none"
13996
+ ],
13997
+ "example": "preview"
13998
+ },
13999
+ "required": false,
14000
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
14001
+ "name": "expand",
14002
+ "in": "query"
14003
+ }
14004
+ ],
13428
14005
  "requestBody": {
13429
14006
  "content": {
13430
14007
  "application/json": {
@@ -13478,7 +14055,7 @@
13478
14055
  "Graph"
13479
14056
  ],
13480
14057
  "summary": "Find reachable entities (exhaustive)",
13481
- "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",
14058
+ "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",
13482
14059
  "x-arke-action": "graph:query",
13483
14060
  "x-arke-auth": "required",
13484
14061
  "x-arke-tier": "external",
@@ -13487,6 +14064,23 @@
13487
14064
  "bearerAuth": []
13488
14065
  }
13489
14066
  ],
14067
+ "parameters": [
14068
+ {
14069
+ "schema": {
14070
+ "type": "string",
14071
+ "enum": [
14072
+ "preview",
14073
+ "full",
14074
+ "none"
14075
+ ],
14076
+ "example": "preview"
14077
+ },
14078
+ "required": false,
14079
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
14080
+ "name": "expand",
14081
+ "in": "query"
14082
+ }
14083
+ ],
13490
14084
  "requestBody": {
13491
14085
  "content": {
13492
14086
  "application/json": {
@@ -13540,7 +14134,7 @@
13540
14134
  "Graph"
13541
14135
  ],
13542
14136
  "summary": "Get entity from graph",
13543
- "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",
14137
+ "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",
13544
14138
  "x-arke-action": "graph:query",
13545
14139
  "x-arke-auth": "required",
13546
14140
  "x-arke-tier": "external",
@@ -13561,6 +14155,21 @@
13561
14155
  "description": "Entity ID (ULID)",
13562
14156
  "name": "id",
13563
14157
  "in": "path"
14158
+ },
14159
+ {
14160
+ "schema": {
14161
+ "type": "string",
14162
+ "enum": [
14163
+ "preview",
14164
+ "full",
14165
+ "none"
14166
+ ],
14167
+ "example": "preview"
14168
+ },
14169
+ "required": false,
14170
+ "description": "Entity expansion mode. Omit for preview (default), \"full\" for complete manifests, \"none\" to disable",
14171
+ "name": "expand",
14172
+ "in": "query"
13564
14173
  }
13565
14174
  ],
13566
14175
  "responses": {
@@ -13596,7 +14205,7 @@
13596
14205
  "Query"
13597
14206
  ],
13598
14207
  "summary": "Execute Argo query",
13599
- "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",
14208
+ "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",
13600
14209
  "x-arke-action": "query:execute",
13601
14210
  "x-arke-auth": "required",
13602
14211
  "x-arke-tier": "external",
@@ -13658,7 +14267,7 @@
13658
14267
  "Search"
13659
14268
  ],
13660
14269
  "summary": "Find similar collections",
13661
- "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",
14270
+ "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",
13662
14271
  "x-arke-action": "search:similar",
13663
14272
  "x-arke-auth": "required",
13664
14273
  "x-arke-tier": "external",
@@ -13688,6 +14297,16 @@
13688
14297
  "type": "boolean",
13689
14298
  "default": false,
13690
14299
  "description": "Force fresh query, bypassing cache"
14300
+ },
14301
+ "expand": {
14302
+ "type": "string",
14303
+ "enum": [
14304
+ "preview",
14305
+ "full",
14306
+ "none"
14307
+ ],
14308
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14309
+ "example": "preview"
13691
14310
  }
13692
14311
  },
13693
14312
  "required": [
@@ -13724,6 +14343,34 @@
13724
14343
  },
13725
14344
  "updated_at": {
13726
14345
  "type": "string"
14346
+ },
14347
+ "entity_preview": {
14348
+ "allOf": [
14349
+ {
14350
+ "$ref": "#/components/schemas/EntityPreview"
14351
+ },
14352
+ {
14353
+ "description": "Lightweight entity preview (included by default)",
14354
+ "example": {
14355
+ "id": "01KCOLLECTION123456789ABCD",
14356
+ "type": "collection",
14357
+ "label": "Research Papers Collection",
14358
+ "description_preview": "A curated collection of academic research papers...",
14359
+ "created_at": "2026-01-10T00:00:00.000Z",
14360
+ "updated_at": "2026-01-15T12:00:00.000Z"
14361
+ }
14362
+ }
14363
+ ]
14364
+ },
14365
+ "entity": {
14366
+ "allOf": [
14367
+ {
14368
+ "$ref": "#/components/schemas/EntityResponse"
14369
+ },
14370
+ {
14371
+ "description": "Full entity manifest (when expand: \"full\")"
14372
+ }
14373
+ ]
13727
14374
  }
13728
14375
  },
13729
14376
  "required": [
@@ -13825,7 +14472,7 @@
13825
14472
  "Search"
13826
14473
  ],
13827
14474
  "summary": "Find similar items across collections",
13828
- "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",
14475
+ "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",
13829
14476
  "x-arke-action": "search:similar",
13830
14477
  "x-arke-auth": "required",
13831
14478
  "x-arke-tier": "external",
@@ -13878,6 +14525,16 @@
13878
14525
  "type": "boolean",
13879
14526
  "default": false,
13880
14527
  "description": "Force fresh query, bypassing cache"
14528
+ },
14529
+ "expand": {
14530
+ "type": "string",
14531
+ "enum": [
14532
+ "preview",
14533
+ "full",
14534
+ "none"
14535
+ ],
14536
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14537
+ "example": "preview"
13881
14538
  }
13882
14539
  },
13883
14540
  "required": [
@@ -13922,6 +14579,35 @@
13922
14579
  },
13923
14580
  "updated_at": {
13924
14581
  "type": "string"
14582
+ },
14583
+ "entity_preview": {
14584
+ "allOf": [
14585
+ {
14586
+ "$ref": "#/components/schemas/EntityPreview"
14587
+ },
14588
+ {
14589
+ "description": "Lightweight entity preview (included by default)",
14590
+ "example": {
14591
+ "id": "01KENTITY123456789ABCDEFGH",
14592
+ "type": "document",
14593
+ "label": "Similar Research Paper",
14594
+ "collection_pi": "01JCOLLECTION123456789AB",
14595
+ "description_preview": "Related findings on distributed systems...",
14596
+ "created_at": "2026-01-08T00:00:00.000Z",
14597
+ "updated_at": "2026-01-12T10:00:00.000Z"
14598
+ }
14599
+ }
14600
+ ]
14601
+ },
14602
+ "entity": {
14603
+ "allOf": [
14604
+ {
14605
+ "$ref": "#/components/schemas/EntityResponse"
14606
+ },
14607
+ {
14608
+ "description": "Full entity manifest (when expand: \"full\")"
14609
+ }
14610
+ ]
13925
14611
  }
13926
14612
  },
13927
14613
  "required": [
@@ -14029,7 +14715,7 @@
14029
14715
  "Search"
14030
14716
  ],
14031
14717
  "summary": "Search collections by text",
14032
- "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",
14718
+ "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",
14033
14719
  "x-arke-action": "search:query",
14034
14720
  "x-arke-auth": "required",
14035
14721
  "x-arke-tier": "external",
@@ -14063,6 +14749,16 @@
14063
14749
  "type": "string"
14064
14750
  },
14065
14751
  "description": "Filter by collection types"
14752
+ },
14753
+ "expand": {
14754
+ "type": "string",
14755
+ "enum": [
14756
+ "preview",
14757
+ "full",
14758
+ "none"
14759
+ ],
14760
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14761
+ "example": "preview"
14066
14762
  }
14067
14763
  },
14068
14764
  "required": [
@@ -14102,6 +14798,34 @@
14102
14798
  },
14103
14799
  "updated_at": {
14104
14800
  "type": "string"
14801
+ },
14802
+ "entity_preview": {
14803
+ "allOf": [
14804
+ {
14805
+ "$ref": "#/components/schemas/EntityPreview"
14806
+ },
14807
+ {
14808
+ "description": "Lightweight entity preview (included by default)",
14809
+ "example": {
14810
+ "id": "01KCOLLECTION123456789ABCD",
14811
+ "type": "collection",
14812
+ "label": "Machine Learning Papers",
14813
+ "description_preview": "A collection of papers on neural networks and deep learning...",
14814
+ "created_at": "2026-01-05T00:00:00.000Z",
14815
+ "updated_at": "2026-01-10T08:00:00.000Z"
14816
+ }
14817
+ }
14818
+ ]
14819
+ },
14820
+ "entity": {
14821
+ "allOf": [
14822
+ {
14823
+ "$ref": "#/components/schemas/EntityResponse"
14824
+ },
14825
+ {
14826
+ "description": "Full entity manifest (when expand: \"full\")"
14827
+ }
14828
+ ]
14105
14829
  }
14106
14830
  },
14107
14831
  "required": [
@@ -14185,7 +14909,7 @@
14185
14909
  "Search"
14186
14910
  ],
14187
14911
  "summary": "Search agents by text",
14188
- "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",
14912
+ "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",
14189
14913
  "x-arke-action": "search:query",
14190
14914
  "x-arke-auth": "required",
14191
14915
  "x-arke-tier": "external",
@@ -14212,6 +14936,16 @@
14212
14936
  "maximum": 100,
14213
14937
  "default": 10,
14214
14938
  "description": "Maximum results to return"
14939
+ },
14940
+ "expand": {
14941
+ "type": "string",
14942
+ "enum": [
14943
+ "preview",
14944
+ "full",
14945
+ "none"
14946
+ ],
14947
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
14948
+ "example": "preview"
14215
14949
  }
14216
14950
  },
14217
14951
  "required": [
@@ -14255,6 +14989,35 @@
14255
14989
  },
14256
14990
  "updated_at": {
14257
14991
  "type": "string"
14992
+ },
14993
+ "entity_preview": {
14994
+ "allOf": [
14995
+ {
14996
+ "$ref": "#/components/schemas/EntityPreview"
14997
+ },
14998
+ {
14999
+ "description": "Lightweight entity preview (included by default)",
15000
+ "example": {
15001
+ "id": "01KAGENT123456789ABCDEFGHI",
15002
+ "type": "agent",
15003
+ "label": "Document Analyzer Agent",
15004
+ "collection_pi": "01JCOLLECTION123456789AB",
15005
+ "description_preview": "An AI agent that analyzes documents and extracts key insights...",
15006
+ "created_at": "2026-01-01T00:00:00.000Z",
15007
+ "updated_at": "2026-01-15T16:00:00.000Z"
15008
+ }
15009
+ }
15010
+ ]
15011
+ },
15012
+ "entity": {
15013
+ "allOf": [
15014
+ {
15015
+ "$ref": "#/components/schemas/EntityResponse"
15016
+ },
15017
+ {
15018
+ "description": "Full entity manifest (when expand: \"full\")"
15019
+ }
15020
+ ]
14258
15021
  }
14259
15022
  },
14260
15023
  "required": [
@@ -14338,7 +15101,7 @@
14338
15101
  "Search"
14339
15102
  ],
14340
15103
  "summary": "Search entities within collection(s)",
14341
- "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",
15104
+ "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",
14342
15105
  "x-arke-action": "search:query",
14343
15106
  "x-arke-auth": "required",
14344
15107
  "x-arke-tier": "external",
@@ -14390,6 +15153,16 @@
14390
15153
  "minimum": 1,
14391
15154
  "maximum": 50,
14392
15155
  "description": "Max results per collection for diversity"
15156
+ },
15157
+ "expand": {
15158
+ "type": "string",
15159
+ "enum": [
15160
+ "preview",
15161
+ "full",
15162
+ "none"
15163
+ ],
15164
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
15165
+ "example": "preview"
14393
15166
  }
14394
15167
  },
14395
15168
  "required": [
@@ -14432,6 +15205,35 @@
14432
15205
  },
14433
15206
  "updated_at": {
14434
15207
  "type": "string"
15208
+ },
15209
+ "entity_preview": {
15210
+ "allOf": [
15211
+ {
15212
+ "$ref": "#/components/schemas/EntityPreview"
15213
+ },
15214
+ {
15215
+ "description": "Lightweight entity preview (included by default)",
15216
+ "example": {
15217
+ "id": "01KENTITY123456789ABCDEFGH",
15218
+ "type": "document",
15219
+ "label": "Research Findings Report",
15220
+ "collection_pi": "01JCOLLECTION123456789AB",
15221
+ "description_preview": "Detailed analysis of experimental results...",
15222
+ "created_at": "2026-01-10T00:00:00.000Z",
15223
+ "updated_at": "2026-01-14T09:00:00.000Z"
15224
+ }
15225
+ }
15226
+ ]
15227
+ },
15228
+ "entity": {
15229
+ "allOf": [
15230
+ {
15231
+ "$ref": "#/components/schemas/EntityResponse"
15232
+ },
15233
+ {
15234
+ "description": "Full entity manifest (when expand: \"full\")"
15235
+ }
15236
+ ]
14435
15237
  }
14436
15238
  },
14437
15239
  "required": [
@@ -14527,7 +15329,7 @@
14527
15329
  "Search"
14528
15330
  ],
14529
15331
  "summary": "Discover entities across all collections",
14530
- "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",
15332
+ "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",
14531
15333
  "x-arke-action": "search:query",
14532
15334
  "x-arke-auth": "required",
14533
15335
  "x-arke-tier": "external",
@@ -14575,6 +15377,16 @@
14575
15377
  "maximum": 20,
14576
15378
  "default": 5,
14577
15379
  "description": "Max results per collection"
15380
+ },
15381
+ "expand": {
15382
+ "type": "string",
15383
+ "enum": [
15384
+ "preview",
15385
+ "full",
15386
+ "none"
15387
+ ],
15388
+ "description": "Entity expansion mode. Default: \"preview\" for lightweight previews, \"full\" for complete manifests, \"none\" for no expansion.",
15389
+ "example": "preview"
14578
15390
  }
14579
15391
  },
14580
15392
  "required": [
@@ -14617,6 +15429,35 @@
14617
15429
  },
14618
15430
  "updated_at": {
14619
15431
  "type": "string"
15432
+ },
15433
+ "entity_preview": {
15434
+ "allOf": [
15435
+ {
15436
+ "$ref": "#/components/schemas/EntityPreview"
15437
+ },
15438
+ {
15439
+ "description": "Lightweight entity preview (included by default)",
15440
+ "example": {
15441
+ "id": "01KENTITY123456789ABCDEFGH",
15442
+ "type": "file",
15443
+ "label": "Discovered Document.pdf",
15444
+ "collection_pi": "01JCOLLECTION123456789AB",
15445
+ "description_preview": "A document discovered through semantic search...",
15446
+ "created_at": "2026-01-08T00:00:00.000Z",
15447
+ "updated_at": "2026-01-12T14:00:00.000Z"
15448
+ }
15449
+ }
15450
+ ]
15451
+ },
15452
+ "entity": {
15453
+ "allOf": [
15454
+ {
15455
+ "$ref": "#/components/schemas/EntityResponse"
15456
+ },
15457
+ {
15458
+ "description": "Full entity manifest (when expand: \"full\")"
15459
+ }
15460
+ ]
14620
15461
  }
14621
15462
  },
14622
15463
  "required": [