-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathopenapi_actions.yaml
More file actions
1228 lines (1217 loc) · 33.8 KB
/
Copy pathopenapi_actions.yaml
File metadata and controls
1228 lines (1217 loc) · 33.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Neotoma API
version: 1.0.0
description: 'REST API for Neotoma. Use with any HTTP client, including ChatGPT
Actions, Claude, Cursor, MCP servers, CLI tools, and custom integrations.
This Actions-focused spec intentionally includes a curated subset of endpoints
to stay within GPT Actions operation limits.'
servers:
- url: https://mcp.neotoma.io
description: Set from NEOTOMA_HOST_URL when served by the API; default shown for
static/codegen use.
- url: http://localhost:3080
description: Local development server
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT or base64url
description: 'Supported bearer tokens:
- MCP OAuth JWT (recommended for CLI and web clients)
- base64url-encoded Ed25519 public key (legacy encrypted responses)
Optional: Include request signature in Authorization header: "Bearer <public_key>
Signature <signature>"
'
schemas:
FileUrlResponse:
type: object
properties:
url:
type: string
description: Signed URL for accessing the file
Error:
type: object
properties:
error:
type: string
ErrorEnvelope:
type: object
properties:
error_code:
type: string
message:
type: string
details:
type: object
additionalProperties: true
properties: {}
trace_id:
type: string
timestamp:
type: string
format: date-time
Entity:
type: object
properties:
id:
type: string
entity_type:
type: string
canonical_name:
type: string
user_id:
type: string
merged_to_entity_id:
type: string
nullable: true
merged_at:
type: string
format: date-time
nullable: true
EntitySnapshot:
type: object
properties:
entity_id:
type: string
entity_type:
type: string
schema_version:
type: string
snapshot:
type: object
additionalProperties: true
properties: {}
raw_fragments:
type: object
additionalProperties: true
properties: {}
provenance:
type: object
additionalProperties: true
properties: {}
computed_at:
type: string
format: date-time
observation_count:
type: integer
last_observation_at:
type: string
format: date-time
Source:
type: object
properties:
id:
type: string
content_hash:
type: string
mime_type:
type: string
storage_url:
type: string
file_size:
type: integer
original_filename:
type: string
created_at:
type: string
format: date-time
user_id:
type: string
Observation:
type: object
properties:
id:
type: string
entity_id:
type: string
entity_type:
type: string
schema_version:
type: string
source_id:
type: string
nullable: true
interpretation_id:
type: string
nullable: true
observed_at:
type: string
format: date-time
specificity_score:
type: number
source_priority:
type: integer
observation_source:
type: string
nullable: true
enum:
- sensor
- llm_summary
- workflow_state
- human
- import
description: Kind of write that produced this observation (sensor,
llm_summary, workflow_state, human, import). Orthogonal to
source_priority and to provenance/AAuth.
fields:
type: object
additionalProperties: true
properties: {}
user_id:
type: string
RelationshipSnapshot:
type: object
properties:
relationship_key:
type: string
relationship_type:
type: string
source_entity_id:
type: string
target_entity_id:
type: string
schema_version:
type: string
snapshot:
type: object
additionalProperties: true
properties: {}
computed_at:
type: string
format: date-time
observation_count:
type: integer
last_observation_at:
type: string
format: date-time
provenance:
type: object
additionalProperties: true
properties: {}
user_id:
type: string
TimelineEvent:
type: object
properties:
id:
type: string
event_type:
type: string
event_timestamp:
type: string
format: date-time
event_date:
type: string
source_id:
type: string
source_field:
type: string
entity_id:
type: string
created_at:
type: string
format: date-time
user_id:
type: string
entity_ids:
type: array
items:
type: string
description: Optional; not populated by all transports. Prefer entity_id.
properties:
type: object
additionalProperties: true
properties: {}
EntitySchema:
type: object
properties:
entity_type:
type: string
schema_version:
type: string
field_names:
type: array
items:
type: string
field_summary:
type: object
additionalProperties: true
properties: {}
Interpretation:
type: object
properties:
id:
type: string
source_id:
type: string
status:
type: string
created_at:
type: string
format: date-time
completed_at:
type: string
format: date-time
Stats:
type: object
properties:
entities:
type: integer
sources:
type: integer
observations:
type: integer
relationships:
type: integer
timeline_events:
type: integer
StoreRequest:
type: object
properties:
entities:
type: array
items:
type: object
additionalProperties: true
properties: {}
relationships:
type: array
description: 'Optional. Create relationships between entities in this request.
Indices refer to the entities array (0-based).
'
items:
type: object
required:
- relationship_type
- source_index
- target_index
properties:
relationship_type:
type: string
enum:
- PART_OF
- CORRECTS
- REFERS_TO
- SETTLES
- DUPLICATE_OF
- DEPENDS_ON
- SUPERSEDES
- EMBEDS
- works_at
- owns
- manages
- part_of
- related_to
- depends_on
- references
- transacted_with
- member_of
- reports_to
- located_at
- created_by
- funded_by
- acquired_by
- subsidiary_of
- partner_of
- competitor_of
- supplies_to
- contracted_with
- invested_in
source_index:
type: integer
minimum: 0
target_index:
type: integer
minimum: 0
source_priority:
type: integer
observation_source:
type: string
enum:
- sensor
- llm_summary
- workflow_state
- human
- import
description: Kind of write (sensor, llm_summary, workflow_state, human,
import). Defaults to llm_summary when unspecified.
idempotency_key:
type: string
description: Required for structured path, optional for unstructured-only
path.
file_idempotency_key:
type: string
description: Optional idempotency key for file path when sending structured
+ unstructured in one call.
file_content:
type: string
description: Base64-encoded file content (unstructured path)
file_path:
type: string
description: Local file path for server-local environments
mime_type:
type: string
description: Required with file_content, optional with file_path
original_filename:
type: string
interpret:
type: boolean
default: true
interpretation_config:
type: object
additionalProperties: true
properties: {}
user_id:
type: string
description: Unified store payload. Supports structured only, unstructured only,
or both in one request.
StoreResponse:
type: object
properties:
structured:
$ref: '#/components/schemas/StoreStructuredResponse'
unstructured:
$ref: '#/components/schemas/StoreUnstructuredResponse'
StoreStructuredRequest:
type: object
required:
- entities
- idempotency_key
properties:
entities:
type: array
items:
type: object
additionalProperties: true
properties: {}
relationships:
type: array
description: 'Optional. Create relationships between entities in this request.
Indices refer to the entities array (0-based).
Enables one-call chat persistence: store [conversation, conversation_message]
with relationships [{ relationship_type: "PART_OF", source_index: 1, target_index:
0 }]. (`agent_message` remains accepted as a legacy alias for pre-v0.6 clients.)
'
items:
type: object
required:
- relationship_type
- source_index
- target_index
properties:
relationship_type:
type: string
enum:
- PART_OF
- CORRECTS
- REFERS_TO
- SETTLES
- DUPLICATE_OF
- DEPENDS_ON
- SUPERSEDES
- EMBEDS
- works_at
- owns
- manages
- part_of
- related_to
- depends_on
- references
- transacted_with
- member_of
- reports_to
- located_at
- created_by
- funded_by
- acquired_by
- subsidiary_of
- partner_of
- competitor_of
- supplies_to
- contracted_with
- invested_in
source_index:
type: integer
minimum: 0
description: Index into the entities array for the source entity
target_index:
type: integer
minimum: 0
description: Index into the entities array for the target entity
source_priority:
type: integer
observation_source:
type: string
enum:
- sensor
- llm_summary
- workflow_state
- human
- import
description: Kind of write (sensor, llm_summary, workflow_state, human,
import). Defaults to llm_summary when unspecified.
idempotency_key:
type: string
user_id:
type: string
original_filename:
type: string
description: 'Optional. For agent-provided structured data, omit so the
source has no filename (null).
Pass only when mirroring a real file name or when a display label is desired.
'
StoreStructuredResponse:
type: object
properties:
success:
type: boolean
entities:
type: array
items:
type: object
properties:
entity_id:
type: string
entity_type:
type: string
observation_id:
type: string
StoreUnstructuredRequest:
type: object
required:
- file_content
- mime_type
properties:
file_content:
type: string
description: Base64-encoded file content
mime_type:
type: string
description: MIME type of the file
idempotency_key:
type: string
description: Optional idempotency key; if omitted, content hash is used
original_filename:
type: string
interpret:
type: boolean
default: true
description: Run AI interpretation after store
user_id:
type: string
format: uuid
StoreUnstructuredResponse:
type: object
properties:
source_id:
type: string
content_hash:
type: string
file_size:
type: integer
deduplicated:
type: boolean
interpretation:
type: object
additionalProperties: true
properties: {}
entity_ids:
type: array
items:
type: string
GetRelationshipSnapshotRequest:
type: object
required:
- relationship_type
- source_entity_id
- target_entity_id
properties:
relationship_type:
type: string
enum:
- PART_OF
- CORRECTS
- REFERS_TO
- SETTLES
- DUPLICATE_OF
- DEPENDS_ON
- SUPERSEDES
- EMBEDS
- works_at
- owns
- manages
- part_of
- related_to
- depends_on
- references
- transacted_with
- member_of
- reports_to
- located_at
- created_by
- funded_by
- acquired_by
- subsidiary_of
- partner_of
- competitor_of
- supplies_to
- contracted_with
- invested_in
source_entity_id:
type: string
target_entity_id:
type: string
GetRelationshipSnapshotResponse:
type: object
required:
- snapshot
- observations
properties:
snapshot:
$ref: '#/components/schemas/RelationshipSnapshot'
observations:
type: array
items:
type: object
properties:
id:
type: string
source_id:
type: string
observed_at:
type: string
specificity_score:
type: number
source_priority:
type: number
metadata:
type: object
properties: {}
OAuthInitiateRequest:
type: object
required:
- connection_id
properties:
connection_id:
type: string
client_name:
type: string
redirect_uri:
type: string
OAuthInitiateResponse:
type: object
properties:
auth_url:
type: string
connection_id:
type: string
expires_at:
type: string
format: date-time
OAuthStatusResponse:
type: object
properties:
status:
type: string
connection_id:
type: string
paths:
/health:
get:
summary: Health check
operationId: healthCheck
security: []
responses:
'200':
description: Server is healthy
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
/me:
get:
summary: Get current authenticated user
operationId: getMe
responses:
'200':
description: Current user details
content:
application/json:
schema:
type: object
properties:
user_id:
type: string
email:
type: string
storage:
type: object
properties:
storage_backend:
type: string
enum:
- local
data_dir:
type: string
sqlite_db:
type: string
'401':
description: Not authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/entities/query:
post:
summary: Query entities
operationId: queryEntities
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
entity_type:
type: string
search:
type: string
description: Canonical free-text query parameter for retrieval relevance.
query:
type: string
description: Compatibility alias for `search`.
search_query:
type: string
description: Compatibility alias for `search`.
limit:
type: integer
offset:
type: integer
sort_by:
type: string
enum:
- entity_id
- canonical_name
- observation_count
- last_observation_at
description: "Non-default values cannot be combined with `search`."
sort_order:
type: string
enum:
- asc
- desc
description: "`desc` cannot be combined with `search`."
published:
type: boolean
description: "Cannot be combined with `search`."
published_after:
type: string
description: "Inclusive lower bound for snapshot.published_date (ISO date or datetime string). Cannot be combined with `search`."
published_before:
type: string
description: "Inclusive upper bound for snapshot.published_date (ISO date or datetime string). Cannot be combined with `search`."
include_snapshots:
type: boolean
description: When false, omit snapshot/provenance/raw_fragments payloads for lighter responses.
include_merged:
type: boolean
user_id:
type: string
responses:
'200':
description: Entity list
content:
application/json:
schema:
type: object
properties:
entities:
type: array
items:
$ref: '#/components/schemas/EntitySnapshot'
total:
type: integer
limit:
type: integer
offset:
type: integer
/entities/{id}:
get:
summary: Get entity by ID
operationId: getEntityById
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'200':
description: Entity
content:
application/json:
schema:
$ref: '#/components/schemas/EntitySnapshot'
'404':
description: Entity not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
/entities/{id}/observations:
get:
summary: List observations for entity
operationId: getEntityObservations
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'200':
description: Observations
content:
application/json:
schema:
type: object
properties:
observations:
type: array
items:
$ref: '#/components/schemas/Observation'
/entities/{id}/relationships:
get:
summary: List relationships for entity
operationId: getEntityRelationships
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'200':
description: Relationships
content:
application/json:
schema:
type: object
properties:
relationships:
type: array
items:
$ref: '#/components/schemas/RelationshipSnapshot'
/timeline:
get:
summary: List timeline events
operationId: listTimeline
parameters:
- in: query
name: start_date
required: false
schema:
type: string
- in: query
name: end_date
required: false
schema:
type: string
- in: query
name: event_type
required: false
schema:
type: string
- in: query
name: user_id
required: false
schema:
type: string
- in: query
name: limit
required: false
schema:
type: integer
- in: query
name: offset
required: false
schema:
type: integer
- in: query
name: order_by
required: false
description: Sort column descending. event_timestamp = dates from extracted data; created_at = when the timeline row was written (better for "recent activity").
schema:
type: string
enum: [event_timestamp, created_at]
default: event_timestamp
responses:
'200':
description: Timeline events
content:
application/json:
schema:
type: object
properties:
events:
type: array
items:
$ref: '#/components/schemas/TimelineEvent'
/timeline/{id}:
get:
summary: Get timeline event by ID
operationId: getTimelineById
parameters:
- in: path
name: id
required: true
schema:
type: string
- in: query
name: user_id
required: false
schema:
type: string
responses:
'200':
description: Timeline event
content:
application/json:
schema:
type: object
properties:
event:
$ref: '#/components/schemas/TimelineEvent'
/schemas:
get:
summary: List entity schemas
operationId: listSchemas
parameters:
- in: query
name: user_id
required: false
schema:
type: string
responses:
'200':
description: Schemas
content:
application/json:
schema:
type: object
properties:
schemas:
type: array
items:
$ref: '#/components/schemas/EntitySchema'
/schemas/{entity_type}:
get:
summary: Get schema by entity type
operationId: getSchemaByEntityType
parameters:
- in: path
name: entity_type
required: true
schema:
type: string
responses:
'200':
description: Schema
content:
application/json:
schema:
$ref: '#/components/schemas/EntitySchema'
/store:
post:
summary: Store structured entities, unstructured files, or both
operationId: store
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/StoreRequest'
responses:
'200':
description: Store result
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/StoreStructuredResponse'
- $ref: '#/components/schemas/StoreUnstructuredResponse'
- $ref: '#/components/schemas/StoreResponse'
/get_entity_snapshot:
post:
summary: Get entity snapshot with provenance
operationId: getEntitySnapshot
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
entity_id:
type: string
at:
type: string
description: >-
Event-time cutoff (ISO 8601). Reconstructs the snapshot from
observations whose `observed_at` ≤ this timestamp. Reflects what
*happened* by time T, regardless of when the observation was
ingested into Neotoma. Use `at_ingested` instead when you need
"what did we actually know at time T" semantics.
at_ingested:
type: string
description: >-
Ingestion-time cutoff (ISO 8601). Reconstructs the snapshot from
observations whose `created_at` (row-insertion time) ≤ this
timestamp. Excludes backfilled or late-arriving observations that
have a past `observed_at` but arrived after this cutoff, preventing
look-ahead leaks. When both `at` and `at_ingested` are supplied,
both bounds are applied (AND logic): an observation must satisfy
`observed_at ≤ at` AND `created_at ≤ at_ingested`.
format:
type: string
enum: [markdown, json]
description: >-
Response text format. `markdown` (default for MCP) returns canonical
deterministic markdown for KV-cache stability. `json` returns the raw
snapshot payload for programmatic callers.
responses: