@arke-institute/sdk 2.3.14 → 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": [
@@ -6216,6 +6321,26 @@
6216
6321
  "type": "string",
6217
6322
  "description": "Source entity type"
6218
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
+ },
6219
6344
  "predicate": {
6220
6345
  "type": "string",
6221
6346
  "description": "Relationship predicate"
@@ -6233,6 +6358,26 @@
6233
6358
  "object_type": {
6234
6359
  "type": "string",
6235
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
+ ]
6236
6381
  }
6237
6382
  },
6238
6383
  "required": [
@@ -6243,7 +6388,34 @@
6243
6388
  "object_pi",
6244
6389
  "object_label",
6245
6390
  "object_type"
6246
- ]
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
+ }
6247
6419
  },
6248
6420
  "PathResult": {
6249
6421
  "type": "object",
@@ -6391,6 +6563,26 @@
6391
6563
  "items": {
6392
6564
  "$ref": "#/components/schemas/PathEdge"
6393
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
+ ]
6394
6586
  }
6395
6587
  },
6396
6588
  "required": [
@@ -6400,7 +6592,24 @@
6400
6592
  "target_type",
6401
6593
  "length",
6402
6594
  "edges"
6403
- ]
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
+ }
6404
6613
  },
6405
6614
  "PathsReachableResponse": {
6406
6615
  "type": "object",
@@ -6507,6 +6716,26 @@
6507
6716
  "additionalProperties": {
6508
6717
  "nullable": true
6509
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
+ ]
6510
6739
  }
6511
6740
  },
6512
6741
  "required": [
@@ -6516,7 +6745,24 @@
6516
6745
  "peer_type",
6517
6746
  "peer_label",
6518
6747
  "properties"
6519
- ]
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
+ }
6520
6766
  },
6521
6767
  "GraphEntityResponse": {
6522
6768
  "type": "object",
@@ -6560,54 +6806,34 @@
6560
6806
  "created_at",
6561
6807
  "updated_at",
6562
6808
  "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
- ]
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
+ }
6611
6837
  },
6612
6838
  "EdgeStep": {
6613
6839
  "type": "object",
@@ -6634,35 +6860,71 @@
6634
6860
  "PathStep": {
6635
6861
  "anyOf": [
6636
6862
  {
6637
- "$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
+ }
6638
6922
  },
6639
6923
  {
6640
6924
  "$ref": "#/components/schemas/EdgeStep"
6641
6925
  }
6642
6926
  ]
6643
6927
  },
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
6928
  "QueryMetadata": {
6667
6929
  "type": "object",
6668
6930
  "properties": {
@@ -6718,7 +6980,129 @@
6718
6980
  "results": {
6719
6981
  "type": "array",
6720
6982
  "items": {
6721
- "$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
+ }
6722
7106
  }
6723
7107
  },
6724
7108
  "metadata": {
@@ -6758,6 +7142,16 @@
6758
7142
  "type": "string",
6759
7143
  "description": "Scope query to collection PI",
6760
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"
6761
7155
  }
6762
7156
  },
6763
7157
  "required": [
@@ -7807,7 +8201,7 @@
7807
8201
  "Search"
7808
8202
  ],
7809
8203
  "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",
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",
7811
8205
  "x-arke-action": "search:execute",
7812
8206
  "x-arke-auth": "required",
7813
8207
  "x-arke-tier": "external",
@@ -8953,7 +9347,7 @@
8953
9347
  "Collections"
8954
9348
  ],
8955
9349
  "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",
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",
8957
9351
  "x-arke-action": "collection:view",
8958
9352
  "x-arke-auth": "optional",
8959
9353
  "x-arke-tier": "external",
@@ -9005,6 +9399,20 @@
9005
9399
  "required": false,
9006
9400
  "name": "offset",
9007
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",
9415
+ "in": "query"
9008
9416
  }
9009
9417
  ],
9010
9418
  "responses": {
@@ -9161,7 +9569,7 @@
9161
9569
  "Entities"
9162
9570
  ],
9163
9571
  "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",
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",
9165
9573
  "x-arke-action": "entity:view",
9166
9574
  "x-arke-auth": "optional",
9167
9575
  "x-arke-tier": "standard",
@@ -9177,6 +9585,16 @@
9177
9585
  "description": "Entity ID (ULID)",
9178
9586
  "name": "id",
9179
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"
9180
9598
  }
9181
9599
  ],
9182
9600
  "responses": {
@@ -9479,6 +9897,70 @@
9479
9897
  }
9480
9898
  }
9481
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
+ },
9482
9964
  "/entities/{id}/tip": {
9483
9965
  "get": {
9484
9966
  "tags": [
@@ -13416,7 +13898,7 @@
13416
13898
  "Graph"
13417
13899
  ],
13418
13900
  "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",
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",
13420
13902
  "x-arke-action": "graph:query",
13421
13903
  "x-arke-auth": "required",
13422
13904
  "x-arke-tier": "external",
@@ -13425,6 +13907,23 @@
13425
13907
  "bearerAuth": []
13426
13908
  }
13427
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
+ ],
13428
13927
  "requestBody": {
13429
13928
  "content": {
13430
13929
  "application/json": {
@@ -13478,7 +13977,7 @@
13478
13977
  "Graph"
13479
13978
  ],
13480
13979
  "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",
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",
13482
13981
  "x-arke-action": "graph:query",
13483
13982
  "x-arke-auth": "required",
13484
13983
  "x-arke-tier": "external",
@@ -13487,6 +13986,23 @@
13487
13986
  "bearerAuth": []
13488
13987
  }
13489
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
+ ],
13490
14006
  "requestBody": {
13491
14007
  "content": {
13492
14008
  "application/json": {
@@ -13540,7 +14056,7 @@
13540
14056
  "Graph"
13541
14057
  ],
13542
14058
  "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",
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",
13544
14060
  "x-arke-action": "graph:query",
13545
14061
  "x-arke-auth": "required",
13546
14062
  "x-arke-tier": "external",
@@ -13561,6 +14077,21 @@
13561
14077
  "description": "Entity ID (ULID)",
13562
14078
  "name": "id",
13563
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"
13564
14095
  }
13565
14096
  ],
13566
14097
  "responses": {
@@ -13596,7 +14127,7 @@
13596
14127
  "Query"
13597
14128
  ],
13598
14129
  "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",
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",
13600
14131
  "x-arke-action": "query:execute",
13601
14132
  "x-arke-auth": "required",
13602
14133
  "x-arke-tier": "external",
@@ -13658,7 +14189,7 @@
13658
14189
  "Search"
13659
14190
  ],
13660
14191
  "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",
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",
13662
14193
  "x-arke-action": "search:similar",
13663
14194
  "x-arke-auth": "required",
13664
14195
  "x-arke-tier": "external",
@@ -13688,6 +14219,16 @@
13688
14219
  "type": "boolean",
13689
14220
  "default": false,
13690
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"
13691
14232
  }
13692
14233
  },
13693
14234
  "required": [
@@ -13724,6 +14265,34 @@
13724
14265
  },
13725
14266
  "updated_at": {
13726
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
+ ]
13727
14296
  }
13728
14297
  },
13729
14298
  "required": [
@@ -13825,7 +14394,7 @@
13825
14394
  "Search"
13826
14395
  ],
13827
14396
  "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",
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",
13829
14398
  "x-arke-action": "search:similar",
13830
14399
  "x-arke-auth": "required",
13831
14400
  "x-arke-tier": "external",
@@ -13878,6 +14447,16 @@
13878
14447
  "type": "boolean",
13879
14448
  "default": false,
13880
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"
13881
14460
  }
13882
14461
  },
13883
14462
  "required": [
@@ -13922,6 +14501,35 @@
13922
14501
  },
13923
14502
  "updated_at": {
13924
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
+ ]
13925
14533
  }
13926
14534
  },
13927
14535
  "required": [
@@ -14029,7 +14637,7 @@
14029
14637
  "Search"
14030
14638
  ],
14031
14639
  "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",
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",
14033
14641
  "x-arke-action": "search:query",
14034
14642
  "x-arke-auth": "required",
14035
14643
  "x-arke-tier": "external",
@@ -14063,6 +14671,16 @@
14063
14671
  "type": "string"
14064
14672
  },
14065
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"
14066
14684
  }
14067
14685
  },
14068
14686
  "required": [
@@ -14102,6 +14720,34 @@
14102
14720
  },
14103
14721
  "updated_at": {
14104
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
+ ]
14105
14751
  }
14106
14752
  },
14107
14753
  "required": [
@@ -14185,7 +14831,7 @@
14185
14831
  "Search"
14186
14832
  ],
14187
14833
  "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",
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",
14189
14835
  "x-arke-action": "search:query",
14190
14836
  "x-arke-auth": "required",
14191
14837
  "x-arke-tier": "external",
@@ -14212,6 +14858,16 @@
14212
14858
  "maximum": 100,
14213
14859
  "default": 10,
14214
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"
14215
14871
  }
14216
14872
  },
14217
14873
  "required": [
@@ -14255,6 +14911,35 @@
14255
14911
  },
14256
14912
  "updated_at": {
14257
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
+ ]
14258
14943
  }
14259
14944
  },
14260
14945
  "required": [
@@ -14338,7 +15023,7 @@
14338
15023
  "Search"
14339
15024
  ],
14340
15025
  "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",
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",
14342
15027
  "x-arke-action": "search:query",
14343
15028
  "x-arke-auth": "required",
14344
15029
  "x-arke-tier": "external",
@@ -14390,6 +15075,16 @@
14390
15075
  "minimum": 1,
14391
15076
  "maximum": 50,
14392
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"
14393
15088
  }
14394
15089
  },
14395
15090
  "required": [
@@ -14432,6 +15127,35 @@
14432
15127
  },
14433
15128
  "updated_at": {
14434
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
+ ]
14435
15159
  }
14436
15160
  },
14437
15161
  "required": [
@@ -14527,7 +15251,7 @@
14527
15251
  "Search"
14528
15252
  ],
14529
15253
  "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",
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",
14531
15255
  "x-arke-action": "search:query",
14532
15256
  "x-arke-auth": "required",
14533
15257
  "x-arke-tier": "external",
@@ -14575,6 +15299,16 @@
14575
15299
  "maximum": 20,
14576
15300
  "default": 5,
14577
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"
14578
15312
  }
14579
15313
  },
14580
15314
  "required": [
@@ -14617,6 +15351,35 @@
14617
15351
  },
14618
15352
  "updated_at": {
14619
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
+ ]
14620
15383
  }
14621
15384
  },
14622
15385
  "required": [