@surrealdb/memory 1.0.0-alpha.10 → 1.0.0-alpha.11

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/dist/memory.d.ts CHANGED
@@ -81,7 +81,7 @@ export interface paths {
81
81
  };
82
82
  get?: never;
83
83
  put?: never;
84
- /** @description Phase 7.5 — Agent-Memory-as-agent chat endpoint. Resolves the session, retrieves context via the unified /query router, and calls the configured LLM provider; then, only after a successful synthesis (or a tier-2 cache hit), stores the user message and the assistant response via /facts and emits a response_trace. A failed synthesis writes no turn, fact, or response_trace (a retrieval_trace recording the query may still be written). Set `stream=true` for SSE. */
84
+ /** @description The agent's own chat endpoint, backed by Agent Memory. Resolves the session, retrieves context via the unified /query router, and calls the configured LLM provider; then, only after a successful synthesis (or a tier-2 cache hit), stores the user message and the assistant response via /facts and emits a response_trace. A failed synthesis writes no turn, fact, or response_trace (a retrieval_trace recording the query may still be written). Set `stream=true` for SSE. */
85
85
  post: operations["chat"];
86
86
  delete?: never;
87
87
  options?: never;
@@ -98,7 +98,7 @@ export interface paths {
98
98
  };
99
99
  get?: never;
100
100
  put?: never;
101
- /** @description Phase 11b: pool recent facts and consolidate into observations. Scope-gated: only facts in the caller's `memory:read` region are pooled, and only groups in the caller's `memory:write` region are persisted (others are returned as dry-run previews). */
101
+ /** @description Pool recent facts and consolidate into observations. Scope-gated: only facts in the caller's `memory:read` region are pooled, and only groups in the caller's `memory:write` region are persisted (others are returned as dry-run previews). */
102
102
  post: operations["consolidate"];
103
103
  delete?: never;
104
104
  options?: never;
@@ -133,7 +133,7 @@ export interface paths {
133
133
  /** @description Lists Layer 0 knowledge documents */
134
134
  get: operations["list_documents"];
135
135
  put?: never;
136
- /** @description Upload a new Layer 0 knowledge document (multipart/form-data) */
136
+ /** @description Upload a new Layer 0 knowledge document (multipart/form-data). Send the bytes in a `file` part and, optionally, a JSON object in a `metadata` part; the two may be sent in either order. */
137
137
  post: operations["upload_document"];
138
138
  delete?: never;
139
139
  options?: never;
@@ -218,7 +218,7 @@ export interface paths {
218
218
  };
219
219
  get?: never;
220
220
  put?: never;
221
- /** @description Phase 6c: recompute doc-to-doc semantic_similarity edges across the Context. Returns the number of edges emitted (existing edges are retained — the (in, out, kind) triple is unique). */
221
+ /** @description Recompute doc-to-doc semantic_similarity edges across the Context. Returns the number of edges emitted (existing edges are retained — the (in, out, kind) triple is unique). */
222
222
  post: operations["recompute_document_links"];
223
223
  delete?: never;
224
224
  options?: never;
@@ -305,7 +305,7 @@ export interface paths {
305
305
  };
306
306
  get?: never;
307
307
  put?: never;
308
- /** @description Phase 11a: elaborate links for a single entity or sweep low-relation entities */
308
+ /** @description Elaborate links for a single entity or sweep low-relation entities */
309
309
  post: operations["elaborate"];
310
310
  delete?: never;
311
311
  options?: never;
@@ -330,6 +330,40 @@ export interface paths {
330
330
  patch?: never;
331
331
  trace?: never;
332
332
  };
333
+ "/api/v1/{context_id}/entities/search": {
334
+ parameters: {
335
+ query?: never;
336
+ header?: never;
337
+ path?: never;
338
+ cookie?: never;
339
+ };
340
+ /** @description Search entities by name, best match first. Lexical and deterministic: an identical query returns identical rows in an identical order, with no model and no vector index in the path. An exact match on the normalised identity name scores 1.0; everything else scores strictly below it. Each match carries its own fact count and a distinguisher built from its highest-importance facts, so two same-named candidates can be told apart without a request per candidate. Bounded by `limit` (default 10, capped by the server's list limit); this is a ranked head, not a walk. */
341
+ get: operations["search_entities"];
342
+ put?: never;
343
+ post?: never;
344
+ delete?: never;
345
+ options?: never;
346
+ head?: never;
347
+ patch?: never;
348
+ trace?: never;
349
+ };
350
+ "/api/v1/{context_id}/entities/top": {
351
+ parameters: {
352
+ query?: never;
353
+ header?: never;
354
+ path?: never;
355
+ cookie?: never;
356
+ };
357
+ /** @description The entities worth starting from. `by=coverage` (default) is most-known-about and is the one ordering the entity listing cannot express; `by=importance` and `by=recency` are index-served single-table reads. Coverage is deliberately exact rather than approximated: it costs one aggregate pass per fact family, on the same footing as an opt-in `?count=true`, because merging three separately-truncated top-lists would silently mis-rank an entity that leads on relations and trails on attributes. Prefer `importance` or `recency` where the ranking need not be exact. */
358
+ get: operations["top_entities"];
359
+ put?: never;
360
+ post?: never;
361
+ delete?: never;
362
+ options?: never;
363
+ head?: never;
364
+ patch?: never;
365
+ trace?: never;
366
+ };
333
367
  "/api/v1/{context_id}/entities/{entity_type}/{entity_name}": {
334
368
  parameters: {
335
369
  query?: never;
@@ -337,7 +371,7 @@ export interface paths {
337
371
  path?: never;
338
372
  cookie?: never;
339
373
  };
340
- /** @description Get a single entity with its current attributes and relations */
374
+ /** @description Get a single entity with a bounded head of its current attributes and relations, newest first. Each section reports whether it was cut. Walk `/attributes?entity=<type>/<name>` for the attributes, and BOTH `/relations?src=<type>/<name>` and `/relations?dst=<type>/<name>` for the relations, because the head carries edges in both directions and either filter alone reproduces only half of it. All of them page by cursor in the same order. */
341
375
  get: operations["get_entity"];
342
376
  put?: never;
343
377
  post?: never;
@@ -348,6 +382,23 @@ export interface paths {
348
382
  patch?: never;
349
383
  trace?: never;
350
384
  };
385
+ "/api/v1/{context_id}/entities/{entity_type}/{entity_name}/history": {
386
+ parameters: {
387
+ query?: never;
388
+ header?: never;
389
+ path?: never;
390
+ cookie?: never;
391
+ };
392
+ /** @description Every key's supersession chain for one entity, newest first. The per-key sibling at `/history/{key}` answers how one value changed; this answers what changed about the subject, which cannot be composed from it without one request per key. Superseded rows are included - the chain is the point. Paginated by cursor over `(created_at, id)`. */
393
+ get: operations["entity_history_all"];
394
+ put?: never;
395
+ post?: never;
396
+ delete?: never;
397
+ options?: never;
398
+ head?: never;
399
+ patch?: never;
400
+ trace?: never;
401
+ };
351
402
  "/api/v1/{context_id}/entities/{entity_type}/{entity_name}/history/{key}": {
352
403
  parameters: {
353
404
  query?: never;
@@ -365,6 +416,23 @@ export interface paths {
365
416
  patch?: never;
366
417
  trace?: never;
367
418
  };
419
+ "/api/v1/{context_id}/entities/{entity_type}/{entity_name}/neighbourhood": {
420
+ parameters: {
421
+ query?: never;
422
+ header?: never;
423
+ path?: never;
424
+ cookie?: never;
425
+ };
426
+ /** @description One hop out from a subject, each neighbour carrying its own fact count so a relation chip is navigable rather than decorative - without it the caller needs one request per chip. Paginated by cursor over the edge's own `(created_at, id)`: a neighbour's fact count changes under ingest, so it cannot carry a stable cursor. `limit` is capped lower than the general list limit because each row costs three correlated counts. `count=true` returns the subject's visible edge total, and is refused alongside `minFacts` because that filter runs after each page is hydrated - honouring it in a total would cost the per-neighbour counts this walk exists to avoid. */
427
+ get: operations["entity_neighbourhood"];
428
+ put?: never;
429
+ post?: never;
430
+ delete?: never;
431
+ options?: never;
432
+ head?: never;
433
+ patch?: never;
434
+ trace?: never;
435
+ };
368
436
  "/api/v1/{context_id}/facts": {
369
437
  parameters: {
370
438
  query?: never;
@@ -374,7 +442,7 @@ export interface paths {
374
442
  };
375
443
  get?: never;
376
444
  put?: never;
377
- /** @description Write a single fact. Dispatches on `infer` mode: full (LLM-extracted), triples (caller-supplied), preview (dry run), none (literal). */
445
+ /** @description Write a single fact. Dispatches on `infer` mode: full (LLM-extracted), triples (caller-supplied structured entries covering all four fact families - entities, attributes, relations, and actions - with optional per-fact event time, verbatim source clause, and confidence), preview (dry run), none (literal). */
378
446
  post: operations["create_fact"];
379
447
  delete?: never;
380
448
  options?: never;
@@ -536,6 +604,29 @@ export interface paths {
536
604
  patch?: never;
537
605
  trace?: never;
538
606
  };
607
+ "/api/v1/{context_id}/lookup": {
608
+ parameters: {
609
+ query?: never;
610
+ header?: never;
611
+ path?: never;
612
+ cookie?: never;
613
+ };
614
+ get?: never;
615
+ put?: never;
616
+ /**
617
+ * @description What this Context knows about a subject, in one round trip. Everything returned is a stored row: nothing is generated, nothing is summarised by a model, and an identical query returns an identical answer. `resolution.kind` is a discriminated union - `entity`, `topic`, `ambiguous`, `empty` - so a client branches once rather than inferring which case it got.
618
+ *
619
+ * This is a composite aggregate like `/state`, not a collection: every section is bounded and reports `truncated`, and none of them page. A caller needing a section in full walks its own collection endpoint, which does: facts through `/attributes?entity=`, relations through BOTH `/relations?src=` and `/relations?dst=` (the section carries edges in both directions, so either filter alone reproduces half of it), events through `/actions?actor=`, passages through `/query`, and unknowns through `/uncertainty?entity=`. Note that `facts` is ranked by importance while its collection pages in write order - the ranked head is a different question from the walk, not its first page, because importance is reinforced on recall and so cannot carry a stable cursor.
620
+ *
621
+ * Facts carry their source, trust and confidence but not the quoted evidence text: a fact is one line until asked, and expanding one is a passage read.
622
+ */
623
+ post: operations["lookup"];
624
+ delete?: never;
625
+ options?: never;
626
+ head?: never;
627
+ patch?: never;
628
+ trace?: never;
629
+ };
539
630
  "/api/v1/{context_id}/me": {
540
631
  parameters: {
541
632
  query?: never;
@@ -648,7 +739,7 @@ export interface paths {
648
739
  };
649
740
  get?: never;
650
741
  put?: never;
651
- /** @description Phase 7 unified query: four-tier router + fused ranker over the substrate */
742
+ /** @description Unified query: four-tier router + fused ranker over the substrate */
652
743
  post: operations["query_memory"];
653
744
  delete?: never;
654
745
  options?: never;
@@ -879,6 +970,40 @@ export interface paths {
879
970
  patch?: never;
880
971
  trace?: never;
881
972
  };
973
+ "/api/v1/{context_id}/uncertainty": {
974
+ parameters: {
975
+ query?: never;
976
+ header?: never;
977
+ path?: never;
978
+ cookie?: never;
979
+ };
980
+ /** @description Things the Context is unsure about, newest first. The composite state read collapses these to `{about, reason}`, which is enough to say something is unresolved and not enough to act on it; this returns the row, so a flag can be linked to the entity it is about and settled. `resolved` defaults to unset (both), so pass `resolved=false` for the open ones. Paginated by cursor over `(created_at, id)`. */
981
+ get: operations["list_uncertainty"];
982
+ put?: never;
983
+ post?: never;
984
+ delete?: never;
985
+ options?: never;
986
+ head?: never;
987
+ patch?: never;
988
+ trace?: never;
989
+ };
990
+ "/api/v1/{context_id}/uncertainty/{uncertainty_id}/resolve": {
991
+ parameters: {
992
+ query?: never;
993
+ header?: never;
994
+ path?: never;
995
+ cookie?: never;
996
+ };
997
+ get?: never;
998
+ put?: never;
999
+ /** @description Settle a disagreement by accepting one value. Claims the flag, writes the accepted value through the reconciler at the upsert trust prior, and retires the values it beats, so a caller does not orchestrate three writes. The accepted value lands at the flag's own scope, not the caller's write-grant anchors, because scope is part of a fact's address and the value has to replace the contenders where they live. `acceptedValue` and `note` persist as an attribute value and its source clause in normalised, capped form - never the wire string - having run the Context's injection-scan and PII-redaction policies exactly as a structured `/facts` write does. Requires `memory:write`. Settlement is retry-converging rather than transactional: a failure after the accepted value is written hands the flag back and reports it, and repeating the call dedups the value and completes the retirement. A flag with no subject cannot be settled this way and is rejected 422: only a contradiction or a confidence-floor hold records the entity and key a written value would need, and inventing a target for the others would assert a fact nobody stated. */
1000
+ post: operations["resolve_uncertainty"];
1001
+ delete?: never;
1002
+ options?: never;
1003
+ head?: never;
1004
+ patch?: never;
1005
+ trace?: never;
1006
+ };
882
1007
  }
883
1008
  export interface components {
884
1009
  schemas: {
@@ -933,6 +1058,12 @@ export interface components {
933
1058
  message: string;
934
1059
  };
935
1060
  AttributeDetailJson: {
1061
+ /**
1062
+ * Format: double
1063
+ * @description Reconciler's posterior over this assertion on a `[0, 1]` scale. Distinct
1064
+ * from `source.trust`, the prior of the origin that fed it.
1065
+ */
1066
+ confidence: number;
936
1067
  createdAt: string;
937
1068
  /**
938
1069
  * @description Navigable ref of the owning entity, `entity:<type>/<name>` — resolvable
@@ -943,8 +1074,19 @@ export interface components {
943
1074
  /** Format: double */
944
1075
  importance: number;
945
1076
  key: string;
1077
+ labels: string[];
946
1078
  memoryCategory: components["schemas"]["MemoryCategory"];
1079
+ /**
1080
+ * @description The compartments this fact is visible in, in disjunctive normal form:
1081
+ * one inner list per AND-clause of scope paths. Empty means unscoped.
1082
+ */
1083
+ scope: string[][];
947
1084
  source?: null | components["schemas"]["SourceRefJson"];
1085
+ /**
1086
+ * @description The fact rendered as a sentence, written at ingest by templating (no
1087
+ * model). Absent on rows written before the column existed.
1088
+ */
1089
+ summary?: string | null;
948
1090
  supersededBy?: string | null;
949
1091
  supersedes?: string | null;
950
1092
  validFrom?: string | null;
@@ -1019,7 +1161,7 @@ export interface components {
1019
1161
  };
1020
1162
  ChatRequestJson: {
1021
1163
  /**
1022
- * @description Phase 7.6 — when `true` skips the tier-2 response cache and
1164
+ * @description When `true` skips the tier-2 response cache and
1023
1165
  * forces a fresh tier-3 call. Defaults to `false`.
1024
1166
  */
1025
1167
  bypassCache?: boolean;
@@ -1135,19 +1277,30 @@ export interface components {
1135
1277
  */
1136
1278
  k?: number;
1137
1279
  /**
1138
- * @description Label filter (design §4): `key=value` strings the result rows must all
1280
+ * @description Label filter: `key=value` strings the result rows must all
1139
1281
  * carry; applied after the scope predicate (never widening).
1140
1282
  */
1141
1283
  labels?: string[];
1142
1284
  /**
1143
1285
  * @description Read **lens** (DNF: OR of conjunctive clauses) narrowing the effective read
1144
- * region (design §7.1); see [`QueryMemoryRequestJson::lens`]. Empty = the
1286
+ * region; see [`QueryMemoryRequestJson::lens`]. Empty = the
1145
1287
  * whole granted region.
1146
1288
  */
1147
1289
  lens?: components["schemas"]["ScopeSets"];
1148
1290
  query: string;
1149
- /** @description Scope read breadth: `strict` (default) | `merged` | `crossTeam` (§7.1). */
1291
+ /** @description Scope read breadth: `strict` (default) | `merged` | `crossTeam`. */
1150
1292
  scopeView?: string | null;
1293
+ /**
1294
+ * @description Render one subject's answer rather than a query's hits, as
1295
+ * `<type>/<name>`. This is the copy-as-context export: the fact half of
1296
+ * the markdown block becomes this entity's own attributes, relations and
1297
+ * events, which is what a reader pastes into a prompt after looking a
1298
+ * subject up. `query` is still required and still selects the passages,
1299
+ * which are the only thing retrieval contributes in this mode - facts
1300
+ * about other entities are not appended. `lens`, `labels` and `scopeView`
1301
+ * filter the subject's facts exactly as they filter the passages.
1302
+ */
1303
+ subject?: string | null;
1151
1304
  };
1152
1305
  ContextQueryResponseJson: {
1153
1306
  context: string;
@@ -1160,7 +1313,7 @@ export interface components {
1160
1313
  key: string;
1161
1314
  values: string[];
1162
1315
  };
1163
- /** @description §15 operational signal (#174): cross-provenance contradiction rate. */
1316
+ /** @description Operational signal: cross-provenance contradiction rate. */
1164
1317
  ContradictionStatsJson: {
1165
1318
  /** Format: double */
1166
1319
  contradictionRate: number;
@@ -1175,6 +1328,21 @@ export interface components {
1175
1328
  newValue: string;
1176
1329
  oldValue: string;
1177
1330
  };
1331
+ /**
1332
+ * @description Where the answer's facts came from.
1333
+ *
1334
+ * Deliberately only the breakdown. The subject's own totals - its fact count
1335
+ * and when it was last learned about - live on `resolution.subject`, where
1336
+ * they are computed over the whole subject rather than over the bounded slice
1337
+ * this response carries. Repeating them here would be two numbers that
1338
+ * disagree the moment a section is truncated or excluded.
1339
+ */
1340
+ CoverageJson: {
1341
+ /** @description How many of the facts **in this answer** came from each source kind. */
1342
+ sourceKinds: {
1343
+ [key: string]: number;
1344
+ };
1345
+ };
1178
1346
  CreateSessionRequestJson: {
1179
1347
  metadata?: unknown;
1180
1348
  /**
@@ -1192,7 +1360,7 @@ export interface components {
1192
1360
  */
1193
1361
  DecisionKind: "create" | "update" | "supersede";
1194
1362
  /**
1195
- * @description Phase 6.5 — geographic filter on `/documents/query`. Mirrors the
1363
+ * @description Geographic filter on `/documents/query`. Mirrors the
1196
1364
  * shape on the memory `/query` endpoint.
1197
1365
  */
1198
1366
  DocGeoFilterJson: {
@@ -1257,27 +1425,44 @@ export interface components {
1257
1425
  * @description Lifecycle state of a [`Document`] in the ingestion pipeline.
1258
1426
  *
1259
1427
  * Matches the SurrealQL `ASSERT $value IN [...]` on `document.status` in
1260
- * `V1__schema.surql`. The `Keywording` state is reserved for
1261
- * Phase C; in Phase A the pipeline transitions straight from `Embedding` to
1262
- * `Ready`.
1428
+ * `V1__schema.surql`. The `Keywording` state is entered only when the
1429
+ * Context's ingestion profile gates in the keywording stage; profiles
1430
+ * without it transition straight past it.
1263
1431
  * @enum {string}
1264
1432
  */
1265
1433
  DocumentStatus: "queued" | "extracting" | "chunking" | "embedding" | "keywording" | "extracting_nodes" | "ready" | "failed";
1266
1434
  /**
1267
- * @description OpenAPI documentation shape for the `multipart/form-data` upload/reprocess
1268
- * body: a `file` part plus a `metadata` JSON part ([`UploadMetadataJson`], which
1269
- * carries `scopes` / `labels` / `title` / …). The handlers parse the multipart
1270
- * stream directly; this type exists only so the parts (and `scopes`) appear in
1271
- * the generated spec. The `metadata` part MUST precede `file` on the wire.
1435
+ * @description The `multipart/form-data` body of an upload or reprocess: the document bytes
1436
+ * in a `file` part, and an optional `metadata` part carrying `title` /
1437
+ * `source` / `mimeType` / `scopes` / `labels` / `observedAt` as a JSON object.
1438
+ *
1439
+ * The two parts may be sent in either order. `metadata` first is marginally
1440
+ * cheaper - the media-type and content gates then run before the body reaches
1441
+ * storage rather than after - but a `metadata` part sent after `file` applies
1442
+ * in full either way.
1443
+ *
1444
+ * Only `file` is required. Without a `metadata` part the document takes its
1445
+ * title and source from the part's filename, its media type from the part's
1446
+ * `Content-Type` (or, absent one, from the bytes), and the caller's whole
1447
+ * `memory:write` region as its scope.
1448
+ *
1449
+ * `scopes` and `labels` apply on upload only. A reprocess replaces an existing
1450
+ * document's bytes and keeps its scope and labels, so it ignores both fields
1451
+ * rather than failing the request; every other field applies to both.
1272
1452
  */
1273
1453
  DocumentUploadForm: {
1274
1454
  /**
1275
1455
  * Format: binary
1276
- * @description The raw document bytes.
1456
+ * @description The raw document bytes. A `Content-Type` on this part declares the media
1457
+ * type; without one the type is inferred from the bytes, falling back to
1458
+ * `text/plain` for a body that is text. An empty part is a 400.
1277
1459
  */
1278
1460
  file: string;
1279
- /** @description The document metadata part, sent as a serialised JSON object. */
1280
- metadata: components["schemas"]["UploadMetadataJson"];
1461
+ /**
1462
+ * @description The document metadata, as a serialised JSON object. Optional; either a
1463
+ * JSON object or no part at all.
1464
+ */
1465
+ metadata?: components["schemas"]["UploadMetadataJson"];
1281
1466
  };
1282
1467
  DuplicateFindingJson: {
1283
1468
  entityA: string;
@@ -1332,6 +1517,10 @@ export interface components {
1332
1517
  name: string;
1333
1518
  updatedAt: string;
1334
1519
  };
1520
+ EntityHistoryAllResponseJson: {
1521
+ history: components["schemas"]["AttributeDetailJson"][];
1522
+ page: components["schemas"]["PageMeta"];
1523
+ };
1335
1524
  EntityHistoryResponseJson: {
1336
1525
  history: components["schemas"]["AttributeDetailJson"][];
1337
1526
  };
@@ -1340,10 +1529,56 @@ export interface components {
1340
1529
  /** @description Where this page sits in the walk. Follow `nextCursor` for the next. */
1341
1530
  page: components["schemas"]["PageMeta"];
1342
1531
  };
1532
+ /**
1533
+ * @description An entity with the coverage figures a reader needs to decide whether it is
1534
+ * the one they meant, and whether walking to it is worth it.
1535
+ */
1536
+ EntityMatchJson: {
1537
+ /**
1538
+ * @description One sentence assembled from the highest-importance fact summaries, so
1539
+ * two same-named candidates can be told apart. Absent when the entity has
1540
+ * no summarised facts.
1541
+ */
1542
+ distinguisher?: string | null;
1543
+ entity: components["schemas"]["EntityDetailJson"];
1544
+ /**
1545
+ * Format: int64
1546
+ * @description Attributes + events + outbound relations. The number that says whether
1547
+ * walking here is worth it, which is why it is inline rather than a
1548
+ * request per row.
1549
+ */
1550
+ factCount: number;
1551
+ /** @description Newest known-time across the entity's own facts. */
1552
+ lastLearnedAt?: string | null;
1553
+ /**
1554
+ * @description The alias that matched, when the query named an alias and resolution
1555
+ * followed `same_as` to the canonical entity.
1556
+ */
1557
+ matchedAlias?: string | null;
1558
+ /**
1559
+ * Format: double
1560
+ * @description Match quality in `[0, 1]`. `1.0` for an exact match on the normalised
1561
+ * identity name; otherwise the Jaccard overlap of the query's word tokens
1562
+ * with the candidate name's, scaled to sit strictly below `1.0`. Corpus
1563
+ * independent, so one `ambiguityMargin` means the same thing in a Context
1564
+ * of ten entities and one of ten million. Always `1.0` for a listing that
1565
+ * matched no query.
1566
+ */
1567
+ score: number;
1568
+ };
1343
1569
  EntityResponseJson: {
1344
1570
  attributes: components["schemas"]["AttributeDetailJson"][];
1345
1571
  entity: components["schemas"]["EntityDetailJson"];
1346
1572
  relations: components["schemas"]["RelationDetailJson"][];
1573
+ /**
1574
+ * @description Per-section truncation. A `true` flag means that section has more rows
1575
+ * than this response carries, and the complete set must be walked through
1576
+ * that section's own collection endpoint.
1577
+ */
1578
+ truncated: components["schemas"]["EntityTruncationJson"];
1579
+ };
1580
+ EntitySearchResponseJson: {
1581
+ matches: components["schemas"]["EntityMatchJson"][];
1347
1582
  };
1348
1583
  EntitySummaryJson: {
1349
1584
  entityType: string;
@@ -1352,6 +1587,17 @@ export interface components {
1352
1587
  memoryCategory: components["schemas"]["MemoryCategory"];
1353
1588
  name: string;
1354
1589
  };
1590
+ /**
1591
+ * @description Which of the entity read's two fact sections were bounded short.
1592
+ *
1593
+ * Both sections come back newest first, the order those collections page in,
1594
+ * so a truncated section is a genuine prefix of that walk rather than a
1595
+ * separate ranking.
1596
+ */
1597
+ EntityTruncationJson: {
1598
+ attributes: boolean;
1599
+ relations: boolean;
1600
+ };
1355
1601
  ExtractionResultJson: {
1356
1602
  actions: components["schemas"]["ActionSummaryJson"][];
1357
1603
  attributes: components["schemas"]["AttributeSummaryJson"][];
@@ -1410,9 +1656,8 @@ export interface components {
1410
1656
  /** @description Inference mode (`full` is the default). */
1411
1657
  infer?: components["schemas"]["InferMode"];
1412
1658
  /**
1413
- * @description Descriptive labels for the persisted rows (scope-model §5). Accepted
1414
- * and recorded on the wire now; row-level application lands in a
1415
- * follow-up (cf. `ScopeView` — accepted but behaves as `Strict`).
1659
+ * @description Descriptive labels for the persisted rows: `key=value` strings
1660
+ * stamped on every row the write reconciles.
1416
1661
  */
1417
1662
  labels?: components["schemas"]["Label"][];
1418
1663
  memory_category?: null | components["schemas"]["MemoryCategory"];
@@ -1420,13 +1665,16 @@ export interface components {
1420
1665
  * @description Optional RFC3339 known/observed time for the written facts (backfill).
1421
1666
  * When set, the facts are stamped with this `created_at` (known time), so
1422
1667
  * `as_of` queries see them dated to when they were observed rather than to
1423
- * wall-clock ingest. `None` keeps the default (facts dated to ingest time).
1668
+ * wall-clock ingest; a `temporal_hint` on a structured triples entry also
1669
+ * resolves against this anchor ("yesterday" relative to when the fact was
1670
+ * observed, not to ingest). `None` keeps the default (facts dated to
1671
+ * ingest time, hints anchored at now).
1424
1672
  */
1425
1673
  observed_at?: string | null;
1426
1674
  role?: null | components["schemas"]["TurnRole"];
1427
1675
  /**
1428
- * @description Scope paths the write targets — canonical slash-paths, e.g. `org/apple/`
1429
- * (scope-model §5). Used when auto-creating a session. Empty = the
1676
+ * @description Scope paths the write targets — canonical slash-paths, e.g.
1677
+ * `org/apple/`. Used when auto-creating a session. Empty = the
1430
1678
  * caller's default write region.
1431
1679
  */
1432
1680
  scopes?: components["schemas"]["ScopeSets"];
@@ -1440,7 +1688,10 @@ export interface components {
1440
1688
  * when `infer = triples` is supplied.
1441
1689
  */
1442
1690
  text?: string | null;
1443
- /** @description Caller-supplied triples (only consumed when `infer = triples`). */
1691
+ /**
1692
+ * @description Caller-supplied structured fact entries (only consumed when
1693
+ * `infer = triples`); see [`Triple`] for the per-entry contract.
1694
+ */
1444
1695
  triples?: components["schemas"]["Triple"][];
1445
1696
  };
1446
1697
  FactsResponseJson: {
@@ -1460,7 +1711,7 @@ export interface components {
1460
1711
  */
1461
1712
  dryRun?: boolean;
1462
1713
  /**
1463
- * @description Phase 10.7 — right-to-be-forgotten. When `true`, the handler
1714
+ * @description Right-to-be-forgotten. When `true`, the handler
1464
1715
  * also removes the supersession history (rows with `valid_until`
1465
1716
  * set) that match the same scope/entity criteria. When omitted or
1466
1717
  * `false`, prior rows are retained for audit even after the
@@ -1496,7 +1747,7 @@ export interface components {
1496
1747
  maxResults?: number | null;
1497
1748
  };
1498
1749
  /**
1499
- * @description Wire shape for the Phase 6.5 geo filter on `/query`. Mirrors the
1750
+ * @description Wire shape for the geo filter on `/query`. Mirrors the
1500
1751
  * in-process [`crate::memory::types::GeoFilter`] enum.
1501
1752
  */
1502
1753
  GeoFilterJson: {
@@ -1573,6 +1824,8 @@ export interface components {
1573
1824
  /** @enum {string} */
1574
1825
  kind: "entity";
1575
1826
  relations: components["schemas"]["RelationDetailJson"][];
1827
+ /** @description Per-section truncation, as on `GET /entities/{type}/{name}`. */
1828
+ truncated: components["schemas"]["EntityTruncationJson"];
1576
1829
  } | {
1577
1830
  current?: null | components["schemas"]["AttributeDetailJson"];
1578
1831
  /**
@@ -1588,8 +1841,17 @@ export interface components {
1588
1841
  /**
1589
1842
  * @description Live relations matching the `src -[label]-> dst` shape. Empty if
1590
1843
  * none survive the temporal filter.
1844
+ *
1845
+ * Addressed in the database by both endpoints and the label, so this
1846
+ * is empty only when no such edge is visible, never because the
1847
+ * subject had too many other edges to look through.
1591
1848
  */
1592
1849
  matches: components["schemas"]["RelationDetailJson"][];
1850
+ /**
1851
+ * @description Whether the parallel-edge set between this pair under this label was
1852
+ * itself cut short. False in every ordinary case.
1853
+ */
1854
+ truncated: boolean;
1593
1855
  } | {
1594
1856
  /** @enum {string} */
1595
1857
  kind: "trace";
@@ -1685,7 +1947,16 @@ export interface components {
1685
1947
  */
1686
1948
  lens?: components["schemas"]["ScopeSets"];
1687
1949
  query: string;
1688
- /** Format: float */
1950
+ /**
1951
+ * Format: float
1952
+ * @description Minimum similarity a keyword must reach to be returned
1953
+ * (default 0.5). Values of `0` or below, and values too large to
1954
+ * represent as a 32-bit float (`1e39` and up), are coerced back to
1955
+ * that 0.5 default, so the cutoff cannot be disabled; send a small
1956
+ * positive value such as `0.01` to widen the result set. Any other
1957
+ * finite value is used as given, including one above the `1.0`
1958
+ * ceiling on cosine similarity, which matches nothing.
1959
+ */
1689
1960
  threshold?: number;
1690
1961
  };
1691
1962
  KeywordSearchResponseJson: {
@@ -1699,6 +1970,61 @@ export interface components {
1699
1970
  /** Format: int64 */
1700
1971
  affected: number;
1701
1972
  };
1973
+ LookupRequestJson: {
1974
+ /**
1975
+ * Format: double
1976
+ * @description How far the top candidate must beat the runner-up for the answer to be
1977
+ * one entity rather than a choice between several. Defaults to 0.15.
1978
+ */
1979
+ ambiguityMargin?: number | null;
1980
+ /** @description Restrict resolution to one entity type. */
1981
+ entityType?: string | null;
1982
+ /** Format: int32 */
1983
+ eventLimit?: number | null;
1984
+ /** Format: int32 */
1985
+ factLimit?: number | null;
1986
+ /**
1987
+ * @description Which sections to fill. Defaults to everything except `passages`, which
1988
+ * costs a retrieval pass and is the one section whose selection is not
1989
+ * provider-free: it embeds the query. No language model is consulted for
1990
+ * it either way - the pass runs with query classification, retrieval
1991
+ * iteration and HyDE suppressed, whatever the deployment enables
1992
+ * elsewhere, so the same query returns the same passages. Every other
1993
+ * section is stored rows chosen by predicate. Unknown names are ignored.
1994
+ * An omitted section comes back empty with `truncated` false: it was
1995
+ * declined, not cut short, so it points at no walk.
1996
+ */
1997
+ include?: string[] | null;
1998
+ /** Format: int32 */
1999
+ passageLimit?: number | null;
2000
+ /** @description What the reader asked about. */
2001
+ query: string;
2002
+ /** Format: int32 */
2003
+ relationLimit?: number | null;
2004
+ /**
2005
+ * @description Skip resolution and answer about this subject directly, as
2006
+ * `<type>/<name>`. This is what makes walking a trail cheap: a hop
2007
+ * already knows which entity it landed on, so re-resolving its name would
2008
+ * be both wasted work and a chance to land somewhere else.
2009
+ */
2010
+ subject?: string | null;
2011
+ /** Format: int32 */
2012
+ uncertaintyLimit?: number | null;
2013
+ };
2014
+ LookupResponseJson: {
2015
+ coverage?: null | components["schemas"]["CoverageJson"];
2016
+ /**
2017
+ * @description The entities a topic query spans, with their relevance. Empty for an
2018
+ * entity answer, where the subject is in `resolution`.
2019
+ */
2020
+ entities: components["schemas"]["SectionJson_EntityMatchJson"];
2021
+ events: components["schemas"]["SectionJson_ActionDetailJson"];
2022
+ facts: components["schemas"]["SectionJson_AttributeDetailJson"];
2023
+ passages: components["schemas"]["SectionJson_PassageJson"];
2024
+ relations: components["schemas"]["SectionJson_RelationDetailJson"];
2025
+ resolution: components["schemas"]["ResolutionJson"];
2026
+ uncertainty: components["schemas"]["SectionJson_UncertaintyJson"];
2027
+ };
1702
2028
  /**
1703
2029
  * @description Memory category classification applied during extraction.
1704
2030
  * @enum {string}
@@ -1770,6 +2096,22 @@ export interface components {
1770
2096
  */
1771
2097
  validUntil?: string | null;
1772
2098
  };
2099
+ NeighbourJson: {
2100
+ far: components["schemas"]["EntityMatchJson"];
2101
+ label: string;
2102
+ /**
2103
+ * @description `true` when the edge reads subject -> far, `false` when it reads
2104
+ * far -> subject. The label is stored once, in the outbound direction.
2105
+ */
2106
+ outbound: boolean;
2107
+ relationId: string;
2108
+ validUntil?: string | null;
2109
+ };
2110
+ NeighbourhoodResponseJson: {
2111
+ neighbours: components["schemas"]["NeighbourJson"][];
2112
+ /** @description Where this page sits in the walk. Follow `nextCursor` for the next. */
2113
+ page: components["schemas"]["PageMeta"];
2114
+ };
1773
2115
  /** @description The pagination block returned beside a page's rows. */
1774
2116
  PageMeta: {
1775
2117
  /** @description Whether a further page exists. */
@@ -1854,19 +2196,19 @@ export interface components {
1854
2196
  QueryKind: "direct_lookup" | "hybrid" | "full_context";
1855
2197
  QueryMemoryRequestJson: {
1856
2198
  /**
1857
- * @description Phase 11.5 — historical query timestamp (known time). When set
1858
- * the retrieval path walks the supersession chain to surface the
2199
+ * @description Historical query timestamp (known time). When set the
2200
+ * retrieval path walks the supersession chain to surface the
1859
2201
  * row that was current as-of this instant.
1860
2202
  */
1861
2203
  asOf?: string | null;
1862
2204
  /**
1863
- * @description Phase 11.5 — system-time query. Prepends `VERSION d'…'` to the
2205
+ * @description System-time query. Prepends `VERSION d'…'` to the
1864
2206
  * underlying `SELECT` so SurrealDB MVCC returns the substrate
1865
2207
  * state at the supplied instant.
1866
2208
  */
1867
2209
  atInstant?: string | null;
1868
2210
  /**
1869
- * @description Phase 7 — which families of result to include. Defaults to
2211
+ * @description Which families of result to include. Defaults to
1870
2212
  * `["facts", "passages"]` (both). Pass either alone to scope the
1871
2213
  * response.
1872
2214
  */
@@ -1884,7 +2226,7 @@ export interface components {
1884
2226
  */
1885
2227
  k?: number;
1886
2228
  /**
1887
- * @description Label filter (design §4): `key=value` strings the result rows must **all**
2229
+ * @description Label filter: `key=value` strings the result rows must **all**
1888
2230
  * carry. Applied after the scope predicate — labels never widen access, only
1889
2231
  * narrow the already-authorised result set. Empty = no label filter.
1890
2232
  */
@@ -1893,8 +2235,8 @@ export interface components {
1893
2235
  * @description Scope/permission model — read **lens**, a DNF selector (OR of conjunctive
1894
2236
  * clauses): each clause is an AND of scope paths / `/*` subtree patterns, and
1895
2237
  * a row is kept if it involves every pattern of some clause (clauses are
1896
- * OR'd). Narrows the caller's effective read region for this query (design
1897
- * §7.1); empty = the whole granted region. The lens can only narrow —
2238
+ * OR'd). Narrows the caller's effective read region for this query;
2239
+ * empty = the whole granted region. The lens can only narrow —
1898
2240
  * permission gating from the caller's grants always applies on top, so an
1899
2241
  * out-of-region lens yields empty results, never a 403.
1900
2242
  */
@@ -1904,30 +2246,30 @@ export interface components {
1904
2246
  query: string;
1905
2247
  /**
1906
2248
  * @description Scope read breadth: `strict` (default) | `merged` | `crossTeam`. Only
1907
- * `strict` is enforced pre-launch; `merged` / `crossTeam` are accepted and
1908
- * behave as `strict` until their region logic ships (design §7.1).
2249
+ * `strict` is enforced; `merged` / `crossTeam` are accepted on the wire
2250
+ * and behave as `strict`.
1909
2251
  */
1910
2252
  scopeView?: string | null;
1911
2253
  sessionId?: string | null;
1912
2254
  /**
1913
- * @description Phase 7 — free-form source label. Recorded on the trace for
1914
- * audit replay; doesn't affect retrieval today.
2255
+ * @description Free-form source label. Recorded on the trace for audit
2256
+ * replay; does not affect retrieval.
1915
2257
  */
1916
2258
  source?: string | null;
1917
2259
  /**
1918
- * @description Phase 11.5 — valid-time (world-time) lower bound. Filters rows
2260
+ * @description Valid-time (world-time) lower bound. Filters rows
1919
2261
  * whose `valid_from` is ≥ this timestamp.
1920
2262
  */
1921
2263
  validFrom?: string | null;
1922
2264
  /**
1923
- * @description Phase 11.5 — valid-time (world-time) upper bound. Filters rows
2265
+ * @description Valid-time (world-time) upper bound. Filters rows
1924
2266
  * whose `valid_until` is ≤ this timestamp.
1925
2267
  */
1926
2268
  validUntil?: string | null;
1927
2269
  };
1928
2270
  QueryMemoryResponseJson: {
1929
2271
  /**
1930
- * @description Phase 7 — query-understanding output. `kind` is one of
2272
+ * @description Query-understanding output. `kind` is one of
1931
2273
  * `direct_lookup` / `hybrid` / `full_context`; `seed_entities`
1932
2274
  * is the (possibly empty) set of entity surface forms extracted
1933
2275
  * from the query.
@@ -1954,7 +2296,7 @@ export interface components {
1954
2296
  queryWindow?: null | components["schemas"]["QueryWindowJson"];
1955
2297
  seedEntities: string[];
1956
2298
  tier: components["schemas"]["Tier"];
1957
- /** @description Phase 7 — short trace summary returned inline. */
2299
+ /** @description Short trace summary returned inline. */
1958
2300
  trace: components["schemas"]["QueryTraceJson"];
1959
2301
  };
1960
2302
  /**
@@ -1964,7 +2306,7 @@ export interface components {
1964
2306
  QueryMode: "hybrid" | "vector" | "bm25" | "hybrid_graph";
1965
2307
  QueryRequestJson: {
1966
2308
  /**
1967
- * @description W5b: opt into sub-question decomposition for this query. The
2309
+ * @description Opt into sub-question decomposition for this query. The
1968
2310
  * caller fans out to one retrieval per sub-question and
1969
2311
  * RRF-merges the result lists. Like `use_hyde`, requires the
1970
2312
  * Context to have an LLM provider attached.
@@ -1996,17 +2338,29 @@ export interface components {
1996
2338
  query: string;
1997
2339
  /** Format: float */
1998
2340
  rrfK?: number;
1999
- /** Format: float */
2341
+ /**
2342
+ * Format: float
2343
+ * @description Minimum similarity for the vector leg (default 0.5). It is
2344
+ * applied to the vector search only: `bm25` mode ignores it, and
2345
+ * the hybrid modes admit BM25 hits into the fused ranking without
2346
+ * it, so outside `vector` mode a returned chunk need not reach
2347
+ * this score. Values of `0` or below, and values too large to
2348
+ * represent as a 32-bit float (`1e39` and up), are coerced back to
2349
+ * the 0.5 default, so the cutoff cannot be disabled; send a small
2350
+ * positive value such as `0.01` to widen the vector leg. Any other
2351
+ * finite value is used as given, including one above the `1.0`
2352
+ * ceiling on cosine similarity, which matches nothing.
2353
+ */
2000
2354
  threshold?: number;
2001
2355
  /**
2002
- * @description W5a: opt into HyDE (Hypothetical Document Embeddings) for this
2356
+ * @description Opt into HyDE (Hypothetical Document Embeddings) for this
2003
2357
  * query. Requires the Context to have an LLM provider attached;
2004
2358
  * callers without one should leave this `false`. Defaults to
2005
2359
  * `false` so existing agents see the same vector-only behaviour.
2006
2360
  */
2007
2361
  useHyde?: boolean | null;
2008
2362
  /**
2009
- * @description W5c: opt into cross-encoder reranking of the top-K. Requires
2363
+ * @description Opt into cross-encoder reranking of the top-K. Requires
2010
2364
  * the server to have a `Reranker` provider attached. Off by
2011
2365
  * default; takes effect after the store returns results so it
2012
2366
  * composes naturally with HyDE / decomposition / hybrid graph.
@@ -2040,7 +2394,7 @@ export interface components {
2040
2394
  precision: string;
2041
2395
  start: string;
2042
2396
  };
2043
- /** @description Phase 6c: doc-to-doc semantic link recomputation. */
2397
+ /** @description Doc-to-doc semantic link recomputation. */
2044
2398
  RecomputeLinksResponse: {
2045
2399
  /** Format: int64 */
2046
2400
  linksEmitted: number;
@@ -2055,7 +2409,7 @@ export interface components {
2055
2409
  reflection: string;
2056
2410
  /**
2057
2411
  * @description Id of the trace cluster written during the reflect, for correlation
2058
- * with `/traces/{id}`. Empty when no trace was written (#229).
2412
+ * with `/traces/{id}`. Empty when no trace was written.
2059
2413
  */
2060
2414
  traceId: string;
2061
2415
  };
@@ -2076,12 +2430,21 @@ export interface components {
2076
2430
  path: components["schemas"]["ScopePath"];
2077
2431
  };
2078
2432
  RelationDetailJson: {
2433
+ /**
2434
+ * Format: double
2435
+ * @description Reconciler's posterior over the edge on a `[0, 1]` scale. Distinct from
2436
+ * `source.trust`, the prior of the origin that fed it.
2437
+ */
2438
+ confidence: number;
2079
2439
  createdAt: string;
2080
2440
  id: string;
2081
2441
  label: string;
2442
+ labels: string[];
2082
2443
  memoryCategory: components["schemas"]["MemoryCategory"];
2083
2444
  /** @description Navigable ref of the object entity, `entity:<type>/<name>`. */
2084
2445
  object: string;
2446
+ /** @description The compartments this edge is visible in, in disjunctive normal form. */
2447
+ scope: string[][];
2085
2448
  source?: null | components["schemas"]["SourceRefJson"];
2086
2449
  /**
2087
2450
  * @description Navigable ref of the subject entity, `entity:<type>/<name>` —
@@ -2089,6 +2452,11 @@ export interface components {
2089
2452
  * grammar.
2090
2453
  */
2091
2454
  subject: string;
2455
+ /**
2456
+ * @description The edge rendered as a sentence, written at ingest by templating (no
2457
+ * model). Absent on rows written before the column existed.
2458
+ */
2459
+ summary?: string | null;
2092
2460
  validFrom?: string | null;
2093
2461
  validUntil?: string | null;
2094
2462
  };
@@ -2103,6 +2471,69 @@ export interface components {
2103
2471
  object: string;
2104
2472
  subject: string;
2105
2473
  };
2474
+ /**
2475
+ * @description What the query resolved to.
2476
+ *
2477
+ * A discriminated union on `kind`, so a client branches once and renders one
2478
+ * of four layouts. It never has to infer ambiguity from an array length,
2479
+ * which is the failure mode of a flat shape: "one candidate" and "confidently
2480
+ * one entity" are different answers and must not look alike on the wire.
2481
+ */
2482
+ ResolutionJson: {
2483
+ /**
2484
+ * Format: double
2485
+ * @description The winning candidate's score. `1.0` is an exact identity match.
2486
+ */
2487
+ confidence: number;
2488
+ /** @enum {string} */
2489
+ kind: "entity";
2490
+ /**
2491
+ * @description Boxed so one confident answer does not set the size of every
2492
+ * resolution, including the empty one.
2493
+ */
2494
+ subject: components["schemas"]["EntityMatchJson"];
2495
+ } | {
2496
+ candidates: components["schemas"]["EntityMatchJson"][];
2497
+ /** @enum {string} */
2498
+ kind: "ambiguous";
2499
+ } | {
2500
+ /** @enum {string} */
2501
+ kind: "topic";
2502
+ } | {
2503
+ /** @enum {string} */
2504
+ kind: "empty";
2505
+ nearest: components["schemas"]["EntityMatchJson"][];
2506
+ };
2507
+ ResolveUncertaintyRequestJson: {
2508
+ /**
2509
+ * @description The value to accept. Written as a fresh assertion at the upsert trust
2510
+ * prior, which is the highest in the table, and the revisions it beats are
2511
+ * retired explicitly.
2512
+ *
2513
+ * What persists is the **normalised** form, not the wire string:
2514
+ * whitespace runs collapse to single spaces, other control characters
2515
+ * drop, the result is capped at the value bound, and where the Context
2516
+ * enables PII redaction the detected identifiers are replaced first. That
2517
+ * form is also what the injection scan reads, so the stored text is
2518
+ * always a prefix of the text that was checked. A value that normalises
2519
+ * to nothing is refused rather than written.
2520
+ */
2521
+ acceptedValue: string;
2522
+ /**
2523
+ * @description Why this value was chosen, persisted as the new row's source clause so
2524
+ * the fact reads as an operator decision rather than an unexplained
2525
+ * high-trust assertion.
2526
+ *
2527
+ * Normalised on the same terms as `acceptedValue` and capped at the
2528
+ * source-clause bound, since the stored clause is rendered into
2529
+ * line-structured prompts where a newline could forge framing. A later
2530
+ * read returns that form, not the string as sent.
2531
+ */
2532
+ note?: string | null;
2533
+ };
2534
+ ResolveUncertaintyResponseJson: {
2535
+ uncertainty: components["schemas"]["UncertaintyJson"];
2536
+ };
2106
2537
  /**
2107
2538
  * @description Typed pointer to the row behind a hit's [`ResultHit::id`], so a caller can
2108
2539
  * resolve the underlying document, entity, or session without parsing raw
@@ -2169,7 +2600,7 @@ export interface components {
2169
2600
  * @enum {string}
2170
2601
  */
2171
2602
  ResultKind: "attribute" | "entity" | "action" | "chunk" | "memory_chunk" | "turn" | "section";
2172
- /** @description §15 operational signal (#174): retrieval candidate-set breadth. */
2603
+ /** @description Operational signal: retrieval candidate-set breadth. */
2173
2604
  RetrievalStatsJson: {
2174
2605
  /** Format: double */
2175
2606
  avgCandidateSet: number;
@@ -2272,20 +2703,248 @@ export interface components {
2272
2703
  ScopePattern: string;
2273
2704
  /** @description A DNF scope selector: an OR of conjunctive clauses. Each clause is an array of scope paths, ALL of which a reader must cover (AND); the outer array is the OR. E.g. [["team/a"],["team/b","clearance/secret"]] means team/a OR (team/b AND clearance/secret). Empty means unscoped (the caller's default region). A bare string is also accepted as a singleton clause. */
2274
2705
  ScopeSets: string[][];
2275
- SessionContextRequestJson: {
2276
- query: string;
2277
- };
2278
- SessionContextResponseJson: {
2279
- context: string;
2706
+ /**
2707
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2708
+ *
2709
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2710
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2711
+ * signal to follow the section's own collection endpoint, not to re-request
2712
+ * this one with a bigger limit.
2713
+ */
2714
+ SectionJson_ActionDetailJson: {
2715
+ items: {
2716
+ /** @description Navigable ref of the acting entity, `entity:<type>/<name>`. */
2717
+ actor: string;
2718
+ /** Format: double */
2719
+ confidence: number;
2720
+ createdAt: string;
2721
+ id: string;
2722
+ memoryCategory: components["schemas"]["MemoryCategory"];
2723
+ /**
2724
+ * @description Navigable ref (`entity:<type>/<name>`) of the acted-on entity, when
2725
+ * the object resolved to a graph entity.
2726
+ */
2727
+ object?: string | null;
2728
+ /**
2729
+ * @description The acted-on thing's verbatim name, when it did not resolve to an
2730
+ * entity. At most one of `object` / `objectText` is set.
2731
+ */
2732
+ objectText?: string | null;
2733
+ /**
2734
+ * @description Event time, distinct from assertion validity and learn time. Absent
2735
+ * when the source stated no resolvable time.
2736
+ */
2737
+ occurredAt?: string | null;
2738
+ source?: null | components["schemas"]["SourceRefJson"];
2739
+ summary: string;
2740
+ validFrom?: string | null;
2741
+ validUntil?: string | null;
2742
+ verb: string;
2743
+ }[];
2744
+ truncated: boolean;
2280
2745
  };
2281
- SessionResponseJson: {
2282
- createdAt: string;
2283
- id: string;
2284
- scopes: components["schemas"]["ScopeSets"];
2746
+ /**
2747
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2748
+ *
2749
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2750
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2751
+ * signal to follow the section's own collection endpoint, not to re-request
2752
+ * this one with a bigger limit.
2753
+ */
2754
+ SectionJson_AttributeDetailJson: {
2755
+ items: {
2756
+ /**
2757
+ * Format: double
2758
+ * @description Reconciler's posterior over this assertion on a `[0, 1]` scale. Distinct
2759
+ * from `source.trust`, the prior of the origin that fed it.
2760
+ */
2761
+ confidence: number;
2762
+ createdAt: string;
2763
+ /**
2764
+ * @description Navigable ref of the owning entity, `entity:<type>/<name>` — resolvable
2765
+ * via `GET /entities/{type}/{name}` or the `inspect` ref grammar.
2766
+ */
2767
+ entity: string;
2768
+ id: string;
2769
+ /** Format: double */
2770
+ importance: number;
2771
+ key: string;
2772
+ labels: string[];
2773
+ memoryCategory: components["schemas"]["MemoryCategory"];
2774
+ /**
2775
+ * @description The compartments this fact is visible in, in disjunctive normal form:
2776
+ * one inner list per AND-clause of scope paths. Empty means unscoped.
2777
+ */
2778
+ scope: string[][];
2779
+ source?: null | components["schemas"]["SourceRefJson"];
2780
+ /**
2781
+ * @description The fact rendered as a sentence, written at ingest by templating (no
2782
+ * model). Absent on rows written before the column existed.
2783
+ */
2784
+ summary?: string | null;
2785
+ supersededBy?: string | null;
2786
+ supersedes?: string | null;
2787
+ validFrom?: string | null;
2788
+ validUntil?: string | null;
2789
+ value: string;
2790
+ }[];
2791
+ truncated: boolean;
2285
2792
  };
2286
- /** @description §15 operational signal (#174): one provenance source-kind + its count. */
2287
- SourceKindCountJson: {
2288
- /** Format: int64 */
2793
+ /**
2794
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2795
+ *
2796
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2797
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2798
+ * signal to follow the section's own collection endpoint, not to re-request
2799
+ * this one with a bigger limit.
2800
+ */
2801
+ SectionJson_EntityMatchJson: {
2802
+ items: {
2803
+ /**
2804
+ * @description One sentence assembled from the highest-importance fact summaries, so
2805
+ * two same-named candidates can be told apart. Absent when the entity has
2806
+ * no summarised facts.
2807
+ */
2808
+ distinguisher?: string | null;
2809
+ entity: components["schemas"]["EntityDetailJson"];
2810
+ /**
2811
+ * Format: int64
2812
+ * @description Attributes + events + outbound relations. The number that says whether
2813
+ * walking here is worth it, which is why it is inline rather than a
2814
+ * request per row.
2815
+ */
2816
+ factCount: number;
2817
+ /** @description Newest known-time across the entity's own facts. */
2818
+ lastLearnedAt?: string | null;
2819
+ /**
2820
+ * @description The alias that matched, when the query named an alias and resolution
2821
+ * followed `same_as` to the canonical entity.
2822
+ */
2823
+ matchedAlias?: string | null;
2824
+ /**
2825
+ * Format: double
2826
+ * @description Match quality in `[0, 1]`. `1.0` for an exact match on the normalised
2827
+ * identity name; otherwise the Jaccard overlap of the query's word tokens
2828
+ * with the candidate name's, scaled to sit strictly below `1.0`. Corpus
2829
+ * independent, so one `ambiguityMargin` means the same thing in a Context
2830
+ * of ten entities and one of ten million. Always `1.0` for a listing that
2831
+ * matched no query.
2832
+ */
2833
+ score: number;
2834
+ }[];
2835
+ truncated: boolean;
2836
+ };
2837
+ /**
2838
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2839
+ *
2840
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2841
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2842
+ * signal to follow the section's own collection endpoint, not to re-request
2843
+ * this one with a bigger limit.
2844
+ */
2845
+ SectionJson_PassageJson: {
2846
+ items: {
2847
+ documentId?: string | null;
2848
+ occurredAt?: string | null;
2849
+ /** Format: int64 */
2850
+ position?: number | null;
2851
+ /** Format: float */
2852
+ score: number;
2853
+ text: string;
2854
+ }[];
2855
+ truncated: boolean;
2856
+ };
2857
+ /**
2858
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2859
+ *
2860
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2861
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2862
+ * signal to follow the section's own collection endpoint, not to re-request
2863
+ * this one with a bigger limit.
2864
+ */
2865
+ SectionJson_RelationDetailJson: {
2866
+ items: {
2867
+ /**
2868
+ * Format: double
2869
+ * @description Reconciler's posterior over the edge on a `[0, 1]` scale. Distinct from
2870
+ * `source.trust`, the prior of the origin that fed it.
2871
+ */
2872
+ confidence: number;
2873
+ createdAt: string;
2874
+ id: string;
2875
+ label: string;
2876
+ labels: string[];
2877
+ memoryCategory: components["schemas"]["MemoryCategory"];
2878
+ /** @description Navigable ref of the object entity, `entity:<type>/<name>`. */
2879
+ object: string;
2880
+ /** @description The compartments this edge is visible in, in disjunctive normal form. */
2881
+ scope: string[][];
2882
+ source?: null | components["schemas"]["SourceRefJson"];
2883
+ /**
2884
+ * @description Navigable ref of the subject entity, `entity:<type>/<name>` —
2885
+ * resolvable via `GET /entities/{type}/{name}` or the `inspect` ref
2886
+ * grammar.
2887
+ */
2888
+ subject: string;
2889
+ /**
2890
+ * @description The edge rendered as a sentence, written at ingest by templating (no
2891
+ * model). Absent on rows written before the column existed.
2892
+ */
2893
+ summary?: string | null;
2894
+ validFrom?: string | null;
2895
+ validUntil?: string | null;
2896
+ }[];
2897
+ truncated: boolean;
2898
+ };
2899
+ /**
2900
+ * @description A bounded slice of one section, with the flag that says whether it was cut.
2901
+ *
2902
+ * `truncated` comes from a probe row, never a count: the read fetches one row
2903
+ * past the limit and drops it, so "there is more" costs nothing. It is the
2904
+ * signal to follow the section's own collection endpoint, not to re-request
2905
+ * this one with a bigger limit.
2906
+ */
2907
+ SectionJson_UncertaintyJson: {
2908
+ items: {
2909
+ about: string;
2910
+ createdAt: string;
2911
+ /** @description Navigable ref of the subject, `entity:<type>/<name>`, when there is one. */
2912
+ entity?: string | null;
2913
+ id: string;
2914
+ key?: string | null;
2915
+ labels: string[];
2916
+ reason: string;
2917
+ /**
2918
+ * @description Whether `POST /uncertainty/{id}/resolve` would settle this flag **for
2919
+ * the calling key**. `false` for a subject-less flag, for one already
2920
+ * settled, and for one whose scope reaches beyond the caller's
2921
+ * `memory:write` region, since settling replaces the contenders where
2922
+ * they live and is refused rather than narrowed. A client can offer the
2923
+ * action exactly when it would succeed instead of deriving that from
2924
+ * other fields, and the same row can be `true` for one key and `false`
2925
+ * for another.
2926
+ */
2927
+ resolvable: boolean;
2928
+ resolved: boolean;
2929
+ resolvedAt?: string | null;
2930
+ scope: string[][];
2931
+ }[];
2932
+ truncated: boolean;
2933
+ };
2934
+ SessionContextRequestJson: {
2935
+ query: string;
2936
+ };
2937
+ SessionContextResponseJson: {
2938
+ context: string;
2939
+ };
2940
+ SessionResponseJson: {
2941
+ createdAt: string;
2942
+ id: string;
2943
+ scopes: components["schemas"]["ScopeSets"];
2944
+ };
2945
+ /** @description Operational signal: one provenance source-kind + its count. */
2946
+ SourceKindCountJson: {
2947
+ /** Format: int64 */
2289
2948
  count: number;
2290
2949
  kind: string;
2291
2950
  };
@@ -2304,6 +2963,19 @@ export interface components {
2304
2963
  ref?: string | null;
2305
2964
  /** @description The session the source turn belongs to (`turn` kind only). */
2306
2965
  sessionId?: string | null;
2966
+ /**
2967
+ * @description The source document's title (`document` kind only), resolved in one
2968
+ * batched read per response so naming a source costs no extra request.
2969
+ */
2970
+ title?: string | null;
2971
+ /**
2972
+ * Format: double
2973
+ * @description The source-level trust prior this row was written under, defaulted by
2974
+ * kind. This is what makes "a document said this" weigh differently from
2975
+ * "someone said this once" when two sources disagree. Absent on rows
2976
+ * written before provenance carried it.
2977
+ */
2978
+ trust?: number | null;
2307
2979
  };
2308
2980
  StateResponseJson: {
2309
2981
  context: components["schemas"]["CategoryStateJson"];
@@ -2327,7 +2999,7 @@ export interface components {
2327
2999
  relations: boolean;
2328
3000
  unknowns: boolean;
2329
3001
  };
2330
- /** @description §15 operational signal (#174): supersession churn. */
3002
+ /** @description Operational signal: supersession churn. */
2331
3003
  SupersessionStatsJson: {
2332
3004
  /** Format: double */
2333
3005
  churnPerEntity: number;
@@ -2338,7 +3010,7 @@ export interface components {
2338
3010
  };
2339
3011
  /**
2340
3012
  * @description Which tier resolved the query. Exposed on the response for the
2341
- * CLI's `--tier` flag (Phase 8) and so callers can tell when their
3013
+ * CLI's `--tier` flag and so callers can tell when their
2342
3014
  * query went all the way to tier 4.
2343
3015
  * @enum {string}
2344
3016
  */
@@ -2351,6 +3023,9 @@ export interface components {
2351
3023
  /** Format: int64 */
2352
3024
  hybrid: number;
2353
3025
  };
3026
+ TopEntitiesResponseJson: {
3027
+ entities: components["schemas"]["EntityMatchJson"][];
3028
+ };
2354
3029
  /**
2355
3030
  * @description The trace `kind` discriminant — a closed three-value set over the
2356
3031
  * trace tables. Serialises to `decision` / `retrieval` / `response`
@@ -2387,59 +3062,139 @@ export interface components {
2387
3062
  avgLatencyMs: number;
2388
3063
  /**
2389
3064
  * Format: double
2390
- * @description Phase 7.6 — `response_traces_cached / response_traces_total`.
3065
+ * @description `response_traces_cached / response_traces_total`.
2391
3066
  */
2392
3067
  cacheHitRate: number;
2393
3068
  /** Format: int64 */
2394
3069
  cacheHits: number;
2395
- /** @description §15 — cross-provenance contradiction rate. */
3070
+ /** @description Cross-provenance contradiction rate. */
2396
3071
  contradiction: components["schemas"]["ContradictionStatsJson"];
2397
3072
  /**
2398
3073
  * Format: int64
2399
- * @description Phase 7.6 — subset with `reused_from IS NOT NONE` (served from
3074
+ * @description Subset with `reused_from IS NOT NONE` (served from
2400
3075
  * the entity-aware cache).
2401
3076
  */
2402
3077
  responseTracesCached: number;
2403
3078
  /**
2404
3079
  * Format: int64
2405
- * @description Phase 7.6 — `response_trace` rows in the configured window.
3080
+ * @description `response_trace` rows in the configured window.
2406
3081
  */
2407
3082
  responseTracesTotal: number;
2408
- /** @description §15 — retrieval candidate-set breadth. */
3083
+ /** @description Retrieval candidate-set breadth. */
2409
3084
  retrieval: components["schemas"]["RetrievalStatsJson"];
2410
3085
  /**
2411
- * @description §15 operational signals (#174), aggregated over the same window:
3086
+ * @description Operational signal, aggregated over the same window:
2412
3087
  * distribution of attribute provenance by `source.kind`.
2413
3088
  */
2414
3089
  sourceKindDistribution: components["schemas"]["SourceKindCountJson"][];
2415
- /** @description §15 — supersession churn. */
3090
+ /** @description Supersession churn. */
2416
3091
  supersession: components["schemas"]["SupersessionStatsJson"];
2417
3092
  tierCounts: components["schemas"]["TierCountsJson"];
2418
3093
  /** Format: int64 */
2419
3094
  totalQueries: number;
2420
3095
  /**
2421
3096
  * Format: int32
2422
- * @description Phase 7.6 — window over which the response-trace counts were
3097
+ * @description Window over which the response-trace counts were
2423
3098
  * aggregated.
2424
3099
  */
2425
3100
  windowHours: number;
2426
3101
  };
2427
3102
  /**
2428
- * @description A structured triple supplied directly by the caller (no LLM).
3103
+ * @description A structured fact entry supplied directly by the caller (no LLM).
3104
+ *
3105
+ * One array, four families, discriminated by which optional field is set -
3106
+ * exactly one of:
3107
+ *
3108
+ * - `value` - an **attribute**: `key` + `value` on `entity`.
3109
+ * - `target` - a **relation** edge from `entity` to `target`, labelled `key`.
3110
+ * - `verb` - an **action** (a dated event `entity` performed); `key` must be absent. The acted-on
3111
+ * thing is named by `object` (free text that links to an entity iff the name resolves to one
3112
+ * supplied in this array or already in scope, mirroring extraction) - there is no typed object
3113
+ * reference, so a caller that needs a guaranteed entity link supplies the object entity as its
3114
+ * own entry in the same array first.
3115
+ * - none of the three - an **entity-only upsert** of `entity` (`key`, when present, is ignored for
3116
+ * backward compatibility).
2429
3117
  *
2430
- * `key` + `value` create an attribute; if `value` is `None` and `target`
2431
- * is `Some`, the triple represents a relation edge from `entity` to
2432
- * `target` with `key` as the relation label.
3118
+ * The per-fact enrichments mirror the extraction contract: `source_clause`
3119
+ * (verbatim provenance), `confidence` (attributes and actions only - the
3120
+ * extraction contract carries no per-relation score, so relations keep the
3121
+ * upsert trust prior), and event time as either `occurred_at` (explicit
3122
+ * RFC 3339, authoritative) or `temporal_hint` (a verbatim phrase resolved
3123
+ * against the request's `observed_at`/now anchor), never both. Relations
3124
+ * additionally accept explicit world-time `valid_from` / `valid_until`.
3125
+ * Entries that violate these rules are rejected with HTTP 422, never
3126
+ * silently reinterpreted.
2433
3127
  */
2434
3128
  Triple: {
3129
+ /**
3130
+ * Format: double
3131
+ * @description Per-assertion confidence in `[0, 1]`, same semantics as extraction:
3132
+ * when absent the reconciler falls back to the upsert trust prior.
3133
+ * Attributes and actions only.
3134
+ */
3135
+ confidence?: number | null;
2435
3136
  entity: components["schemas"]["TripleEntity"];
2436
- key: string;
3137
+ /**
3138
+ * @description Attribute key or relation label. Required for attribute and relation
3139
+ * entries; must be absent on action entries (the predicate is `verb`).
3140
+ */
3141
+ key?: string | null;
2437
3142
  memory_category?: null | components["schemas"]["MemoryCategory"];
3143
+ /**
3144
+ * @description Action object: the acted-on thing's name. Links to an entity iff the
3145
+ * name resolves to one (supplied in this array or already in scope);
3146
+ * otherwise stored verbatim as loose text, exactly as extraction does.
3147
+ */
3148
+ object?: string | null;
3149
+ /**
3150
+ * @description Explicit event time (RFC 3339), authoritative. On an attribute or
3151
+ * relation it also sets the assertion's `valid_from` (the same mapping a
3152
+ * resolved at/since hint produces); on an action it is the event instant.
3153
+ * Mutually exclusive with `temporal_hint`.
3154
+ */
3155
+ occurred_at?: string | null;
3156
+ /**
3157
+ * @description The verbatim clause of the caller's source material that states this
3158
+ * fact, stored beside the normalized row for lexical search.
3159
+ */
3160
+ source_clause?: string | null;
3161
+ /**
3162
+ * @description Action summary: one short self-contained sentence restating the event
3163
+ * with every reference resolved to a name - the text the event is found
3164
+ * by. Synthesised from actor/verb/object when absent. No dates: event
3165
+ * time lives in `occurred_at`, never in the searchable sentence.
3166
+ */
3167
+ summary?: string | null;
2438
3168
  target?: null | components["schemas"]["TripleEntity"];
3169
+ /**
3170
+ * @description Verbatim temporal phrase ("last Friday", "since 2019"), resolved by
3171
+ * the same resolver extraction uses, anchored at the request's
3172
+ * `observed_at` when set, else ingest time. Mutually exclusive with the
3173
+ * explicit timestamp fields.
3174
+ */
3175
+ temporal_hint?: string | null;
3176
+ /**
3177
+ * @description Relation only: explicit world-time validity start (RFC 3339). Mutually
3178
+ * exclusive with `occurred_at` (both state the start).
3179
+ */
3180
+ valid_from?: string | null;
3181
+ /** @description Relation only: explicit world-time validity end (RFC 3339). */
3182
+ valid_until?: string | null;
2439
3183
  value?: string | null;
3184
+ /**
3185
+ * @description Action discriminant: what `entity` did, as a lowercase snake_case verb
3186
+ * phrase ("shipped", "moved_to") following the relation-label convention.
3187
+ */
3188
+ verb?: string | null;
2440
3189
  };
2441
3190
  /** @description Entity descriptor on a [`Triple`]. */
2442
3191
  TripleEntity: {
3192
+ /**
3193
+ * @description Entity surface name. Must contain at least one non-whitespace
3194
+ * character: the stored record id derives from the normalised name, so a
3195
+ * blank name has no identity and is rejected (HTTP 422). Surrounding
3196
+ * whitespace is accepted and trimmed by normalisation.
3197
+ */
2443
3198
  name: string;
2444
3199
  type: string;
2445
3200
  };
@@ -2462,6 +3217,47 @@ export interface components {
2462
3217
  * @enum {string}
2463
3218
  */
2464
3219
  TurnRole: "user" | "assistant" | "system" | "tool";
3220
+ /**
3221
+ * @description One thing the Context is unsure about.
3222
+ *
3223
+ * `entity` and `key` are present only on the two reconciler-raised kinds - a
3224
+ * cross-provenance contradiction and a confidence-floor hold. An
3225
+ * injection-scan finding and a model-emitted doubt carry neither, and
3226
+ * `resolvable` is `false` for them: there is no fact to write, so no accepted
3227
+ * value could settle them. It is `false` for an already-settled flag too:
3228
+ * settling is guarded on `resolved = false`, so a second attempt is refused
3229
+ * whatever the row records, and `false` for a flag whose scope is wider than
3230
+ * the caller's own write region, since that settlement is refused rather
3231
+ * than narrowed to the part the caller may write.
3232
+ */
3233
+ UncertaintyJson: {
3234
+ about: string;
3235
+ createdAt: string;
3236
+ /** @description Navigable ref of the subject, `entity:<type>/<name>`, when there is one. */
3237
+ entity?: string | null;
3238
+ id: string;
3239
+ key?: string | null;
3240
+ labels: string[];
3241
+ reason: string;
3242
+ /**
3243
+ * @description Whether `POST /uncertainty/{id}/resolve` would settle this flag **for
3244
+ * the calling key**. `false` for a subject-less flag, for one already
3245
+ * settled, and for one whose scope reaches beyond the caller's
3246
+ * `memory:write` region, since settling replaces the contenders where
3247
+ * they live and is refused rather than narrowed. A client can offer the
3248
+ * action exactly when it would succeed instead of deriving that from
3249
+ * other fields, and the same row can be `true` for one key and `false`
3250
+ * for another.
3251
+ */
3252
+ resolvable: boolean;
3253
+ resolved: boolean;
3254
+ resolvedAt?: string | null;
3255
+ scope: string[][];
3256
+ };
3257
+ UncertaintyListResponseJson: {
3258
+ page: components["schemas"]["PageMeta"];
3259
+ unknowns: components["schemas"]["UncertaintyJson"][];
3260
+ };
2465
3261
  UncertaintySummaryJson: {
2466
3262
  about: string;
2467
3263
  reason: string;
@@ -2477,6 +3273,8 @@ export interface components {
2477
3273
  * @description Optional `"key=value"` labels stamped onto the document and inherited by its
2478
3274
  * chunks/sections (validated like facts: `_`-prefixed keys rejected with 400, a
2479
3275
  * per-fact count cap with 409). Reconciled graph rows are never labelled.
3276
+ * Upload only: a reprocess keeps the document's existing labels and ignores
3277
+ * this field.
2480
3278
  */
2481
3279
  labels?: string[];
2482
3280
  mimeType?: string | null;
@@ -2499,8 +3297,8 @@ export interface components {
2499
3297
  * `[["org/apple/product/macbook"]]` (or co-owned `["team/a","team/b"]`). Each
2500
3298
  * clause's nodes must lie within the caller's `memory:write` region (a request
2501
3299
  * outside it is a 403). Omitted ⇒ the document inherits the caller's whole
2502
- * write region (unchanged behaviour). Clients must send the `metadata` part
2503
- * before the `file` part for it to apply.
3300
+ * write region. Upload only: a reprocess keeps the document's existing scope
3301
+ * and ignores this field.
2504
3302
  */
2505
3303
  scopes?: components["schemas"]["ScopeSets"];
2506
3304
  source?: string | null;
@@ -2845,6 +3643,15 @@ export interface operations {
2845
3643
  "application/json": components["schemas"]["ApiErrorResponse"];
2846
3644
  };
2847
3645
  };
3646
+ /** @description Label count exceeds the per-fact cap */
3647
+ 409: {
3648
+ headers: {
3649
+ [name: string]: unknown;
3650
+ };
3651
+ content: {
3652
+ "application/json": components["schemas"]["ApiErrorResponse"];
3653
+ };
3654
+ };
2848
3655
  /** @description Invalid context id */
2849
3656
  422: {
2850
3657
  headers: {
@@ -2964,6 +3771,15 @@ export interface operations {
2964
3771
  "application/json": components["schemas"]["ApiErrorResponse"];
2965
3772
  };
2966
3773
  };
3774
+ /** @description The requested `subject` names no entity the caller can read */
3775
+ 404: {
3776
+ headers: {
3777
+ [name: string]: unknown;
3778
+ };
3779
+ content: {
3780
+ "application/json": components["schemas"]["ApiErrorResponse"];
3781
+ };
3782
+ };
2967
3783
  /** @description Invalid context id */
2968
3784
  422: {
2969
3785
  headers: {
@@ -3087,7 +3903,7 @@ export interface operations {
3087
3903
  "application/json": components["schemas"]["UploadResponse"];
3088
3904
  };
3089
3905
  };
3090
- /** @description Malformed multipart, scope, or label */
3906
+ /** @description Malformed multipart, empty file part, scope, or label */
3091
3907
  400: {
3092
3908
  headers: {
3093
3909
  [name: string]: unknown;
@@ -3589,7 +4405,7 @@ export interface operations {
3589
4405
  "application/json": components["schemas"]["UploadResponse"];
3590
4406
  };
3591
4407
  };
3592
- /** @description Malformed multipart */
4408
+ /** @description Malformed multipart or empty file part */
3593
4409
  400: {
3594
4410
  headers: {
3595
4411
  [name: string]: unknown;
@@ -4075,17 +4891,20 @@ export interface operations {
4075
4891
  };
4076
4892
  };
4077
4893
  };
4078
- get_entity: {
4894
+ search_entities: {
4079
4895
  parameters: {
4080
- query?: never;
4896
+ query: {
4897
+ /** @description The name to search for */
4898
+ q: string;
4899
+ /** @description Restrict to one entity type */
4900
+ type?: string;
4901
+ /** @description Max matches (default 10) */
4902
+ limit?: number;
4903
+ };
4081
4904
  header?: never;
4082
4905
  path: {
4083
4906
  /** @description Agent Memory context id */
4084
4907
  context_id: string;
4085
- /** @description Entity type */
4086
- entity_type: string;
4087
- /** @description Entity name */
4088
- entity_name: string;
4089
4908
  };
4090
4909
  cookie?: never;
4091
4910
  };
@@ -4096,11 +4915,11 @@ export interface operations {
4096
4915
  [name: string]: unknown;
4097
4916
  };
4098
4917
  content: {
4099
- "application/json": components["schemas"]["EntityResponseJson"];
4918
+ "application/json": components["schemas"]["EntitySearchResponseJson"];
4100
4919
  };
4101
4920
  };
4102
- /** @description Unauthorized */
4103
- 401: {
4921
+ /** @description Invalid query */
4922
+ 400: {
4104
4923
  headers: {
4105
4924
  [name: string]: unknown;
4106
4925
  };
@@ -4108,8 +4927,8 @@ export interface operations {
4108
4927
  "application/json": components["schemas"]["ApiErrorResponse"];
4109
4928
  };
4110
4929
  };
4111
- /** @description Entity not found */
4112
- 404: {
4930
+ /** @description Unauthorized */
4931
+ 401: {
4113
4932
  headers: {
4114
4933
  [name: string]: unknown;
4115
4934
  };
@@ -4139,28 +4958,41 @@ export interface operations {
4139
4958
  };
4140
4959
  };
4141
4960
  };
4142
- delete_entity: {
4961
+ top_entities: {
4143
4962
  parameters: {
4144
- query?: never;
4963
+ query?: {
4964
+ /** @description coverage (default) | importance | recency */
4965
+ by?: string;
4966
+ /** @description Restrict to one entity type */
4967
+ type?: string;
4968
+ /** @description Max entities (default 10) */
4969
+ limit?: number;
4970
+ };
4145
4971
  header?: never;
4146
4972
  path: {
4147
4973
  /** @description Agent Memory context id */
4148
4974
  context_id: string;
4149
- /** @description Entity type */
4150
- entity_type: string;
4151
- /** @description Entity name */
4152
- entity_name: string;
4153
4975
  };
4154
4976
  cookie?: never;
4155
4977
  };
4156
4978
  requestBody?: never;
4157
4979
  responses: {
4158
- /** @description Entity soft-deleted */
4159
- 204: {
4980
+ 200: {
4160
4981
  headers: {
4161
4982
  [name: string]: unknown;
4162
4983
  };
4163
- content?: never;
4984
+ content: {
4985
+ "application/json": components["schemas"]["TopEntitiesResponseJson"];
4986
+ };
4987
+ };
4988
+ /** @description Invalid ordering */
4989
+ 400: {
4990
+ headers: {
4991
+ [name: string]: unknown;
4992
+ };
4993
+ content: {
4994
+ "application/json": components["schemas"]["ApiErrorResponse"];
4995
+ };
4164
4996
  };
4165
4997
  /** @description Unauthorized */
4166
4998
  401: {
@@ -4193,9 +5025,20 @@ export interface operations {
4193
5025
  };
4194
5026
  };
4195
5027
  };
4196
- get_entity_history: {
5028
+ get_entity: {
4197
5029
  parameters: {
4198
- query?: never;
5030
+ query?: {
5031
+ /** @description Max rows per fact section (default 500, max 500) */
5032
+ limit?: number;
5033
+ /** @description Known-time: read the facts as they stood at this instant */
5034
+ asOf?: string;
5035
+ /** @description Read through MVCC at this instant */
5036
+ atInstant?: string;
5037
+ /** @description World-time lower bound */
5038
+ validFrom?: string;
5039
+ /** @description World-time upper bound */
5040
+ validUntil?: string;
5041
+ };
4199
5042
  header?: never;
4200
5043
  path: {
4201
5044
  /** @description Agent Memory context id */
@@ -4204,8 +5047,6 @@ export interface operations {
4204
5047
  entity_type: string;
4205
5048
  /** @description Entity name */
4206
5049
  entity_name: string;
4207
- /** @description Attribute key */
4208
- key: string;
4209
5050
  };
4210
5051
  cookie?: never;
4211
5052
  };
@@ -4216,7 +5057,7 @@ export interface operations {
4216
5057
  [name: string]: unknown;
4217
5058
  };
4218
5059
  content: {
4219
- "application/json": components["schemas"]["EntityHistoryResponseJson"];
5060
+ "application/json": components["schemas"]["EntityResponseJson"];
4220
5061
  };
4221
5062
  };
4222
5063
  /** @description Unauthorized */
@@ -4259,38 +5100,28 @@ export interface operations {
4259
5100
  };
4260
5101
  };
4261
5102
  };
4262
- create_fact: {
5103
+ delete_entity: {
4263
5104
  parameters: {
4264
5105
  query?: never;
4265
5106
  header?: never;
4266
5107
  path: {
4267
5108
  /** @description Agent Memory context id */
4268
5109
  context_id: string;
5110
+ /** @description Entity type */
5111
+ entity_type: string;
5112
+ /** @description Entity name */
5113
+ entity_name: string;
4269
5114
  };
4270
5115
  cookie?: never;
4271
5116
  };
4272
- requestBody: {
4273
- content: {
4274
- "application/json": components["schemas"]["FactsRequest"];
4275
- };
4276
- };
5117
+ requestBody?: never;
4277
5118
  responses: {
4278
- 200: {
4279
- headers: {
4280
- [name: string]: unknown;
4281
- };
4282
- content: {
4283
- "application/json": components["schemas"]["FactsResponseJson"];
4284
- };
4285
- };
4286
- /** @description Invalid request */
4287
- 400: {
5119
+ /** @description Entity soft-deleted */
5120
+ 204: {
4288
5121
  headers: {
4289
5122
  [name: string]: unknown;
4290
5123
  };
4291
- content: {
4292
- "application/json": components["schemas"]["ApiErrorResponse"];
4293
- };
5124
+ content?: never;
4294
5125
  };
4295
5126
  /** @description Unauthorized */
4296
5127
  401: {
@@ -4301,15 +5132,6 @@ export interface operations {
4301
5132
  "application/json": components["schemas"]["ApiErrorResponse"];
4302
5133
  };
4303
5134
  };
4304
- /** @description Idempotency-Key reused with a different body */
4305
- 409: {
4306
- headers: {
4307
- [name: string]: unknown;
4308
- };
4309
- content: {
4310
- "application/json": components["schemas"]["ApiErrorResponse"];
4311
- };
4312
- };
4313
5135
  /** @description Invalid context id */
4314
5136
  422: {
4315
5137
  headers: {
@@ -4332,31 +5154,38 @@ export interface operations {
4332
5154
  };
4333
5155
  };
4334
5156
  };
4335
- create_facts_batch: {
5157
+ entity_history_all: {
4336
5158
  parameters: {
4337
- query?: never;
5159
+ query?: {
5160
+ /** @description Max rows per page */
5161
+ limit?: number;
5162
+ /** @description Continuation token from `page.nextCursor` */
5163
+ cursor?: string;
5164
+ /** @description Also return `page.totalSize` */
5165
+ count?: boolean;
5166
+ };
4338
5167
  header?: never;
4339
5168
  path: {
4340
5169
  /** @description Agent Memory context id */
4341
5170
  context_id: string;
5171
+ /** @description Entity type */
5172
+ entity_type: string;
5173
+ /** @description Entity name */
5174
+ entity_name: string;
4342
5175
  };
4343
5176
  cookie?: never;
4344
5177
  };
4345
- requestBody: {
4346
- content: {
4347
- "application/json": components["schemas"]["FactsBatchRequest"];
4348
- };
4349
- };
5178
+ requestBody?: never;
4350
5179
  responses: {
4351
5180
  200: {
4352
5181
  headers: {
4353
5182
  [name: string]: unknown;
4354
5183
  };
4355
5184
  content: {
4356
- "application/json": components["schemas"]["FactsBatchResponseJson"];
5185
+ "application/json": components["schemas"]["EntityHistoryAllResponseJson"];
4357
5186
  };
4358
5187
  };
4359
- /** @description Invalid request */
5188
+ /** @description Invalid pagination parameter */
4360
5189
  400: {
4361
5190
  headers: {
4362
5191
  [name: string]: unknown;
@@ -4374,8 +5203,8 @@ export interface operations {
4374
5203
  "application/json": components["schemas"]["ApiErrorResponse"];
4375
5204
  };
4376
5205
  };
4377
- /** @description Idempotency-Key reused with a different body */
4378
- 409: {
5206
+ /** @description Entity not found */
5207
+ 404: {
4379
5208
  headers: {
4380
5209
  [name: string]: unknown;
4381
5210
  };
@@ -4405,32 +5234,34 @@ export interface operations {
4405
5234
  };
4406
5235
  };
4407
5236
  };
4408
- forget: {
5237
+ get_entity_history: {
4409
5238
  parameters: {
4410
5239
  query?: never;
4411
5240
  header?: never;
4412
5241
  path: {
4413
5242
  /** @description Agent Memory context id */
4414
5243
  context_id: string;
5244
+ /** @description Entity type */
5245
+ entity_type: string;
5246
+ /** @description Entity name */
5247
+ entity_name: string;
5248
+ /** @description Attribute key */
5249
+ key: string;
4415
5250
  };
4416
5251
  cookie?: never;
4417
5252
  };
4418
- requestBody: {
4419
- content: {
4420
- "application/json": components["schemas"]["ForgetRequestJson"];
4421
- };
4422
- };
5253
+ requestBody?: never;
4423
5254
  responses: {
4424
5255
  200: {
4425
5256
  headers: {
4426
5257
  [name: string]: unknown;
4427
5258
  };
4428
5259
  content: {
4429
- "application/json": components["schemas"]["ForgetResponseJson"];
5260
+ "application/json": components["schemas"]["EntityHistoryResponseJson"];
4430
5261
  };
4431
5262
  };
4432
- /** @description Invalid request */
4433
- 400: {
5263
+ /** @description Unauthorized */
5264
+ 401: {
4434
5265
  headers: {
4435
5266
  [name: string]: unknown;
4436
5267
  };
@@ -4438,8 +5269,8 @@ export interface operations {
4438
5269
  "application/json": components["schemas"]["ApiErrorResponse"];
4439
5270
  };
4440
5271
  };
4441
- /** @description Unauthorized */
4442
- 401: {
5272
+ /** @description Entity not found */
5273
+ 404: {
4443
5274
  headers: {
4444
5275
  [name: string]: unknown;
4445
5276
  };
@@ -4469,12 +5300,304 @@ export interface operations {
4469
5300
  };
4470
5301
  };
4471
5302
  };
4472
- fsck: {
5303
+ entity_neighbourhood: {
4473
5304
  parameters: {
4474
- query?: never;
4475
- header?: never;
4476
- path: {
4477
- /** @description Agent Memory context id */
5305
+ query?: {
5306
+ /** @description Drop neighbours with fewer facts than this */
5307
+ minFacts?: number;
5308
+ /** @description Max neighbours per page */
5309
+ limit?: number;
5310
+ /** @description Continuation token from `page.nextCursor` */
5311
+ cursor?: string;
5312
+ /** @description Also return the subject's visible edge total in `page.totalSize`. Cannot be combined with `minFacts`. */
5313
+ count?: boolean;
5314
+ };
5315
+ header?: never;
5316
+ path: {
5317
+ /** @description Agent Memory context id */
5318
+ context_id: string;
5319
+ /** @description Entity type */
5320
+ entity_type: string;
5321
+ /** @description Entity name */
5322
+ entity_name: string;
5323
+ };
5324
+ cookie?: never;
5325
+ };
5326
+ requestBody?: never;
5327
+ responses: {
5328
+ 200: {
5329
+ headers: {
5330
+ [name: string]: unknown;
5331
+ };
5332
+ content: {
5333
+ "application/json": components["schemas"]["NeighbourhoodResponseJson"];
5334
+ };
5335
+ };
5336
+ /** @description Invalid pagination parameter */
5337
+ 400: {
5338
+ headers: {
5339
+ [name: string]: unknown;
5340
+ };
5341
+ content: {
5342
+ "application/json": components["schemas"]["ApiErrorResponse"];
5343
+ };
5344
+ };
5345
+ /** @description Unauthorized */
5346
+ 401: {
5347
+ headers: {
5348
+ [name: string]: unknown;
5349
+ };
5350
+ content: {
5351
+ "application/json": components["schemas"]["ApiErrorResponse"];
5352
+ };
5353
+ };
5354
+ /** @description Entity not found */
5355
+ 404: {
5356
+ headers: {
5357
+ [name: string]: unknown;
5358
+ };
5359
+ content: {
5360
+ "application/json": components["schemas"]["ApiErrorResponse"];
5361
+ };
5362
+ };
5363
+ /** @description Invalid context id */
5364
+ 422: {
5365
+ headers: {
5366
+ [name: string]: unknown;
5367
+ };
5368
+ content: {
5369
+ "application/json": components["schemas"]["ApiErrorResponse"];
5370
+ };
5371
+ };
5372
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
5373
+ 503: {
5374
+ headers: {
5375
+ /** @description Seconds to wait before retrying. */
5376
+ "Retry-After"?: number;
5377
+ [name: string]: unknown;
5378
+ };
5379
+ content: {
5380
+ "application/json": components["schemas"]["ApiErrorResponse"];
5381
+ };
5382
+ };
5383
+ };
5384
+ };
5385
+ create_fact: {
5386
+ parameters: {
5387
+ query?: never;
5388
+ header?: never;
5389
+ path: {
5390
+ /** @description Agent Memory context id */
5391
+ context_id: string;
5392
+ };
5393
+ cookie?: never;
5394
+ };
5395
+ requestBody: {
5396
+ content: {
5397
+ "application/json": components["schemas"]["FactsRequest"];
5398
+ };
5399
+ };
5400
+ responses: {
5401
+ 200: {
5402
+ headers: {
5403
+ [name: string]: unknown;
5404
+ };
5405
+ content: {
5406
+ "application/json": components["schemas"]["FactsResponseJson"];
5407
+ };
5408
+ };
5409
+ /** @description Invalid request */
5410
+ 400: {
5411
+ headers: {
5412
+ [name: string]: unknown;
5413
+ };
5414
+ content: {
5415
+ "application/json": components["schemas"]["ApiErrorResponse"];
5416
+ };
5417
+ };
5418
+ /** @description Unauthorized */
5419
+ 401: {
5420
+ headers: {
5421
+ [name: string]: unknown;
5422
+ };
5423
+ content: {
5424
+ "application/json": components["schemas"]["ApiErrorResponse"];
5425
+ };
5426
+ };
5427
+ /** @description Idempotency-Key reused with a different body */
5428
+ 409: {
5429
+ headers: {
5430
+ [name: string]: unknown;
5431
+ };
5432
+ content: {
5433
+ "application/json": components["schemas"]["ApiErrorResponse"];
5434
+ };
5435
+ };
5436
+ /** @description Invalid context id, or a malformed/ambiguous `triples` entry */
5437
+ 422: {
5438
+ headers: {
5439
+ [name: string]: unknown;
5440
+ };
5441
+ content: {
5442
+ "application/json": components["schemas"]["ApiErrorResponse"];
5443
+ };
5444
+ };
5445
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
5446
+ 503: {
5447
+ headers: {
5448
+ /** @description Seconds to wait before retrying. */
5449
+ "Retry-After"?: number;
5450
+ [name: string]: unknown;
5451
+ };
5452
+ content: {
5453
+ "application/json": components["schemas"]["ApiErrorResponse"];
5454
+ };
5455
+ };
5456
+ };
5457
+ };
5458
+ create_facts_batch: {
5459
+ parameters: {
5460
+ query?: never;
5461
+ header?: never;
5462
+ path: {
5463
+ /** @description Agent Memory context id */
5464
+ context_id: string;
5465
+ };
5466
+ cookie?: never;
5467
+ };
5468
+ requestBody: {
5469
+ content: {
5470
+ "application/json": components["schemas"]["FactsBatchRequest"];
5471
+ };
5472
+ };
5473
+ responses: {
5474
+ 200: {
5475
+ headers: {
5476
+ [name: string]: unknown;
5477
+ };
5478
+ content: {
5479
+ "application/json": components["schemas"]["FactsBatchResponseJson"];
5480
+ };
5481
+ };
5482
+ /** @description Invalid request */
5483
+ 400: {
5484
+ headers: {
5485
+ [name: string]: unknown;
5486
+ };
5487
+ content: {
5488
+ "application/json": components["schemas"]["ApiErrorResponse"];
5489
+ };
5490
+ };
5491
+ /** @description Unauthorized */
5492
+ 401: {
5493
+ headers: {
5494
+ [name: string]: unknown;
5495
+ };
5496
+ content: {
5497
+ "application/json": components["schemas"]["ApiErrorResponse"];
5498
+ };
5499
+ };
5500
+ /** @description Idempotency-Key reused with a different body */
5501
+ 409: {
5502
+ headers: {
5503
+ [name: string]: unknown;
5504
+ };
5505
+ content: {
5506
+ "application/json": components["schemas"]["ApiErrorResponse"];
5507
+ };
5508
+ };
5509
+ /** @description Invalid context id */
5510
+ 422: {
5511
+ headers: {
5512
+ [name: string]: unknown;
5513
+ };
5514
+ content: {
5515
+ "application/json": components["schemas"]["ApiErrorResponse"];
5516
+ };
5517
+ };
5518
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
5519
+ 503: {
5520
+ headers: {
5521
+ /** @description Seconds to wait before retrying. */
5522
+ "Retry-After"?: number;
5523
+ [name: string]: unknown;
5524
+ };
5525
+ content: {
5526
+ "application/json": components["schemas"]["ApiErrorResponse"];
5527
+ };
5528
+ };
5529
+ };
5530
+ };
5531
+ forget: {
5532
+ parameters: {
5533
+ query?: never;
5534
+ header?: never;
5535
+ path: {
5536
+ /** @description Agent Memory context id */
5537
+ context_id: string;
5538
+ };
5539
+ cookie?: never;
5540
+ };
5541
+ requestBody: {
5542
+ content: {
5543
+ "application/json": components["schemas"]["ForgetRequestJson"];
5544
+ };
5545
+ };
5546
+ responses: {
5547
+ 200: {
5548
+ headers: {
5549
+ [name: string]: unknown;
5550
+ };
5551
+ content: {
5552
+ "application/json": components["schemas"]["ForgetResponseJson"];
5553
+ };
5554
+ };
5555
+ /** @description Invalid request */
5556
+ 400: {
5557
+ headers: {
5558
+ [name: string]: unknown;
5559
+ };
5560
+ content: {
5561
+ "application/json": components["schemas"]["ApiErrorResponse"];
5562
+ };
5563
+ };
5564
+ /** @description Unauthorized */
5565
+ 401: {
5566
+ headers: {
5567
+ [name: string]: unknown;
5568
+ };
5569
+ content: {
5570
+ "application/json": components["schemas"]["ApiErrorResponse"];
5571
+ };
5572
+ };
5573
+ /** @description Invalid context id */
5574
+ 422: {
5575
+ headers: {
5576
+ [name: string]: unknown;
5577
+ };
5578
+ content: {
5579
+ "application/json": components["schemas"]["ApiErrorResponse"];
5580
+ };
5581
+ };
5582
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
5583
+ 503: {
5584
+ headers: {
5585
+ /** @description Seconds to wait before retrying. */
5586
+ "Retry-After"?: number;
5587
+ [name: string]: unknown;
5588
+ };
5589
+ content: {
5590
+ "application/json": components["schemas"]["ApiErrorResponse"];
5591
+ };
5592
+ };
5593
+ };
5594
+ };
5595
+ fsck: {
5596
+ parameters: {
5597
+ query?: never;
5598
+ header?: never;
5599
+ path: {
5600
+ /** @description Agent Memory context id */
4478
5601
  context_id: string;
4479
5602
  };
4480
5603
  cookie?: never;
@@ -5039,6 +6162,70 @@ export interface operations {
5039
6162
  };
5040
6163
  };
5041
6164
  };
6165
+ lookup: {
6166
+ parameters: {
6167
+ query?: never;
6168
+ header?: never;
6169
+ path: {
6170
+ /** @description Agent Memory context id */
6171
+ context_id: string;
6172
+ };
6173
+ cookie?: never;
6174
+ };
6175
+ requestBody: {
6176
+ content: {
6177
+ "application/json": components["schemas"]["LookupRequestJson"];
6178
+ };
6179
+ };
6180
+ responses: {
6181
+ 200: {
6182
+ headers: {
6183
+ [name: string]: unknown;
6184
+ };
6185
+ content: {
6186
+ "application/json": components["schemas"]["LookupResponseJson"];
6187
+ };
6188
+ };
6189
+ /** @description Invalid request */
6190
+ 400: {
6191
+ headers: {
6192
+ [name: string]: unknown;
6193
+ };
6194
+ content: {
6195
+ "application/json": components["schemas"]["ApiErrorResponse"];
6196
+ };
6197
+ };
6198
+ /** @description Unauthorized */
6199
+ 401: {
6200
+ headers: {
6201
+ [name: string]: unknown;
6202
+ };
6203
+ content: {
6204
+ "application/json": components["schemas"]["ApiErrorResponse"];
6205
+ };
6206
+ };
6207
+ /** @description Invalid context id */
6208
+ 422: {
6209
+ headers: {
6210
+ [name: string]: unknown;
6211
+ };
6212
+ content: {
6213
+ "application/json": components["schemas"]["ApiErrorResponse"];
6214
+ };
6215
+ };
6216
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
6217
+ 503: {
6218
+ headers: {
6219
+ /** @description Seconds to wait before retrying. */
6220
+ "Retry-After"?: number;
6221
+ [name: string]: unknown;
6222
+ };
6223
+ content: {
6224
+ "application/json": components["schemas"]["ApiErrorResponse"];
6225
+ };
6226
+ };
6227
+ };
6228
+ };
5042
6229
  whoami: {
5043
6230
  parameters: {
5044
6231
  query?: never;
@@ -6212,16 +7399,150 @@ export interface operations {
6212
7399
  [name: string]: unknown;
6213
7400
  };
6214
7401
  content: {
6215
- "application/json": components["schemas"]["SessionContextResponseJson"];
6216
- };
6217
- };
6218
- /** @description Invalid request */
6219
- 400: {
6220
- headers: {
6221
- [name: string]: unknown;
6222
- };
6223
- content: {
6224
- "application/json": components["schemas"]["ApiErrorResponse"];
7402
+ "application/json": components["schemas"]["SessionContextResponseJson"];
7403
+ };
7404
+ };
7405
+ /** @description Invalid request */
7406
+ 400: {
7407
+ headers: {
7408
+ [name: string]: unknown;
7409
+ };
7410
+ content: {
7411
+ "application/json": components["schemas"]["ApiErrorResponse"];
7412
+ };
7413
+ };
7414
+ /** @description Unauthorized */
7415
+ 401: {
7416
+ headers: {
7417
+ [name: string]: unknown;
7418
+ };
7419
+ content: {
7420
+ "application/json": components["schemas"]["ApiErrorResponse"];
7421
+ };
7422
+ };
7423
+ /** @description Invalid context id */
7424
+ 422: {
7425
+ headers: {
7426
+ [name: string]: unknown;
7427
+ };
7428
+ content: {
7429
+ "application/json": components["schemas"]["ApiErrorResponse"];
7430
+ };
7431
+ };
7432
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
7433
+ 503: {
7434
+ headers: {
7435
+ /** @description Seconds to wait before retrying. */
7436
+ "Retry-After"?: number;
7437
+ [name: string]: unknown;
7438
+ };
7439
+ content: {
7440
+ "application/json": components["schemas"]["ApiErrorResponse"];
7441
+ };
7442
+ };
7443
+ };
7444
+ };
7445
+ list_turns: {
7446
+ parameters: {
7447
+ query?: {
7448
+ /** @description Max turns to return (default 100, max 500) */
7449
+ limit?: number;
7450
+ /** @description Continuation token from the previous page's `page.nextCursor` */
7451
+ cursor?: string;
7452
+ /** @description Also return `page.totalSize` (costs a full count of the session's turns) */
7453
+ count?: boolean;
7454
+ /** @description Deprecated: rows to skip. Use `cursor`. */
7455
+ offset?: number;
7456
+ };
7457
+ header?: never;
7458
+ path: {
7459
+ /** @description Agent Memory context id */
7460
+ context_id: string;
7461
+ /** @description Session id */
7462
+ session_id: string;
7463
+ };
7464
+ cookie?: never;
7465
+ };
7466
+ requestBody?: never;
7467
+ responses: {
7468
+ 200: {
7469
+ headers: {
7470
+ [name: string]: unknown;
7471
+ };
7472
+ content: {
7473
+ "application/json": components["schemas"]["TurnListResponseJson"];
7474
+ };
7475
+ };
7476
+ /** @description Invalid pagination parameter */
7477
+ 400: {
7478
+ headers: {
7479
+ [name: string]: unknown;
7480
+ };
7481
+ content: {
7482
+ "application/json": components["schemas"]["ApiErrorResponse"];
7483
+ };
7484
+ };
7485
+ /** @description Unauthorized */
7486
+ 401: {
7487
+ headers: {
7488
+ [name: string]: unknown;
7489
+ };
7490
+ content: {
7491
+ "application/json": components["schemas"]["ApiErrorResponse"];
7492
+ };
7493
+ };
7494
+ /** @description Session not found */
7495
+ 404: {
7496
+ headers: {
7497
+ [name: string]: unknown;
7498
+ };
7499
+ content: {
7500
+ "application/json": components["schemas"]["ApiErrorResponse"];
7501
+ };
7502
+ };
7503
+ /** @description Invalid context id */
7504
+ 422: {
7505
+ headers: {
7506
+ [name: string]: unknown;
7507
+ };
7508
+ content: {
7509
+ "application/json": components["schemas"]["ApiErrorResponse"];
7510
+ };
7511
+ };
7512
+ /** @description Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header. */
7513
+ 503: {
7514
+ headers: {
7515
+ /** @description Seconds to wait before retrying. */
7516
+ "Retry-After"?: number;
7517
+ [name: string]: unknown;
7518
+ };
7519
+ content: {
7520
+ "application/json": components["schemas"]["ApiErrorResponse"];
7521
+ };
7522
+ };
7523
+ };
7524
+ };
7525
+ get_state: {
7526
+ parameters: {
7527
+ query?: {
7528
+ /** @description Max rows per table (default 100, max 500) */
7529
+ limit?: number;
7530
+ };
7531
+ header?: never;
7532
+ path: {
7533
+ /** @description Agent Memory context id */
7534
+ context_id: string;
7535
+ };
7536
+ cookie?: never;
7537
+ };
7538
+ requestBody?: never;
7539
+ responses: {
7540
+ 200: {
7541
+ headers: {
7542
+ [name: string]: unknown;
7543
+ };
7544
+ content: {
7545
+ "application/json": components["schemas"]["StateResponseJson"];
6225
7546
  };
6226
7547
  };
6227
7548
  /** @description Unauthorized */
@@ -6255,24 +7576,20 @@ export interface operations {
6255
7576
  };
6256
7577
  };
6257
7578
  };
6258
- list_turns: {
7579
+ list_traces: {
6259
7580
  parameters: {
6260
7581
  query?: {
6261
- /** @description Max turns to return (default 100, max 500) */
7582
+ /** @description Max traces to return (default 100, max 500) */
6262
7583
  limit?: number;
6263
7584
  /** @description Continuation token from the previous page's `page.nextCursor` */
6264
7585
  cursor?: string;
6265
- /** @description Also return `page.totalSize` (costs a full count of the session's turns) */
7586
+ /** @description Also return `page.totalSize` (costs a full count of the visible traces) */
6266
7587
  count?: boolean;
6267
- /** @description Deprecated: rows to skip. Use `cursor`. */
6268
- offset?: number;
6269
7588
  };
6270
7589
  header?: never;
6271
7590
  path: {
6272
7591
  /** @description Agent Memory context id */
6273
7592
  context_id: string;
6274
- /** @description Session id */
6275
- session_id: string;
6276
7593
  };
6277
7594
  cookie?: never;
6278
7595
  };
@@ -6283,16 +7600,7 @@ export interface operations {
6283
7600
  [name: string]: unknown;
6284
7601
  };
6285
7602
  content: {
6286
- "application/json": components["schemas"]["TurnListResponseJson"];
6287
- };
6288
- };
6289
- /** @description Invalid pagination parameter */
6290
- 400: {
6291
- headers: {
6292
- [name: string]: unknown;
6293
- };
6294
- content: {
6295
- "application/json": components["schemas"]["ApiErrorResponse"];
7603
+ "application/json": components["schemas"]["TraceListResponseJson"];
6296
7604
  };
6297
7605
  };
6298
7606
  /** @description Unauthorized */
@@ -6304,15 +7612,6 @@ export interface operations {
6304
7612
  "application/json": components["schemas"]["ApiErrorResponse"];
6305
7613
  };
6306
7614
  };
6307
- /** @description Session not found */
6308
- 404: {
6309
- headers: {
6310
- [name: string]: unknown;
6311
- };
6312
- content: {
6313
- "application/json": components["schemas"]["ApiErrorResponse"];
6314
- };
6315
- };
6316
7615
  /** @description Invalid context id */
6317
7616
  422: {
6318
7617
  headers: {
@@ -6335,12 +7634,9 @@ export interface operations {
6335
7634
  };
6336
7635
  };
6337
7636
  };
6338
- get_state: {
7637
+ get_trace_stats: {
6339
7638
  parameters: {
6340
- query?: {
6341
- /** @description Max rows per table (default 100, max 500) */
6342
- limit?: number;
6343
- };
7639
+ query?: never;
6344
7640
  header?: never;
6345
7641
  path: {
6346
7642
  /** @description Agent Memory context id */
@@ -6355,7 +7651,7 @@ export interface operations {
6355
7651
  [name: string]: unknown;
6356
7652
  };
6357
7653
  content: {
6358
- "application/json": components["schemas"]["StateResponseJson"];
7654
+ "application/json": components["schemas"]["TraceStatsResponseJson"];
6359
7655
  };
6360
7656
  };
6361
7657
  /** @description Unauthorized */
@@ -6389,20 +7685,15 @@ export interface operations {
6389
7685
  };
6390
7686
  };
6391
7687
  };
6392
- list_traces: {
7688
+ get_trace: {
6393
7689
  parameters: {
6394
- query?: {
6395
- /** @description Max traces to return (default 100, max 500) */
6396
- limit?: number;
6397
- /** @description Continuation token from the previous page's `page.nextCursor` */
6398
- cursor?: string;
6399
- /** @description Also return `page.totalSize` (costs a full count of the visible traces) */
6400
- count?: boolean;
6401
- };
7690
+ query?: never;
6402
7691
  header?: never;
6403
7692
  path: {
6404
7693
  /** @description Agent Memory context id */
6405
7694
  context_id: string;
7695
+ /** @description Trace id */
7696
+ trace_id: string;
6406
7697
  };
6407
7698
  cookie?: never;
6408
7699
  };
@@ -6413,7 +7704,7 @@ export interface operations {
6413
7704
  [name: string]: unknown;
6414
7705
  };
6415
7706
  content: {
6416
- "application/json": components["schemas"]["TraceListResponseJson"];
7707
+ "application/json": components["schemas"]["TraceRecordJson"];
6417
7708
  };
6418
7709
  };
6419
7710
  /** @description Unauthorized */
@@ -6425,6 +7716,15 @@ export interface operations {
6425
7716
  "application/json": components["schemas"]["ApiErrorResponse"];
6426
7717
  };
6427
7718
  };
7719
+ /** @description Trace not found */
7720
+ 404: {
7721
+ headers: {
7722
+ [name: string]: unknown;
7723
+ };
7724
+ content: {
7725
+ "application/json": components["schemas"]["ApiErrorResponse"];
7726
+ };
7727
+ };
6428
7728
  /** @description Invalid context id */
6429
7729
  422: {
6430
7730
  headers: {
@@ -6447,9 +7747,20 @@ export interface operations {
6447
7747
  };
6448
7748
  };
6449
7749
  };
6450
- get_trace_stats: {
7750
+ list_uncertainty: {
6451
7751
  parameters: {
6452
- query?: never;
7752
+ query?: {
7753
+ /** @description Restrict to one subject, as `<type>/<name>` */
7754
+ entity?: string;
7755
+ /** @description Filter on settled state */
7756
+ resolved?: boolean;
7757
+ /** @description Max rows per page */
7758
+ limit?: number;
7759
+ /** @description Continuation token from `page.nextCursor` */
7760
+ cursor?: string;
7761
+ /** @description Also return `page.totalSize` */
7762
+ count?: boolean;
7763
+ };
6453
7764
  header?: never;
6454
7765
  path: {
6455
7766
  /** @description Agent Memory context id */
@@ -6464,7 +7775,16 @@ export interface operations {
6464
7775
  [name: string]: unknown;
6465
7776
  };
6466
7777
  content: {
6467
- "application/json": components["schemas"]["TraceStatsResponseJson"];
7778
+ "application/json": components["schemas"]["UncertaintyListResponseJson"];
7779
+ };
7780
+ };
7781
+ /** @description Invalid pagination parameter */
7782
+ 400: {
7783
+ headers: {
7784
+ [name: string]: unknown;
7785
+ };
7786
+ content: {
7787
+ "application/json": components["schemas"]["ApiErrorResponse"];
6468
7788
  };
6469
7789
  };
6470
7790
  /** @description Unauthorized */
@@ -6498,26 +7818,39 @@ export interface operations {
6498
7818
  };
6499
7819
  };
6500
7820
  };
6501
- get_trace: {
7821
+ resolve_uncertainty: {
6502
7822
  parameters: {
6503
7823
  query?: never;
6504
7824
  header?: never;
6505
7825
  path: {
6506
7826
  /** @description Agent Memory context id */
6507
7827
  context_id: string;
6508
- /** @description Trace id */
6509
- trace_id: string;
7828
+ /** @description Uncertainty record id fragment */
7829
+ uncertainty_id: string;
6510
7830
  };
6511
7831
  cookie?: never;
6512
7832
  };
6513
- requestBody?: never;
7833
+ requestBody: {
7834
+ content: {
7835
+ "application/json": components["schemas"]["ResolveUncertaintyRequestJson"];
7836
+ };
7837
+ };
6514
7838
  responses: {
6515
7839
  200: {
6516
7840
  headers: {
6517
7841
  [name: string]: unknown;
6518
7842
  };
6519
7843
  content: {
6520
- "application/json": components["schemas"]["TraceRecordJson"];
7844
+ "application/json": components["schemas"]["ResolveUncertaintyResponseJson"];
7845
+ };
7846
+ };
7847
+ /** @description `acceptedValue` or `note` carries content the Context's injection-scan policy refuses */
7848
+ 400: {
7849
+ headers: {
7850
+ [name: string]: unknown;
7851
+ };
7852
+ content: {
7853
+ "application/json": components["schemas"]["ApiErrorResponse"];
6521
7854
  };
6522
7855
  };
6523
7856
  /** @description Unauthorized */
@@ -6529,7 +7862,16 @@ export interface operations {
6529
7862
  "application/json": components["schemas"]["ApiErrorResponse"];
6530
7863
  };
6531
7864
  };
6532
- /** @description Trace not found */
7865
+ /** @description The `memory:write` grant is required, or the flag is scoped outside the caller's write region */
7866
+ 403: {
7867
+ headers: {
7868
+ [name: string]: unknown;
7869
+ };
7870
+ content: {
7871
+ "application/json": components["schemas"]["ApiErrorResponse"];
7872
+ };
7873
+ };
7874
+ /** @description Uncertainty not found */
6533
7875
  404: {
6534
7876
  headers: {
6535
7877
  [name: string]: unknown;
@@ -6538,7 +7880,7 @@ export interface operations {
6538
7880
  "application/json": components["schemas"]["ApiErrorResponse"];
6539
7881
  };
6540
7882
  };
6541
- /** @description Invalid context id */
7883
+ /** @description Invalid context id, or a flag with no subject */
6542
7884
  422: {
6543
7885
  headers: {
6544
7886
  [name: string]: unknown;
@@ -6781,6 +8123,38 @@ export declare const ScopeView: {
6781
8123
  readonly crossTeam: "crossTeam";
6782
8124
  };
6783
8125
  export type ScopeView = (typeof ScopeView)[keyof typeof ScopeView];
8126
+ /**
8127
+ * Ordering for the ranked entity head at `/entities/top`.
8128
+ *
8129
+ * `coverage` is most-known-about and the one ordering the entity listing cannot
8130
+ * express, but it costs an exact aggregate pass per fact family. `importance`
8131
+ * and `recency` are index-served single-table reads: prefer them where the
8132
+ * ranking need not be exact.
8133
+ */
8134
+ export declare const EntityRanking: {
8135
+ readonly coverage: "coverage";
8136
+ readonly importance: "importance";
8137
+ readonly recency: "recency";
8138
+ };
8139
+ export type EntityRanking = (typeof EntityRanking)[keyof typeof EntityRanking];
8140
+ /**
8141
+ * The sections `/lookup` can be asked to fill.
8142
+ *
8143
+ * Everything but `passages` is on by default, because `passages` costs a
8144
+ * retrieval pass. An omitted section comes back empty with `truncated` false:
8145
+ * it was declined, not cut short. Unknown names are ignored by the server.
8146
+ *
8147
+ * `entities` is absent deliberately — it is not selectable. The server fills it
8148
+ * for a topic answer and leaves it empty for an entity one.
8149
+ */
8150
+ export declare const LookupSection: {
8151
+ readonly facts: "facts";
8152
+ readonly relations: "relations";
8153
+ readonly events: "events";
8154
+ readonly passages: "passages";
8155
+ readonly uncertainty: "uncertainty";
8156
+ };
8157
+ export type LookupSection = (typeof LookupSection)[keyof typeof LookupSection];
6784
8158
  /** Document pipeline status values returned by the API. */
6785
8159
  export declare const DocumentStatus: {
6786
8160
  readonly queued: "queued";
@@ -6998,13 +8372,75 @@ export type EntityDetailJson = components["schemas"]["EntityDetailJson"];
6998
8372
  export type EntityListResponseJson = components["schemas"]["EntityListResponseJson"];
6999
8373
  export type EntityResponseJson = components["schemas"]["EntityResponseJson"];
7000
8374
  export type EntityHistoryResponseJson = components["schemas"]["EntityHistoryResponseJson"];
8375
+ export type EntityHistoryAllResponseJson = components["schemas"]["EntityHistoryAllResponseJson"];
8376
+ export type EntityTruncationJson = components["schemas"]["EntityTruncationJson"];
8377
+ export type EntitySearchResponseJson = components["schemas"]["EntitySearchResponseJson"];
8378
+ export type TopEntitiesResponseJson = components["schemas"]["TopEntitiesResponseJson"];
8379
+ export type EntityMatchJson = components["schemas"]["EntityMatchJson"];
8380
+ export type NeighbourJson = components["schemas"]["NeighbourJson"];
8381
+ export type NeighbourhoodResponseJson = components["schemas"]["NeighbourhoodResponseJson"];
7001
8382
  export type AttributeDetailJson = components["schemas"]["AttributeDetailJson"];
7002
- /** Entity records, attributes, relations, and attribute history. */
8383
+ /** The temporal filters the fact reads accept. */
8384
+ export interface TemporalOptions {
8385
+ /** Known-time: read the facts as they stood at this instant. */
8386
+ asOf?: string;
8387
+ /** Read through MVCC at this instant. */
8388
+ atInstant?: string;
8389
+ /** World-time lower bound. */
8390
+ validFrom?: string;
8391
+ /** World-time upper bound. */
8392
+ validUntil?: string;
8393
+ }
8394
+ /** Options for {@link Entities.get}. */
8395
+ export interface EntityGetOptions extends TemporalOptions {
8396
+ /**
8397
+ * Max rows per fact section (default 500, which is also the cap).
8398
+ *
8399
+ * Both sections are a bounded head, not the whole set: check
8400
+ * `truncated.attributes` / `truncated.relations` and walk the section's own
8401
+ * collection endpoint when either is set.
8402
+ */
8403
+ limit?: number;
8404
+ }
8405
+ /** Options for {@link Entities.search}. */
8406
+ export interface EntitySearchOptions {
8407
+ /** Restrict to one entity type. */
8408
+ type?: string;
8409
+ /** Max matches (default 10, capped by the server's list limit). */
8410
+ limit?: number;
8411
+ }
8412
+ /** Options for {@link Entities.top}. */
8413
+ export interface TopEntitiesOptions {
8414
+ /** Ordering. Defaults to `coverage`. */
8415
+ by?: EntityRanking | string;
8416
+ /** Restrict to one entity type. */
8417
+ type?: string;
8418
+ /** Max entities (default 10). */
8419
+ limit?: number;
8420
+ }
8421
+ /**
8422
+ * Options for {@link Entities.neighbours}.
8423
+ *
8424
+ * `count` and `minFacts` are an exclusive union because the server rejects the
8425
+ * pairing with a `400`: honouring the filter in a total would cost the
8426
+ * per-neighbour counts this walk exists to avoid. The invalid combination fails
8427
+ * to type-check rather than surfacing at runtime.
8428
+ */
8429
+ export type NeighbourhoodOptions = (PageOptions & {
8430
+ minFacts?: never;
8431
+ }) | (Omit<PageOptions, "count"> & {
8432
+ minFacts?: number;
8433
+ count?: never;
8434
+ });
8435
+ /** Options for {@link Entities.changes}. */
8436
+ export type EntityChangesOptions = PageOptions;
8437
+ /** Entity records, attributes, relations, name search, and attribute history. */
7003
8438
  export declare class Entities {
7004
8439
  private readonly transport;
7005
8440
  private readonly contextId;
7006
8441
  constructor(transport: Transport, contextId: string);
7007
8442
  private get base();
8443
+ private entityPath;
7008
8444
  /** Lists one page of entities, optionally filtered by type. */
7009
8445
  list(options?: PageOptions & {
7010
8446
  type?: string;
@@ -7023,13 +8459,198 @@ export declare class Entities {
7023
8459
  count(options?: {
7024
8460
  type?: string;
7025
8461
  }): Promise<number>;
7026
- /** Fetches a single entity by type and name, with its attributes and relations. */
7027
- get(entityType: string, name: string): Promise<EntityResponseJson>;
8462
+ /**
8463
+ * Searches entities by name, best match first (`GET /entities/search`).
8464
+ *
8465
+ * Lexical and deterministic: no model and no vector index in the path, so
8466
+ * an identical query returns identical rows in an identical order. An exact
8467
+ * match on the normalised identity name scores `1.0` and everything else
8468
+ * strictly below it, corpus-independently — a score means the same thing in
8469
+ * a context of ten entities and one of ten million.
8470
+ *
8471
+ * Each match carries its own `factCount` and a `distinguisher` drawn from
8472
+ * its highest-importance facts, so two same-named candidates can be told
8473
+ * apart without a request per candidate.
8474
+ *
8475
+ * This is a ranked head, not a walk: it is bounded by `limit` and offers no
8476
+ * cursor. Use {@link Entities.list} to enumerate the collection.
8477
+ */
8478
+ search(query: string, options?: EntitySearchOptions): Promise<EntityMatchJson[]>;
8479
+ /**
8480
+ * The entities worth starting from (`GET /entities/top`).
8481
+ *
8482
+ * `coverage` (the default) is most-known-about, the one ordering the entity
8483
+ * listing cannot express. It is exact rather than approximated, and costs
8484
+ * an aggregate pass per fact family: merging three separately-truncated
8485
+ * top-lists would mis-rank an entity that leads on relations and trails on
8486
+ * attributes. Prefer `importance` or `recency`, both index-served
8487
+ * single-table reads, where the ranking need not be exact.
8488
+ *
8489
+ * A ranked head, like {@link Entities.search}: bounded, with no cursor.
8490
+ */
8491
+ top(options?: TopEntitiesOptions): Promise<EntityMatchJson[]>;
8492
+ /**
8493
+ * Fetches a single entity with a bounded head of its attributes and
8494
+ * relations, newest first.
8495
+ *
8496
+ * Both fact sections are bounded by `limit` and report whether they were
8497
+ * cut in `truncated`. To read one in full, walk its own collection: the
8498
+ * attributes through `/attributes?entity=`, and the relations through
8499
+ * **both** `/relations?src=` and `/relations?dst=`, because the head
8500
+ * carries edges in either direction and one filter alone reproduces half of
8501
+ * it. All of them page by cursor in this same order, so the head is a
8502
+ * genuine prefix of the walk.
8503
+ */
8504
+ get(entityType: string, name: string, options?: EntityGetOptions): Promise<EntityResponseJson>;
8505
+ /**
8506
+ * One hop out from an entity (`GET /entities/{type}/{name}/neighbourhood`).
8507
+ *
8508
+ * Each neighbour carries its own `factCount`, so a relation chip is
8509
+ * navigable rather than decorative — without it a caller needs one request
8510
+ * per chip. Paginated over the edge's own `(createdAt, id)`, never the fact
8511
+ * count, which moves under ingest.
8512
+ *
8513
+ * `limit` is capped below the general list limit because each row costs
8514
+ * three correlated counts.
8515
+ */
8516
+ neighbours(entityType: string, name: string, options?: NeighbourhoodOptions): Promise<NeighbourhoodResponseJson>;
8517
+ /** Every neighbour of an entity, following cursors to exhaustion. */
8518
+ allNeighbours(entityType: string, name: string, options?: {
8519
+ minFacts?: number;
8520
+ limit?: number;
8521
+ max?: number;
8522
+ }): Promise<NeighbourJson[]>;
8523
+ /**
8524
+ * One page of every key's supersession chain for an entity, newest first
8525
+ * (`GET /entities/{type}/{name}/history`).
8526
+ *
8527
+ * Answers what changed about the subject. The per-key sibling,
8528
+ * {@link Entities.history}, answers how one value changed, and this cannot
8529
+ * be composed from it without a request per key. Superseded rows are
8530
+ * included — the chain is the point.
8531
+ */
8532
+ changes(entityType: string, name: string, options?: EntityChangesOptions): Promise<EntityHistoryAllResponseJson>;
8533
+ /**
8534
+ * The subject's whole change history, following cursors to exhaustion.
8535
+ *
8536
+ * Unbounded by construction: an attribute revised on every sync has an
8537
+ * unbounded chain. Pass `max` to stop the walk once that many rows are in
8538
+ * hand.
8539
+ */
8540
+ allChanges(entityType: string, name: string, options?: {
8541
+ limit?: number;
8542
+ max?: number;
8543
+ }): Promise<AttributeDetailJson[]>;
7028
8544
  /** Returns the supersession history for one attribute key. */
7029
8545
  history(entityType: string, name: string, key: string): Promise<AttributeDetailJson[]>;
7030
8546
  /** Soft-deletes an entity (sets valid-until). */
7031
8547
  delete(entityType: string, name: string): Promise<void>;
7032
8548
  }
8549
+ type AttributeDetailJson$1 = components["schemas"]["AttributeDetailJson"];
8550
+ export type AttributeListResponseJson = components["schemas"]["AttributeListResponseJson"];
8551
+ export type RelationDetailJson = components["schemas"]["RelationDetailJson"];
8552
+ export type RelationListResponseJson = components["schemas"]["RelationListResponseJson"];
8553
+ export type ActionDetailJson = components["schemas"]["ActionDetailJson"];
8554
+ export type ActionListResponseJson = components["schemas"]["ActionListResponseJson"];
8555
+ /** Filters `/attributes` accepts, beside its pagination parameters. */
8556
+ export interface AttributeFilters {
8557
+ /** One entity's attributes, as `<type>/<name>` (e.g. `person/alice`). */
8558
+ entity?: string;
8559
+ /** One attribute key. */
8560
+ key?: string;
8561
+ }
8562
+ /** Filters `/relations` accepts, beside its pagination parameters. */
8563
+ export interface RelationFilters {
8564
+ /** Subject entity, as `<type>/<name>`. */
8565
+ src?: string;
8566
+ /** Object entity, as `<type>/<name>`. */
8567
+ dst?: string;
8568
+ /** Relation label. */
8569
+ label?: string;
8570
+ }
8571
+ /** Filters `/actions` accepts, beside its pagination parameters. */
8572
+ export interface ActionFilters {
8573
+ /** Acting entity, as `<type>/<name>`. */
8574
+ actor?: string;
8575
+ /** Action verb. */
8576
+ verb?: string;
8577
+ /** Inclusive lower bound on `occurredAt`, as an RFC 3339 timestamp. */
8578
+ since?: string;
8579
+ /** Inclusive upper bound on `occurredAt`, as an RFC 3339 timestamp. */
8580
+ until?: string;
8581
+ }
8582
+ export type AttributeListOptions = AttributeFilters & PageOptions;
8583
+ export type RelationListOptions = RelationFilters & PageOptions;
8584
+ export type ActionListOptions = ActionFilters & PageOptions;
8585
+ /**
8586
+ * The fact collections, in the order the bounded reads present them.
8587
+ *
8588
+ * Every surface that returns a bounded head of facts — `entities.get`, the
8589
+ * `/inspect` entity ref, and each section of `client.lookup` — reports
8590
+ * `truncated` and points here for the rest. These listings page by cursor in
8591
+ * the same newest-first order, so a truncated head is a genuine prefix of the
8592
+ * walk rather than a separate ranking.
8593
+ */
8594
+ export declare class Facts {
8595
+ private readonly transport;
8596
+ private readonly contextId;
8597
+ constructor(transport: Transport, contextId: string);
8598
+ private get base();
8599
+ /**
8600
+ * Lists one page of live attributes, newest first (`GET /attributes`).
8601
+ *
8602
+ * Live means not superseded and inside its validity window. Superseded
8603
+ * values are reachable through the entity history endpoints.
8604
+ */
8605
+ attributes(options?: AttributeListOptions): Promise<AttributeListResponseJson>;
8606
+ /** Every matching attribute, following cursors to exhaustion. */
8607
+ allAttributes(options?: AttributeFilters & {
8608
+ limit?: number;
8609
+ max?: number;
8610
+ }): Promise<AttributeDetailJson$1[]>;
8611
+ /**
8612
+ * Lists one page of live relation edges, newest first (`GET /relations`).
8613
+ *
8614
+ * `src` and `dst` filter one direction each. An entity's whole edge set is
8615
+ * the union of both walks — see {@link Facts.allEdgesOf}, which does that
8616
+ * for you.
8617
+ */
8618
+ relations(options?: RelationListOptions): Promise<RelationListResponseJson>;
8619
+ /** Every matching relation, following cursors to exhaustion. */
8620
+ allRelations(options?: RelationFilters & {
8621
+ limit?: number;
8622
+ max?: number;
8623
+ }): Promise<RelationDetailJson[]>;
8624
+ /**
8625
+ * Every edge touching an entity, in both directions.
8626
+ *
8627
+ * This is what a truncated relation section points at. `src` and `dst` are
8628
+ * separate filters, so either walk alone reproduces half the set that
8629
+ * `entities.get` and `lookup` return; this runs both and concatenates them,
8630
+ * outbound first.
8631
+ *
8632
+ * @param entity The subject, as `<type>/<name>`.
8633
+ */
8634
+ allEdgesOf(entity: string, options?: {
8635
+ label?: string;
8636
+ limit?: number;
8637
+ }): Promise<RelationDetailJson[]>;
8638
+ /**
8639
+ * Lists one page of live actions — dated events — newest first by write
8640
+ * time (`GET /actions`).
8641
+ *
8642
+ * Ordered on write time rather than event time because event time is
8643
+ * revisable, and a revision under an event-time ordering would move a row
8644
+ * across page boundaries mid-walk. `since` and `until` still bound the
8645
+ * event time.
8646
+ */
8647
+ actions(options?: ActionListOptions): Promise<ActionListResponseJson>;
8648
+ /** Every matching action, following cursors to exhaustion. */
8649
+ allActions(options?: ActionFilters & {
8650
+ limit?: number;
8651
+ max?: number;
8652
+ }): Promise<ActionDetailJson[]>;
8653
+ }
7033
8654
  export type KeyListResponseJson = components["schemas"]["KeyListResponseJson"];
7034
8655
  /**
7035
8656
  * A freshly minted (or rotated) self-service key. `key` is the full bearer
@@ -7240,6 +8861,80 @@ export declare class Traces {
7240
8861
  /** Aggregate trace statistics over the recent window. */
7241
8862
  stats(): Promise<TraceStatsResponseJson>;
7242
8863
  }
8864
+ export type UncertaintyJson = components["schemas"]["UncertaintyJson"];
8865
+ export type UncertaintyListResponseJson = components["schemas"]["UncertaintyListResponseJson"];
8866
+ export type ResolveUncertaintyResponseJson = components["schemas"]["ResolveUncertaintyResponseJson"];
8867
+ /** Filters and pagination for {@link Uncertainty.list}. */
8868
+ export interface UncertaintyListOptions extends PageOptions {
8869
+ /** Restrict to one subject, as `<type>/<name>`. */
8870
+ entity?: string;
8871
+ /**
8872
+ * Filter on settled state. Unset returns both, so pass `false` for the
8873
+ * open flags.
8874
+ */
8875
+ resolved?: boolean;
8876
+ }
8877
+ /** Options for {@link Uncertainty.resolve}. */
8878
+ export interface ResolveUncertaintyOptions {
8879
+ /**
8880
+ * Why this value was chosen, persisted as the new row's source clause so
8881
+ * the fact reads as an operator decision rather than an unexplained
8882
+ * high-trust assertion.
8883
+ *
8884
+ * Stored normalised and capped, like the value itself — a later read
8885
+ * returns that form, not the string as sent.
8886
+ */
8887
+ note?: string;
8888
+ }
8889
+ /**
8890
+ * The things this context is unsure about, and the one write that settles one.
8891
+ *
8892
+ * `/state` collapses these to `{about, reason}`, which is enough to say
8893
+ * something is unresolved and not enough to act on it. These rows carry the
8894
+ * subject, so a flag can be linked to the entity it is about and settled.
8895
+ */
8896
+ export declare class Uncertainty {
8897
+ private readonly transport;
8898
+ private readonly contextId;
8899
+ constructor(transport: Transport, contextId: string);
8900
+ private get base();
8901
+ /** Lists one page of uncertainty flags, newest first (`GET /uncertainty`). */
8902
+ list(options?: UncertaintyListOptions): Promise<UncertaintyListResponseJson>;
8903
+ /** Every matching flag, following cursors to exhaustion. */
8904
+ listAll(options?: Omit<UncertaintyListOptions, "cursor" | "count">): Promise<UncertaintyJson[]>;
8905
+ /**
8906
+ * How many flags match, without fetching them.
8907
+ *
8908
+ * Asks for a single row with `count: true`, so the total is the only thing
8909
+ * paid for beyond one page bound.
8910
+ */
8911
+ count(options?: {
8912
+ entity?: string;
8913
+ resolved?: boolean;
8914
+ }): Promise<number>;
8915
+ /**
8916
+ * Settles a flag by accepting one value
8917
+ * (`POST /uncertainty/{id}/resolve`). Requires the `memory:write` grant.
8918
+ *
8919
+ * One call, three effects: the flag is claimed, `acceptedValue` is written
8920
+ * through the reconciler at the upsert trust prior, and the values it beats
8921
+ * are retired. The accepted value lands at the flag's own scope rather than
8922
+ * the caller's write anchors, because it has to replace the contenders
8923
+ * where they live.
8924
+ *
8925
+ * Settlement converges on retry rather than being transactional: a failure
8926
+ * after the value is written hands the flag back and reports it, and
8927
+ * repeating the call dedups the value and finishes the retirement.
8928
+ *
8929
+ * Only the two reconciler-raised kinds — a cross-provenance contradiction
8930
+ * and a confidence-floor hold — record the entity and key a written value
8931
+ * would need. A flag without one is refused with a `422`, so check
8932
+ * `resolvable` on the row before offering the action; it also accounts for
8933
+ * an already-settled flag and for one whose scope reaches beyond the
8934
+ * calling key's write region.
8935
+ */
8936
+ resolve(uncertaintyId: string, acceptedValue: string, options?: ResolveUncertaintyOptions): Promise<UncertaintyJson>;
8937
+ }
7243
8938
  type CitationJson = components["schemas"]["CitationJson"];
7244
8939
  type ExtractionResultJson = components["schemas"]["ExtractionResultJson"];
7245
8940
  /** One incremental frame from a streaming `chat` call. */
@@ -7302,6 +8997,9 @@ export type ConsolidateResponseJson = components["schemas"]["ConsolidateResponse
7302
8997
  export type ElaborateResponseJson = components["schemas"]["ElaborateResponseJson"];
7303
8998
  export type FsckReportJson = components["schemas"]["FsckReportJson"];
7304
8999
  export type InspectResponseJson = components["schemas"]["InspectResponseJson"];
9000
+ export type LookupResponseJson = components["schemas"]["LookupResponseJson"];
9001
+ export type ResolutionJson = components["schemas"]["ResolutionJson"];
9002
+ export type CoverageJson = components["schemas"]["CoverageJson"];
7305
9003
  export type AuditResponseJson = components["schemas"]["AuditResponseJson"];
7306
9004
  export type AuditRowJson = components["schemas"]["AuditRowJson"];
7307
9005
  export type StateResponseJson = components["schemas"]["StateResponseJson"];
@@ -7396,6 +9094,42 @@ export interface RecallOptions {
7396
9094
  /** Geographic filter applied at read time. */
7397
9095
  location?: GeoFilterJson;
7398
9096
  }
9097
+ /** Options for {@link AgentMemory.lookup}. */
9098
+ export interface LookupOptions {
9099
+ /**
9100
+ * Skip resolution and answer about this subject directly, as
9101
+ * `<type>/<name>`.
9102
+ *
9103
+ * This is what makes walking a trail cheap: a hop already knows which
9104
+ * entity it landed on, so re-resolving its name would be both wasted work
9105
+ * and a chance to land somewhere else.
9106
+ */
9107
+ subject?: string;
9108
+ /** Restrict resolution to one entity type. */
9109
+ entityType?: string;
9110
+ /**
9111
+ * How far the top candidate must beat the runner-up for the answer to be
9112
+ * one entity rather than a choice between several. Defaults to `0.15`.
9113
+ */
9114
+ ambiguityMargin?: number;
9115
+ /**
9116
+ * Which sections to fill. Everything but `passages` by default.
9117
+ *
9118
+ * An omitted section comes back empty with `truncated` false: it was
9119
+ * declined, not cut short, so it points at no walk.
9120
+ */
9121
+ include?: (LookupSection | string)[];
9122
+ /** Max facts in the `facts` section. */
9123
+ factLimit?: number;
9124
+ /** Max edges in the `relations` section. */
9125
+ relationLimit?: number;
9126
+ /** Max events in the `events` section. */
9127
+ eventLimit?: number;
9128
+ /** Max passages in the `passages` section. */
9129
+ passageLimit?: number;
9130
+ /** Max flags in the `uncertainty` section. */
9131
+ uncertaintyLimit?: number;
9132
+ }
7399
9133
  /** Options for {@link AgentMemory.chat}. */
7400
9134
  export interface ChatOptions {
7401
9135
  /** Session to attach the conversation to. */
@@ -7449,8 +9183,12 @@ export declare class AgentMemory {
7449
9183
  readonly contextId: string;
7450
9184
  /** Document ingestion, retrieval, corpus search, and the keyword graph. */
7451
9185
  readonly documents: Documents;
7452
- /** Entity records, attributes, relations, and attribute history. */
9186
+ /** Entity records, attributes, relations, name search, and attribute history. */
7453
9187
  readonly entities: Entities;
9188
+ /** The attribute, relation, and action collections a bounded head points at. */
9189
+ readonly facts: Facts;
9190
+ /** Things the context is unsure about, and the write that settles one. */
9191
+ readonly uncertainty: Uncertainty;
7454
9192
  /** Conversation sessions for this context. */
7455
9193
  readonly sessions: Sessions;
7456
9194
  /** Expiry and decay sweeps. */
@@ -7503,12 +9241,48 @@ export declare class AgentMemory {
7503
9241
  chat(message: string, options: ChatOptions & {
7504
9242
  stream: true;
7505
9243
  }): Promise<AsyncGenerator<ChatChunk>>;
9244
+ /**
9245
+ * What this context knows about a subject, in one round trip
9246
+ * (`POST /lookup`).
9247
+ *
9248
+ * Everything returned is a stored row: nothing is generated, nothing is
9249
+ * summarised by a model, and an identical query returns an identical
9250
+ * answer. Branch on `resolution.kind` — `entity`, `topic`, `ambiguous`,
9251
+ * `empty` — rather than inferring which case you got from an array length.
9252
+ *
9253
+ * This is a composite aggregate like {@link AgentMemory.state}, not a
9254
+ * collection: every section is bounded and reports `truncated`, and none of
9255
+ * them page. To read a section in full, walk its own collection endpoint —
9256
+ * facts through `/attributes?entity=`, relations through **both**
9257
+ * `/relations?src=` and `/relations?dst=`, events through
9258
+ * `/actions?actor=`, passages through {@link AgentMemory.recall}, and
9259
+ * unknowns through {@link AgentMemory.uncertainty}. Note that `facts` is
9260
+ * ranked by importance while its collection pages in write order: the
9261
+ * ranked head is a different question from the walk, not its first page.
9262
+ *
9263
+ * Facts carry their source, trust and confidence but not the quoted
9264
+ * evidence text — a fact is one line until asked, and expanding one is a
9265
+ * passage read.
9266
+ */
9267
+ lookup(query: string, options?: LookupOptions): Promise<LookupResponseJson>;
7506
9268
  /** Retrieves LLM-facing context text for a query without a session (`POST /context`). */
7507
9269
  context(query: string, options?: {
7508
9270
  k?: number;
7509
9271
  labels?: string[];
7510
9272
  lens?: Scope;
7511
9273
  scopeView?: ScopeView | string;
9274
+ /**
9275
+ * Render one subject's answer rather than the query's hits, as
9276
+ * `<type>/<name>`.
9277
+ *
9278
+ * This is the copy-as-context export: the fact half of the block
9279
+ * becomes this entity's own attributes, relations and events, which
9280
+ * is what a reader pastes into a prompt after looking a subject up.
9281
+ * `query` still selects the passages — the only thing retrieval
9282
+ * contributes in this mode — and `lens`, `labels` and `scopeView`
9283
+ * filter the subject's facts exactly as they filter those passages.
9284
+ */
9285
+ subject?: string;
7512
9286
  }): Promise<ContextQueryResponseJson>;
7513
9287
  /** Runs a reflection pass; may persist attributes when `persist` is true (`POST /reflect`). */
7514
9288
  reflect(query: string, options?: {
@@ -7534,12 +9308,7 @@ export declare class AgentMemory {
7534
9308
  maxResults?: number;
7535
9309
  }): Promise<FsckReportJson>;
7536
9310
  /** Inspects an entity, attribute, or trace by reference (`GET /inspect`). */
7537
- inspect(ref: string, options?: {
7538
- asOf?: string;
7539
- atInstant?: string;
7540
- validFrom?: string;
7541
- validUntil?: string;
7542
- }): Promise<InspectResponseJson>;
9311
+ inspect(ref: string, options?: TemporalOptions): Promise<InspectResponseJson>;
7543
9312
  /** Lists one page of audit rows for write/recall activity (`GET /audit`). */
7544
9313
  audit(options?: AuditOptions): Promise<AuditResponseJson>;
7545
9314
  /** Every matching audit row, following cursors to exhaustion. */
@@ -7551,11 +9320,13 @@ export declare class AgentMemory {
7551
9320
  * bounded by `limit` (default 100, max 500), and `truncated` reports which
7552
9321
  * of them had more rows.
7553
9322
  *
7554
- * Four of those tables have their own collection endpoint to enumerate them
9323
+ * Five of those tables have their own collection endpoint to enumerate them
7555
9324
  * completely — entities (see {@link AgentMemory.entities}), attributes,
7556
- * relations, and actions. The remaining two, `instructions` and `unknowns`,
7557
- * have no such route: when `truncated` flags either, the omitted rows cannot
7558
- * be recovered other than by raising `limit`.
9325
+ * relations, actions, and `unknowns` (see
9326
+ * {@link AgentMemory.uncertainty}, which also returns the subject each flag
9327
+ * is about, where this snapshot collapses it to `{about, reason}`). Only
9328
+ * `instructions` has no such route: when `truncated` flags it, the omitted
9329
+ * rows cannot be recovered other than by raising `limit`.
7559
9330
  */
7560
9331
  state(options?: {
7561
9332
  limit?: number;