@arke-institute/sdk 2.3.7 → 2.3.9

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
@@ -59,6 +59,10 @@
59
59
  {
60
60
  "name": "Query",
61
61
  "description": "Argo DSL query engine"
62
+ },
63
+ {
64
+ "name": "Search",
65
+ "description": "Cross-collection semantic search"
62
66
  }
63
67
  ],
64
68
  "components": {
@@ -696,6 +700,156 @@
696
700
  "pagination"
697
701
  ]
698
702
  },
703
+ "SearchResultItem": {
704
+ "type": "object",
705
+ "properties": {
706
+ "pi": {
707
+ "type": "string",
708
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
709
+ "description": "Entity persistent identifier",
710
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
711
+ },
712
+ "type": {
713
+ "type": "string",
714
+ "description": "Entity type",
715
+ "example": "file"
716
+ },
717
+ "label": {
718
+ "type": "string",
719
+ "description": "Entity label/name",
720
+ "example": "Research Paper.pdf"
721
+ },
722
+ "collection_pi": {
723
+ "type": "string",
724
+ "nullable": true,
725
+ "description": "Collection this entity belongs to (null for public-domain)",
726
+ "example": "01JCOLLECTION123456789AB"
727
+ },
728
+ "score": {
729
+ "type": "number",
730
+ "description": "Relevance score (0-1, higher is better)",
731
+ "example": 0.87
732
+ },
733
+ "created_at": {
734
+ "type": "string",
735
+ "description": "When the entity was created",
736
+ "example": "2026-01-12T00:00:00.000Z"
737
+ },
738
+ "updated_at": {
739
+ "type": "string",
740
+ "description": "When the entity was last updated",
741
+ "example": "2026-01-12T10:30:00.000Z"
742
+ }
743
+ },
744
+ "required": [
745
+ "pi",
746
+ "type",
747
+ "label",
748
+ "collection_pi",
749
+ "score"
750
+ ]
751
+ },
752
+ "SearchMetadata": {
753
+ "type": "object",
754
+ "properties": {
755
+ "query": {
756
+ "type": "string",
757
+ "description": "Original search query"
758
+ },
759
+ "collections_queried": {
760
+ "type": "integer",
761
+ "description": "Number of collections searched"
762
+ },
763
+ "collections_total": {
764
+ "type": "integer",
765
+ "description": "Total collections user has access to"
766
+ },
767
+ "include_public": {
768
+ "type": "boolean",
769
+ "description": "Whether public-domain was included"
770
+ },
771
+ "execution_time_ms": {
772
+ "type": "number",
773
+ "description": "Total execution time in milliseconds"
774
+ },
775
+ "result_count": {
776
+ "type": "integer",
777
+ "description": "Number of results returned"
778
+ }
779
+ },
780
+ "required": [
781
+ "query",
782
+ "collections_queried",
783
+ "collections_total",
784
+ "include_public",
785
+ "execution_time_ms",
786
+ "result_count"
787
+ ],
788
+ "description": "Search metadata and statistics"
789
+ },
790
+ "CrossCollectionSearchResponse": {
791
+ "type": "object",
792
+ "properties": {
793
+ "results": {
794
+ "type": "array",
795
+ "items": {
796
+ "$ref": "#/components/schemas/SearchResultItem"
797
+ },
798
+ "description": "Search results ranked by relevance"
799
+ },
800
+ "metadata": {
801
+ "$ref": "#/components/schemas/SearchMetadata"
802
+ }
803
+ },
804
+ "required": [
805
+ "results",
806
+ "metadata"
807
+ ]
808
+ },
809
+ "CrossCollectionSearchRequest": {
810
+ "type": "object",
811
+ "properties": {
812
+ "query": {
813
+ "type": "string",
814
+ "minLength": 1,
815
+ "maxLength": 500,
816
+ "description": "Search query text for semantic matching",
817
+ "example": "medical research"
818
+ },
819
+ "type": {
820
+ "type": "string",
821
+ "description": "Filter results to specific entity type",
822
+ "example": "file"
823
+ },
824
+ "role": {
825
+ "type": "string",
826
+ "enum": [
827
+ "owner",
828
+ "editor",
829
+ "viewer"
830
+ ],
831
+ "description": "Filter collections by user role (only search collections where user has this role)",
832
+ "example": "owner"
833
+ },
834
+ "include_public": {
835
+ "type": "boolean",
836
+ "default": false,
837
+ "description": "Include results from public-domain namespace (default: false)",
838
+ "example": false
839
+ },
840
+ "limit": {
841
+ "type": "integer",
842
+ "minimum": 1,
843
+ "maximum": 100,
844
+ "default": 20,
845
+ "description": "Maximum number of results to return (default: 20, max: 100)",
846
+ "example": 50
847
+ }
848
+ },
849
+ "required": [
850
+ "query"
851
+ ]
852
+ },
699
853
  "CollectionResponse": {
700
854
  "allOf": [
701
855
  {
@@ -1992,6 +2146,65 @@
1992
2146
  "collection_id"
1993
2147
  ]
1994
2148
  },
2149
+ "TreeNode": {
2150
+ "type": "object",
2151
+ "properties": {
2152
+ "pi": {
2153
+ "type": "string",
2154
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
2155
+ "description": "Entity ID (ULID format)",
2156
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
2157
+ },
2158
+ "label": {
2159
+ "type": "string",
2160
+ "description": "Entity label"
2161
+ },
2162
+ "type": {
2163
+ "type": "string",
2164
+ "description": "Entity type"
2165
+ },
2166
+ "depth": {
2167
+ "type": "integer",
2168
+ "description": "Depth in tree (0 = root)"
2169
+ },
2170
+ "children": {
2171
+ "type": "array",
2172
+ "description": "Child nodes (recursive TreeNode array)",
2173
+ "items": {
2174
+ "$ref": "#/components/schemas/TreeNode"
2175
+ }
2176
+ }
2177
+ },
2178
+ "required": [
2179
+ "pi",
2180
+ "label",
2181
+ "type",
2182
+ "depth",
2183
+ "children"
2184
+ ],
2185
+ "description": "Root node with nested children"
2186
+ },
2187
+ "TreeResponse": {
2188
+ "type": "object",
2189
+ "properties": {
2190
+ "root": {
2191
+ "$ref": "#/components/schemas/TreeNode"
2192
+ },
2193
+ "total_nodes": {
2194
+ "type": "integer",
2195
+ "description": "Total number of nodes in the tree"
2196
+ },
2197
+ "truncated": {
2198
+ "type": "boolean",
2199
+ "description": "Whether results were truncated due to limit"
2200
+ }
2201
+ },
2202
+ "required": [
2203
+ "root",
2204
+ "total_nodes",
2205
+ "truncated"
2206
+ ]
2207
+ },
1995
2208
  "AddRelationshipResponse": {
1996
2209
  "type": "object",
1997
2210
  "properties": {
@@ -2418,10 +2631,15 @@
2418
2631
  "description": "Expected file size in bytes (verified on upload)",
2419
2632
  "example": 1048576
2420
2633
  },
2634
+ "label": {
2635
+ "type": "string",
2636
+ "description": "Display label for the file. Defaults to filename if not provided.",
2637
+ "example": "Q4 Financial Report"
2638
+ },
2421
2639
  "description": {
2422
2640
  "type": "string",
2423
2641
  "description": "Description of the file",
2424
- "example": "Q4 Financial Report"
2642
+ "example": "Quarterly financial report for Q4 2024"
2425
2643
  },
2426
2644
  "properties": {
2427
2645
  "type": "object",
@@ -2704,6 +2922,10 @@
2704
2922
  "minimum": 0,
2705
2923
  "description": "New file size in bytes"
2706
2924
  },
2925
+ "label": {
2926
+ "type": "string",
2927
+ "description": "New display label"
2928
+ },
2707
2929
  "description": {
2708
2930
  "type": "string",
2709
2931
  "description": "New description"
@@ -2771,6 +2993,10 @@
2771
2993
  "minLength": 1,
2772
2994
  "description": "New filename (optional, keeps current if not provided)"
2773
2995
  },
2996
+ "label": {
2997
+ "type": "string",
2998
+ "description": "New display label (optional, keeps current if not provided)"
2999
+ },
2774
3000
  "description": {
2775
3001
  "type": "string",
2776
3002
  "description": "New description"
@@ -6110,6 +6336,85 @@
6110
6336
  }
6111
6337
  }
6112
6338
  },
6339
+ "/users/me/search": {
6340
+ "post": {
6341
+ "tags": [
6342
+ "Users",
6343
+ "Search"
6344
+ ],
6345
+ "summary": "Search across user collections",
6346
+ "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",
6347
+ "x-arke-action": "search:execute",
6348
+ "x-arke-auth": "required",
6349
+ "x-arke-tier": "external",
6350
+ "security": [
6351
+ {
6352
+ "bearerAuth": []
6353
+ }
6354
+ ],
6355
+ "requestBody": {
6356
+ "content": {
6357
+ "application/json": {
6358
+ "schema": {
6359
+ "$ref": "#/components/schemas/CrossCollectionSearchRequest"
6360
+ }
6361
+ }
6362
+ }
6363
+ },
6364
+ "responses": {
6365
+ "200": {
6366
+ "description": "Search results",
6367
+ "content": {
6368
+ "application/json": {
6369
+ "schema": {
6370
+ "$ref": "#/components/schemas/CrossCollectionSearchResponse"
6371
+ }
6372
+ }
6373
+ }
6374
+ },
6375
+ "400": {
6376
+ "description": "Bad Request - Invalid input",
6377
+ "content": {
6378
+ "application/json": {
6379
+ "schema": {
6380
+ "$ref": "#/components/schemas/ValidationErrorResponse"
6381
+ },
6382
+ "example": {
6383
+ "error": "Validation failed",
6384
+ "details": {
6385
+ "issues": [
6386
+ {
6387
+ "path": [
6388
+ "properties",
6389
+ "label"
6390
+ ],
6391
+ "message": "Required"
6392
+ }
6393
+ ]
6394
+ }
6395
+ }
6396
+ }
6397
+ }
6398
+ },
6399
+ "401": {
6400
+ "description": "Unauthorized - Missing or invalid authentication",
6401
+ "content": {
6402
+ "application/json": {
6403
+ "schema": {
6404
+ "$ref": "#/components/schemas/ErrorResponse"
6405
+ },
6406
+ "example": {
6407
+ "error": "Unauthorized: Missing or invalid authentication token"
6408
+ }
6409
+ }
6410
+ }
6411
+ },
6412
+ "503": {
6413
+ "description": "Search service unavailable"
6414
+ }
6415
+ }
6416
+ }
6417
+ },
6113
6418
  "/collections": {
6114
6419
  "post": {
6115
6420
  "tags": [
@@ -7906,29 +8211,140 @@
7906
8211
  }
7907
8212
  }
7908
8213
  },
7909
- "/relationships": {
7910
- "post": {
8214
+ "/entities/{id}/tree": {
8215
+ "get": {
7911
8216
  "tags": [
7912
- "Relationships"
8217
+ "Entities"
7913
8218
  ],
7914
- "summary": "Add relationship between entities",
7915
- "description": "Creates a relationship from source to target entity.\n\nIf `target_predicate` is provided, creates a **bidirectional** relationship:\n- Adds `source_predicate` relationship on source pointing to target\n- Adds `target_predicate` relationship on target pointing to source\n- Requires `entity:update` permission on both entities\n\nIf `target_predicate` is omitted, creates a **unidirectional** relationship:\n- Adds `source_predicate` relationship on source pointing to target\n- Requires `entity:update` permission on source only",
7916
- "x-arke-action": "entity:update",
7917
- "x-arke-auth": "required",
8219
+ "summary": "Get entity tree",
8220
+ "description": "Returns a hierarchical tree of entities reachable from the source entity.\n\nUse this to browse collections and folders without making multiple API calls.\nThe tree follows relationship edges (optionally filtered by predicate) and\nreturns a nested structure suitable for tree UI rendering.\n\nQuery parameters:\n- `depth`: Max tree depth (1-4, default 2)\n- `collection`: Constrain to entities in this collection\n- `predicates`: Comma-separated predicates to follow (e.g., \"contains\")\n- `limit`: Max nodes to return (default 100)",
8221
+ "x-arke-action": "entity:view",
8222
+ "x-arke-auth": "optional",
7918
8223
  "x-arke-tier": "standard",
7919
- "security": [
8224
+ "parameters": [
7920
8225
  {
7921
- "bearerAuth": []
7922
- }
7923
- ],
7924
- "requestBody": {
7925
- "content": {
7926
- "application/json": {
7927
- "schema": {
7928
- "$ref": "#/components/schemas/AddRelationshipRequest"
7929
- }
7930
- }
7931
- }
8226
+ "schema": {
8227
+ "type": "string",
8228
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
8229
+ "description": "Entity ID (ULID format)",
8230
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
8231
+ },
8232
+ "required": true,
8233
+ "description": "Entity ID (ULID)",
8234
+ "name": "id",
8235
+ "in": "path"
8236
+ },
8237
+ {
8238
+ "schema": {
8239
+ "type": "integer",
8240
+ "minimum": 1,
8241
+ "maximum": 4,
8242
+ "default": 2,
8243
+ "description": "Maximum tree depth (1-4)",
8244
+ "example": 2
8245
+ },
8246
+ "required": false,
8247
+ "name": "depth",
8248
+ "in": "query"
8249
+ },
8250
+ {
8251
+ "schema": {
8252
+ "type": "string",
8253
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
8254
+ "description": "Constrain results to entities in this collection",
8255
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
8256
+ },
8257
+ "required": false,
8258
+ "name": "collection",
8259
+ "in": "query"
8260
+ },
8261
+ {
8262
+ "schema": {
8263
+ "type": "string",
8264
+ "description": "Comma-separated predicates to follow (e.g., \"contains,references\")",
8265
+ "example": "contains"
8266
+ },
8267
+ "required": false,
8268
+ "name": "predicates",
8269
+ "in": "query"
8270
+ },
8271
+ {
8272
+ "schema": {
8273
+ "type": "integer",
8274
+ "minimum": 1,
8275
+ "maximum": 1000,
8276
+ "default": 100,
8277
+ "description": "Maximum number of nodes to return",
8278
+ "example": 100
8279
+ },
8280
+ "required": false,
8281
+ "name": "limit",
8282
+ "in": "query"
8283
+ }
8284
+ ],
8285
+ "responses": {
8286
+ "200": {
8287
+ "description": "Tree retrieved",
8288
+ "content": {
8289
+ "application/json": {
8290
+ "schema": {
8291
+ "$ref": "#/components/schemas/TreeResponse"
8292
+ }
8293
+ }
8294
+ }
8295
+ },
8296
+ "403": {
8297
+ "description": "Forbidden - Insufficient permissions",
8298
+ "content": {
8299
+ "application/json": {
8300
+ "schema": {
8301
+ "$ref": "#/components/schemas/ErrorResponse"
8302
+ },
8303
+ "example": {
8304
+ "error": "Forbidden: You do not have permission to perform this action"
8305
+ }
8306
+ }
8307
+ }
8308
+ },
8309
+ "404": {
8310
+ "description": "Not Found - Resource does not exist",
8311
+ "content": {
8312
+ "application/json": {
8313
+ "schema": {
8314
+ "$ref": "#/components/schemas/ErrorResponse"
8315
+ },
8316
+ "example": {
8317
+ "error": "Entity not found"
8318
+ }
8319
+ }
8320
+ }
8321
+ }
8322
+ }
8323
+ }
8324
+ },
8325
+ "/relationships": {
8326
+ "post": {
8327
+ "tags": [
8328
+ "Relationships"
8329
+ ],
8330
+ "summary": "Add relationship between entities",
8331
+ "description": "Creates a relationship from source to target entity.\n\nIf `target_predicate` is provided, creates a **bidirectional** relationship:\n- Adds `source_predicate` relationship on source pointing to target\n- Adds `target_predicate` relationship on target pointing to source\n- Requires `entity:update` permission on both entities\n\nIf `target_predicate` is omitted, creates a **unidirectional** relationship:\n- Adds `source_predicate` relationship on source pointing to target\n- Requires `entity:update` permission on source only",
8332
+ "x-arke-action": "entity:update",
8333
+ "x-arke-auth": "required",
8334
+ "x-arke-tier": "standard",
8335
+ "security": [
8336
+ {
8337
+ "bearerAuth": []
8338
+ }
8339
+ ],
8340
+ "requestBody": {
8341
+ "content": {
8342
+ "application/json": {
8343
+ "schema": {
8344
+ "$ref": "#/components/schemas/AddRelationshipRequest"
8345
+ }
8346
+ }
8347
+ }
7932
8348
  },
7933
8349
  "responses": {
7934
8350
  "201": {
@@ -11170,6 +11586,367 @@
11170
11586
  }
11171
11587
  }
11172
11588
  },
11589
+ "/search/similar/collections": {
11590
+ "post": {
11591
+ "tags": [
11592
+ "Search"
11593
+ ],
11594
+ "summary": "Find similar collections",
11595
+ "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.",
11596
+ "x-arke-action": "search:similar",
11597
+ "x-arke-auth": "optional",
11598
+ "x-arke-tier": "external",
11599
+ "requestBody": {
11600
+ "content": {
11601
+ "application/json": {
11602
+ "schema": {
11603
+ "type": "object",
11604
+ "properties": {
11605
+ "pi": {
11606
+ "type": "string",
11607
+ "description": "Collection PI to find similar collections for"
11608
+ },
11609
+ "limit": {
11610
+ "type": "number",
11611
+ "minimum": 1,
11612
+ "maximum": 100,
11613
+ "default": 10,
11614
+ "description": "Maximum results to return"
11615
+ },
11616
+ "refresh": {
11617
+ "type": "boolean",
11618
+ "default": false,
11619
+ "description": "Force fresh query, bypassing cache"
11620
+ }
11621
+ },
11622
+ "required": [
11623
+ "pi"
11624
+ ]
11625
+ }
11626
+ }
11627
+ }
11628
+ },
11629
+ "responses": {
11630
+ "200": {
11631
+ "description": "Similar collections found",
11632
+ "content": {
11633
+ "application/json": {
11634
+ "schema": {
11635
+ "type": "object",
11636
+ "properties": {
11637
+ "results": {
11638
+ "type": "array",
11639
+ "items": {
11640
+ "type": "object",
11641
+ "properties": {
11642
+ "pi": {
11643
+ "type": "string"
11644
+ },
11645
+ "label": {
11646
+ "type": "string"
11647
+ },
11648
+ "score": {
11649
+ "type": "number"
11650
+ },
11651
+ "created_at": {
11652
+ "type": "string"
11653
+ },
11654
+ "updated_at": {
11655
+ "type": "string"
11656
+ }
11657
+ },
11658
+ "required": [
11659
+ "pi",
11660
+ "label",
11661
+ "score"
11662
+ ]
11663
+ }
11664
+ },
11665
+ "metadata": {
11666
+ "type": "object",
11667
+ "properties": {
11668
+ "source_pi": {
11669
+ "type": "string"
11670
+ },
11671
+ "result_count": {
11672
+ "type": "number"
11673
+ },
11674
+ "cached": {
11675
+ "type": "boolean"
11676
+ },
11677
+ "cached_at": {
11678
+ "type": "string"
11679
+ }
11680
+ },
11681
+ "required": [
11682
+ "source_pi",
11683
+ "result_count"
11684
+ ]
11685
+ }
11686
+ },
11687
+ "required": [
11688
+ "results",
11689
+ "metadata"
11690
+ ]
11691
+ }
11692
+ }
11693
+ }
11694
+ },
11695
+ "400": {
11696
+ "description": "Bad Request - Invalid input",
11697
+ "content": {
11698
+ "application/json": {
11699
+ "schema": {
11700
+ "$ref": "#/components/schemas/ValidationErrorResponse"
11701
+ },
11702
+ "example": {
11703
+ "error": "Validation failed",
11704
+ "details": {
11705
+ "issues": [
11706
+ {
11707
+ "path": [
11708
+ "properties",
11709
+ "label"
11710
+ ],
11711
+ "message": "Required"
11712
+ }
11713
+ ]
11714
+ }
11715
+ }
11716
+ }
11717
+ }
11718
+ },
11719
+ "404": {
11720
+ "description": "Not Found - Resource does not exist",
11721
+ "content": {
11722
+ "application/json": {
11723
+ "schema": {
11724
+ "$ref": "#/components/schemas/ErrorResponse"
11725
+ },
11726
+ "example": {
11727
+ "error": "Entity not found"
11728
+ }
11729
+ }
11730
+ }
11731
+ },
11732
+ "503": {
11733
+ "description": "Service Unavailable - External service not available",
11734
+ "content": {
11735
+ "application/json": {
11736
+ "schema": {
11737
+ "$ref": "#/components/schemas/ErrorResponse"
11738
+ },
11739
+ "example": {
11740
+ "error": "Service unavailable",
11741
+ "details": {
11742
+ "service": "pinecone"
11743
+ }
11744
+ }
11745
+ }
11746
+ }
11747
+ }
11748
+ }
11749
+ }
11750
+ },
11751
+ "/search/similar/items": {
11752
+ "post": {
11753
+ "tags": [
11754
+ "Search"
11755
+ ],
11756
+ "summary": "Find similar items across collections",
11757
+ "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",
11758
+ "x-arke-action": "search:similar",
11759
+ "x-arke-auth": "optional",
11760
+ "x-arke-tier": "external",
11761
+ "requestBody": {
11762
+ "content": {
11763
+ "application/json": {
11764
+ "schema": {
11765
+ "type": "object",
11766
+ "properties": {
11767
+ "pi": {
11768
+ "type": "string",
11769
+ "description": "Entity PI to find similar items for"
11770
+ },
11771
+ "collection_pi": {
11772
+ "type": "string",
11773
+ "description": "Entity's collection PI"
11774
+ },
11775
+ "limit": {
11776
+ "type": "number",
11777
+ "minimum": 1,
11778
+ "maximum": 100,
11779
+ "default": 20,
11780
+ "description": "Maximum results to return"
11781
+ },
11782
+ "tier1_limit": {
11783
+ "type": "number",
11784
+ "minimum": 1,
11785
+ "maximum": 50,
11786
+ "default": 10,
11787
+ "description": "Number of similar collections to search"
11788
+ },
11789
+ "tier2_limit": {
11790
+ "type": "number",
11791
+ "minimum": 1,
11792
+ "maximum": 20,
11793
+ "default": 5,
11794
+ "description": "Items to fetch per collection"
11795
+ },
11796
+ "include_same_collection": {
11797
+ "type": "boolean",
11798
+ "default": true,
11799
+ "description": "Include results from the same collection"
11800
+ },
11801
+ "refresh": {
11802
+ "type": "boolean",
11803
+ "default": false,
11804
+ "description": "Force fresh query, bypassing cache"
11805
+ }
11806
+ },
11807
+ "required": [
11808
+ "pi",
11809
+ "collection_pi"
11810
+ ]
11811
+ }
11812
+ }
11813
+ }
11814
+ },
11815
+ "responses": {
11816
+ "200": {
11817
+ "description": "Similar items found",
11818
+ "content": {
11819
+ "application/json": {
11820
+ "schema": {
11821
+ "type": "object",
11822
+ "properties": {
11823
+ "results": {
11824
+ "type": "array",
11825
+ "items": {
11826
+ "type": "object",
11827
+ "properties": {
11828
+ "pi": {
11829
+ "type": "string"
11830
+ },
11831
+ "type": {
11832
+ "type": "string"
11833
+ },
11834
+ "label": {
11835
+ "type": "string"
11836
+ },
11837
+ "collection_pi": {
11838
+ "type": "string",
11839
+ "nullable": true
11840
+ },
11841
+ "score": {
11842
+ "type": "number"
11843
+ },
11844
+ "created_at": {
11845
+ "type": "string"
11846
+ },
11847
+ "updated_at": {
11848
+ "type": "string"
11849
+ }
11850
+ },
11851
+ "required": [
11852
+ "pi",
11853
+ "type",
11854
+ "label",
11855
+ "collection_pi",
11856
+ "score"
11857
+ ]
11858
+ }
11859
+ },
11860
+ "metadata": {
11861
+ "type": "object",
11862
+ "properties": {
11863
+ "source_pi": {
11864
+ "type": "string"
11865
+ },
11866
+ "collections_searched": {
11867
+ "type": "number"
11868
+ },
11869
+ "result_count": {
11870
+ "type": "number"
11871
+ },
11872
+ "cached": {
11873
+ "type": "boolean"
11874
+ },
11875
+ "cached_at": {
11876
+ "type": "string"
11877
+ }
11878
+ },
11879
+ "required": [
11880
+ "source_pi",
11881
+ "collections_searched",
11882
+ "result_count"
11883
+ ]
11884
+ }
11885
+ },
11886
+ "required": [
11887
+ "results",
11888
+ "metadata"
11889
+ ]
11890
+ }
11891
+ }
11892
+ }
11893
+ },
11894
+ "400": {
11895
+ "description": "Bad Request - Invalid input",
11896
+ "content": {
11897
+ "application/json": {
11898
+ "schema": {
11899
+ "$ref": "#/components/schemas/ValidationErrorResponse"
11900
+ },
11901
+ "example": {
11902
+ "error": "Validation failed",
11903
+ "details": {
11904
+ "issues": [
11905
+ {
11906
+ "path": [
11907
+ "properties",
11908
+ "label"
11909
+ ],
11910
+ "message": "Required"
11911
+ }
11912
+ ]
11913
+ }
11914
+ }
11915
+ }
11916
+ }
11917
+ },
11918
+ "404": {
11919
+ "description": "Not Found - Resource does not exist",
11920
+ "content": {
11921
+ "application/json": {
11922
+ "schema": {
11923
+ "$ref": "#/components/schemas/ErrorResponse"
11924
+ },
11925
+ "example": {
11926
+ "error": "Entity not found"
11927
+ }
11928
+ }
11929
+ }
11930
+ },
11931
+ "503": {
11932
+ "description": "Service Unavailable - External service not available",
11933
+ "content": {
11934
+ "application/json": {
11935
+ "schema": {
11936
+ "$ref": "#/components/schemas/ErrorResponse"
11937
+ },
11938
+ "example": {
11939
+ "error": "Service unavailable",
11940
+ "details": {
11941
+ "service": "pinecone"
11942
+ }
11943
+ }
11944
+ }
11945
+ }
11946
+ }
11947
+ }
11948
+ }
11949
+ },
11173
11950
  "/entities/{id}/attestation": {
11174
11951
  "get": {
11175
11952
  "tags": [