@littlebigbrain/client 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,129 +1,144 @@
1
1
  # @littlebigbrain/client
2
2
 
3
- The typed TypeScript client for [Little Big Brain](https://littlebigbrain.com) — write graph facts and query one immutable published snapshot. Request and response types are generated from the API contract, so every call is fully typed. Runs anywhere there's a global `fetch`: Node 18+, browsers, and edge workers.
3
+ TypeScript client for [little big brain](https://littlebigbrain.com), a search
4
+ platform for AI applications such as chatbots, search tools, and agents.
5
+ Load facts, query their relationships, and keep the data version behind an answer
6
+ so you can check it later.
7
+
8
+ The client has no runtime dependencies and includes generated request and response
9
+ types. It uses `fetch` and supports Node.js 18+, browsers, and edge workers.
10
+ Keep stack API keys on your server or local machine, outside browser bundles.
11
+
12
+ [Documentation](https://docs.littlebigbrain.com/sdks/typescript/) ·
13
+ [Quickstart](https://docs.littlebigbrain.com/start/quickstart/) ·
14
+ [Issues](https://github.com/littlebigbrains/lbb-typescript/issues)
15
+
16
+ ## Install
4
17
 
5
18
  ```sh
6
19
  npm install @littlebigbrain/client
7
20
  ```
8
21
 
9
- ## Quickstart
22
+ ## Load facts and run a query
23
+
24
+ Create a stack in the [console](https://cloud.littlebigbrain.com) and open
25
+ **Connect**. Copy its complete endpoint and a stack API key:
26
+
27
+ ```sh
28
+ export LBB_URL="https://<your-complete-stack-host>"
29
+ export LBB_API_KEY="<your-stack-api-key>"
30
+ ```
31
+
32
+ This example creates a graph named `quickstart` on its first write. It stores
33
+ three facts: a service writes to a database, and each has a label. The data uses
34
+ Resource Description Framework (RDF), where each line names a subject, a
35
+ relationship, and a value or another record. SPARQL is the query language for
36
+ those facts.
37
+
38
+ Save as `quickstart.mts`, then run `npx tsx quickstart.mts`:
10
39
 
11
40
  ```ts
12
41
  import { LbbClient } from "@littlebigbrain/client";
13
42
 
14
43
  const lbb = new LbbClient({
15
- baseUrl: "https://0abc1def--production.db.eu.littlebigbrain.com",
16
- apiKey: process.env.LBB_API_KEY, // lbb_sk_live_… — keep it server-side
44
+ baseUrl: process.env.LBB_URL!,
45
+ apiKey: process.env.LBB_API_KEY!,
46
+ graph: "quickstart",
17
47
  });
18
- const graph = lbb.graph("main");
19
-
20
- // 1. Write a fact.
21
- await graph.facts.create(
22
- {
23
- triplets: [
24
- {
25
- source: { type: "CONCEPT", name: "policy-42" },
26
- relation: "RELATED_TO",
27
- target: { type: "CONCEPT", name: "seven-year retention" },
28
- evidence: "Customer records are retained for seven years.",
29
- },
30
- ],
31
- },
32
- { idempotencyKey: "policy-42-v1" },
33
- );
34
48
 
35
- // 2. Publication is automatic. Inspect one coherent watermark when needed.
36
- const published = await lbb.readSnapshot();
37
- console.log(published.snapshot.served_at_seq, published.query_lag_commits);
49
+ const facts = `
50
+ <https://example.org/auth-service> <https://example.org/writesTo> <https://example.org/user-db> .
51
+ <https://example.org/auth-service> <http://www.w3.org/2000/01/rdf-schema#label> "Auth Service" .
52
+ <https://example.org/user-db> <http://www.w3.org/2000/01/rdf-schema#label> "User Database" .
53
+ `;
38
54
 
39
- // 3. Query the snapshot with SPARQL.
40
- const rows = await lbb.sparqlRows({
41
- query: "SELECT ?s ?o WHERE { ?s <policy:retention> ?o } LIMIT 10",
55
+ const imported = await lbb.graph("quickstart").facts.importRdf(facts, {
56
+ format: "ntriples",
57
+ idempotencyKey: "sdk-quickstart-v1",
42
58
  });
43
- ```
44
-
45
- For hosted use, `baseUrl` is required and must be the exact `endpoint_url`
46
- shown on the stack's Connect page. Graph and branch remain client scope
47
- parameters; they are not encoded in the hostname.
48
-
49
- ## Examples
50
-
51
- **Bulk import.** Load an array of records (or an NDJSON string) in one call:
52
-
53
- ```ts
54
- await graph.facts.import(
55
- [
56
- { source: { type: "DOC", name: "handbook", key: "doc:42" }, relation: "HAS_PASSAGE", target: { type: "PASSAGE", name: "leave-policy", key: "p:42:1" } },
57
- // …one record per line
58
- ],
59
- { idempotencyKey: "handbook-batch-1" },
59
+ const commitSeq = imported.committed_commit_seq;
60
+ if (commitSeq == null) throw new Error("The import did not return a commit sequence.");
61
+
62
+ const query = `
63
+ SELECT ?service ?database WHERE {
64
+ ?s <https://example.org/writesTo> ?db .
65
+ ?s <http://www.w3.org/2000/01/rdf-schema#label> ?service .
66
+ ?db <http://www.w3.org/2000/01/rdf-schema#label> ?database .
67
+ } ORDER BY ?service ?database LIMIT 10
68
+ `;
69
+
70
+ const { rows } = await lbb.sparqlRows(
71
+ { query },
72
+ { consistency: "strong", minIndexedSeq: commitSeq },
60
73
  );
74
+
75
+ for (const row of rows) console.log(`${row.service} -> ${row.database}`);
61
76
  ```
62
77
 
63
- For large or long-running loads, stream records to a durable job instead:
78
+ On a fresh graph, this prints:
64
79
 
65
- ```ts
66
- const accepted = await lbb.submitImport(records(), {
67
- idempotencyKey: "hubspot:portal-42:run-2026-07-29",
68
- });
69
- const completed = await lbb.waitForImportJob(accepted.job_id);
70
- console.log(completed.state, completed.committed_commit_seq);
80
+ ```text
81
+ Auth Service -> User Database
71
82
  ```
72
83
 
73
- `records()` may be an iterable or async iterable. Success means every grouped
74
- commit is durable and immediately queryable by a strong SPARQL read. The same
75
- commits advance the graph's coalesced RDF reconciliation fence; waiting for base
76
- compaction is optional. An empty iterable is rejected locally before an import
77
- POST is sent.
84
+ The query follows the stored relationship between the service and database.
85
+ `consistency: "strong"` makes the new facts available to this read without
86
+ waiting for a background index job. Reads default to eventual consistency, so
87
+ omit this option only when an earlier version is acceptable.
88
+
89
+ The idempotency key makes repeating the same import safe. Use a new key if you
90
+ change the data.
78
91
 
79
- For several RDF documents, `facts.importRdfMany(...)` automatically defers
80
- intermediate reconciliation and triggers it on the last document. Call
81
- `graph.waitForPublished(result.finalSequence)` only when the caller needs the
82
- immutable base itself to cover the import; strong reads need no waiter.
92
+ ## Read the same version again
83
93
 
84
- **Time-travel read.** Pin a SPARQL read to a past instant — results reflect the graph as it was then:
94
+ Run the query at the commit returned by the import:
85
95
 
86
96
  ```ts
87
- const asOf = await lbb.sparqlRows({
88
- query: "SELECT ?s ?o WHERE { ?s <policy:retention> ?o }",
89
- as_of_valid_time: "2026-01-01T00:00:00Z",
97
+ const replay = await lbb.sparqlRows({
98
+ query,
99
+ as_of_commit_seq: commitSeq,
90
100
  });
101
+ console.log(replay.rows);
91
102
  ```
92
103
 
93
- **SPARQL.** `sparqlRows` runs a SPARQL 1.1 SELECT/ASK and returns parsed rows:
104
+ Save the query, its options, and the commit sequence with any answer you need to
105
+ check later. See [history and replay](https://docs.littlebigbrain.com/guides/time-travel-audit/)
106
+ for retention and evidence handling.
94
107
 
95
- ```ts
96
- const { rows } = await lbb.sparqlRows({
97
- query: `SELECT ?doc WHERE { ?doc ?p ?o } LIMIT 10`,
98
- });
99
- ```
108
+ ## Next steps
109
+
110
+ - [Search by meaning](https://docs.littlebigbrain.com/guides/search-by-meaning/): choose which facts to embed and find records from a text description.
111
+ - [Load your own RDF](https://docs.littlebigbrain.com/guides/load-rdf/): import Turtle, N-Triples, N-Quads, or TriG.
112
+ - [Work with JSON records](https://docs.littlebigbrain.com/guides/without-rdf/): define a schema and write records without writing RDF.
113
+ - [Validate writes](https://docs.littlebigbrain.com/guides/sparql-and-shacl/): define constraints with the Shapes Constraint Language (SHACL).
100
114
 
101
- ## Errors & retries
115
+ The RDF and JSON guides use different write workflows. Choose one when creating
116
+ a graph; a graph first written through RDF import does not accept
117
+ `facts.create` or JSON record imports.
102
118
 
103
- Methods return parsed JSON and throw `LbbError` (with `status`, `code`, `message`, `param`, `requestId`, `docUrl`) on any non-2xx response. Safe reads and idempotency-keyed writes retry `429`/`5xx` and network failures with full-jitter backoff, bounded by a retry budget (`retryBudgetMs`, default 60s) rather than a fixed count, and honor `Retry-After` — a terminal error the server marks non-retryable surfaces immediately. Use `rawRequest()` for response headers, request id, and retry/timing metadata.
104
- `waitForPublished(...)` is an optional, deadline-bounded maintenance poller for
105
- workflows that want the immutable RDF base itself to cover a commit. Strong
106
- SPARQL does not need it: acknowledged commits are queryable immediately from
107
- the branch head's base-plus-delta lineage.
119
+ ## Errors and retries
108
120
 
109
- ## More
121
+ Failed HTTP requests throw `LbbError`, with a status, error code, message, and
122
+ request ID. Use `rawRequest()` when you also need response headers or timing.
110
123
 
111
- The `graph(...)` scope exposes `facts`, `entities`, `ontology`, `query`,
112
- `search` (feedback surfaces), and `schema` namespaces. `query` runs SPARQL,
113
- the one query language on the API; `schema`
114
- reads or atomically publishes the active ontology/shapes bundle. Writes enqueue
115
- published-generation maintenance automatically. Every generated shape is
116
- available as `Schemas["TypeName"]`. Retired request-time JSON SHACL DTOs are
117
- intentionally absent: publish RDF shapes with `schema.publish`, then read
118
- `ontology.conformance`.
124
+ Safe reads and writes with an idempotency key retry rate limits, retryable server
125
+ errors, and network failures. Retries respect `Retry-After` and use a 60-second
126
+ budget by default. See the [client reference](https://docs.littlebigbrain.com/sdks/typescript/)
127
+ for timeout and retry options.
119
128
 
120
- Full reference and guides: [docs.littlebigbrain.com/sdks/typescript](https://docs.littlebigbrain.com/sdks/typescript/).
129
+ ## Development
121
130
 
122
- ## Develop
131
+ From a clone of this repository:
123
132
 
124
133
  ```sh
125
- npm install
126
- npm run generate # regenerate types from contracts/openapi.json
134
+ npm ci
127
135
  npm run typecheck
128
136
  npm test
129
137
  ```
138
+
139
+ The request and response types are generated from the API contract. See
140
+ [CONTRIBUTING.md](CONTRIBUTING.md) for changes to generated types.
141
+
142
+ ## License
143
+
144
+ [Apache-2.0](LICENSE).
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { DurableImportSource, ImportLine, LbbClientOptions, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportDocument, RdfImportManyResult, RdfImportOptions, Schemas, SearchConsistency, SparqlResults } from "./types.js";
2
2
  import { type CallOptions, type RequestOptions } from "./transport.js";
3
- import { EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace } from "./namespaces.js";
3
+ import { EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, EvalsNamespace, EmbeddingsNamespace } from "./namespaces.js";
4
4
  export { parseSparqlResults } from "./types.js";
5
5
  export type { AttributeFilter, AttributeFilterOp, AttributeFilterValue, EntityAttributeFilterOptions, EntityPropertiesLine, DurableImportLine, DurableImportSource, FetchLike, FlatProperties, ImportLine, LbbClientOptions, LbbRequestEvent, LbbResponseEvent, LbbRetryEvent, LbbErrorPayload, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportDocument, RdfImportManyResult, RdfImportOptions, Schemas, SearchConsistency, SparqlResults, SparqlResultsJson, SparqlTerm, CommitRequest, CommitResponse, Entity, EntitySelector, GraphMetadata, GraphSummary, SchemaView, Snapshot, } from "./types.js";
6
6
  export { LbbCapabilityError, LbbError } from "./transport.js";
@@ -8,14 +8,13 @@ export type { CallOptions, Query, QueryValue, RequestOptions, } from "./transpor
8
8
  export { EntityNamespace, FactsNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
9
9
  /**
10
10
  * A typed HTTP client for a little big brain graph server. One instance is scoped to a
11
- * single graph/branch; construct another for a different scope. All methods
11
+ * single graph; construct another for a different scope. All methods
12
12
  * return the parsed JSON response and throw {@link LbbError} on failure.
13
13
  */
14
14
  export declare class LbbClient {
15
15
  private readonly baseUrl;
16
16
  private readonly apiKey?;
17
17
  private readonly graphName?;
18
- private readonly branchName?;
19
18
  private readonly stack?;
20
19
  private readonly fetchImpl;
21
20
  private readonly apiVersion;
@@ -34,19 +33,19 @@ export declare class LbbClient {
34
33
  readonly schema: SchemaNamespace;
35
34
  readonly ontology: OntologyNamespace;
36
35
  readonly query: QueryNamespace;
36
+ readonly evals: EvalsNamespace;
37
+ readonly embeddings: EmbeddingsNamespace;
37
38
  constructor(options: LbbClientOptions);
38
39
  graph(name: string, opts?: {
39
- branch?: string;
40
40
  stack?: string;
41
41
  }): GraphNamespace;
42
42
  /**
43
- * A new client for a different graph/branch on the same server and credential.
44
- * Each instance is scoped to one graph/branch, so use this to target another
43
+ * A new client for a different graph on the same server and credential.
44
+ * Each instance is scoped to one graph, so use this to target another
45
45
  * scope (e.g. creating a fresh graph) without mutating the current client.
46
46
  */
47
47
  withScope(scope: {
48
48
  graph?: string;
49
- branch?: string;
50
49
  stack?: string;
51
50
  }): LbbClient;
52
51
  /**
@@ -140,8 +139,8 @@ export declare class LbbClient {
140
139
  idempotencyKey?: string;
141
140
  }): Promise<Schemas["GraphRetractResponse"]>;
142
141
  /**
143
- * Create the scoped graph/branch with an empty ontology. Construct the client
144
- * with the desired graph/branch first, then call `ontology.define` before
142
+ * Create the scoped graph with an empty ontology. Construct the client
143
+ * with the desired graph first, then call `ontology.define` before
145
144
  * writing typed data.
146
145
  */
147
146
  createGraph(): Promise<Schemas["CreateGraphResponse"]>;
@@ -181,33 +180,10 @@ export declare class LbbClient {
181
180
  observedAt?: string;
182
181
  idempotencyKey?: string;
183
182
  }): Promise<Schemas["GraphReloadResponse"]>;
184
- /** Fork the scoped branch from an existing branch in the same graph. */
185
- createBranch(body: Schemas["GraphBranchCreateRequest"]): Promise<Schemas["GraphBranchCreateResponse"]>;
186
- /**
187
- * Validate-then-merge: replay `from_branch`'s post-fork commits onto the
188
- * SCOPED branch (its fork parent) as one new commit. A write — sends an
189
- * Idempotency-Key so a retry replays instead of re-applying.
190
- */
191
- mergeBranch(body: Schemas["GraphBranchMergeRequest"], opts?: {
192
- idempotencyKey?: string;
193
- }): Promise<Schemas["GraphBranchMergeResponse"]>;
194
- /**
195
- * Observe: store a conversation episode verbatim as EPISODE evidence,
196
- * anchor + gate extracted facts on an observe branch, and optionally
197
- * auto-merge when validation is clean. Flag-gated server-side
198
- * (`--enable-observe`). A write — carries an Idempotency-Key.
199
- */
200
- observe(body: Schemas["ObserveRequest"], opts?: {
201
- idempotencyKey?: string;
202
- }): Promise<Schemas["ObserveResponse"]>;
203
- /** Delete the scoped graph, including every branch, feedback, and active graph-scoped job. */
183
+ /** Delete the scoped graph, including its feedback and active graph-scoped jobs. */
204
184
  deleteGraph(opts: {
205
185
  confirm: string;
206
186
  }): Promise<Schemas["GraphDeleteResponse"]>;
207
- /** Delete only the scoped branch. The server refuses to delete a graph's final live branch. */
208
- deleteBranch(opts: {
209
- confirm: string;
210
- }): Promise<Schemas["GraphBranchDeleteResponse"]>;
211
187
  /**
212
188
  * Captured signals by flush-seq range, oldest first — the model-training
213
189
  * feed. The `seq` on each signal is the temporal-split coordinate (train ≤ T,
@@ -283,16 +259,6 @@ export declare class LbbClient {
283
259
  externalPlannerTrace(payload: Schemas["ExternalPlannerTraceV1"], opts?: {
284
260
  idempotencyKey?: string;
285
261
  }): Promise<Schemas["SignalIngestResponse"]>;
286
- /** Planner training examples at or before an optional signal split. */
287
- plannerDataset(opts?: {
288
- limit?: number;
289
- splitSeq?: number;
290
- }): Promise<Schemas["PlannerDatasetResponse"]>;
291
- /** Planner preference pairs at or before an optional signal split. */
292
- plannerPreferenceDataset(opts?: {
293
- limit?: number;
294
- splitSeq?: number;
295
- }): Promise<Schemas["PlannerPreferenceDatasetResponse"]>;
296
262
  /** Suggest-ranker examples at or before an optional signal split. */
297
263
  suggestDataset(opts?: {
298
264
  limit?: number;
@@ -312,14 +278,6 @@ export declare class LbbClient {
312
278
  runId: string;
313
279
  allowRegression?: boolean;
314
280
  }): Promise<unknown>;
315
- /**
316
- * Promote a finished `planner_lora` training run: gated on held-out slot
317
- * exactness and recorded as a `kind=planner` training run.
318
- */
319
- promotePlanner(opts: {
320
- runId: string;
321
- allowRegression?: boolean;
322
- }): Promise<unknown>;
323
281
  /**
324
282
  * Append relevance labels for a set of ranked results — how little big brain
325
283
  * gathers customer-specific qrels. Grade results (3 ideal/good, 1 partial,
@@ -467,6 +425,9 @@ export declare class LbbClient {
467
425
  }): Promise<Schemas["GraphMetadataResponse"]>;
468
426
  /** Automatic publication lifecycle, available before the first generation exists. */
469
427
  publicationStatus(): Promise<Schemas["PublicationStatusResponse"]>;
428
+ /** The managed models the platform uses per role (embedding, judge,
429
+ * rewriter): the operator's catalog, or the compiled defaults. */
430
+ managedModels(): Promise<Schemas["ManagedModelsResponse"]>;
470
431
  /** Wait until background reconciliation folds `targetSeq` into the RDF base. */
471
432
  waitForPublished(targetSeq: number, opts?: {
472
433
  timeoutMs?: number;
@@ -484,6 +445,6 @@ export declare class LbbClient {
484
445
  * rebuild fills it.
485
446
  */
486
447
  schemaSummary(): Promise<Schemas["RdfSchemaSummaryResponse"]>;
487
- /** List the graphs (and branches) under the scoped tenant. */
448
+ /** List the graphs under the scoped tenant. */
488
449
  listGraphs(): Promise<Schemas["GraphListResponse"]>;
489
450
  }
package/dist/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { parseSparqlResults } from "./types.js";
2
2
  import { bodyMarksTerminal, errorCodeFromBody, fullJitterBackoffMs, parseLbbError, parseResponseJson, retryAllowed, retryableStatus, retryDelayMs, sleep, } from "./transport.js";
3
3
  import { LbbCapabilityError } from "./transport.js";
4
- import { EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
4
+ import { EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, EvalsNamespace, EmbeddingsNamespace, } from "./namespaces.js";
5
5
  export { parseSparqlResults } from "./types.js";
6
6
  export { LbbCapabilityError, LbbError } from "./transport.js";
7
7
  export { EntityNamespace, FactsNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
@@ -84,14 +84,13 @@ async function durableImportBody(source) {
84
84
  }
85
85
  /**
86
86
  * A typed HTTP client for a little big brain graph server. One instance is scoped to a
87
- * single graph/branch; construct another for a different scope. All methods
87
+ * single graph; construct another for a different scope. All methods
88
88
  * return the parsed JSON response and throw {@link LbbError} on failure.
89
89
  */
90
90
  export class LbbClient {
91
91
  baseUrl;
92
92
  apiKey;
93
93
  graphName;
94
- branchName;
95
94
  stack;
96
95
  fetchImpl;
97
96
  apiVersion;
@@ -110,6 +109,8 @@ export class LbbClient {
110
109
  schema;
111
110
  ontology;
112
111
  query;
112
+ evals;
113
+ embeddings;
113
114
  constructor(options) {
114
115
  const baseUrl = options.baseUrl?.trim();
115
116
  if (!baseUrl) {
@@ -118,7 +119,6 @@ export class LbbClient {
118
119
  this.baseUrl = baseUrl.replace(/\/+$/, "");
119
120
  this.apiKey = options.apiKey;
120
121
  this.graphName = options.graph;
121
- this.branchName = options.branch;
122
122
  this.stack = options.stack;
123
123
  this.apiVersion = options.apiVersion ?? "2026-07-23";
124
124
  this.maxRetries = options.maxRetries ?? 6;
@@ -152,17 +152,18 @@ export class LbbClient {
152
152
  this.schema = new SchemaNamespace(this);
153
153
  this.ontology = new OntologyNamespace(this);
154
154
  this.query = new QueryNamespace(this);
155
+ this.evals = new EvalsNamespace(this);
156
+ this.embeddings = new EmbeddingsNamespace(this);
155
157
  }
156
158
  graph(name, opts = {}) {
157
159
  return new GraphNamespace(this.withScope({
158
160
  graph: name,
159
- branch: opts.branch ?? this.branchName,
160
161
  stack: opts.stack ?? this.stack,
161
162
  }));
162
163
  }
163
164
  /**
164
- * A new client for a different graph/branch on the same server and credential.
165
- * Each instance is scoped to one graph/branch, so use this to target another
165
+ * A new client for a different graph on the same server and credential.
166
+ * Each instance is scoped to one graph, so use this to target another
166
167
  * scope (e.g. creating a fresh graph) without mutating the current client.
167
168
  */
168
169
  withScope(scope) {
@@ -170,7 +171,6 @@ export class LbbClient {
170
171
  baseUrl: this.baseUrl,
171
172
  apiKey: this.apiKey,
172
173
  graph: scope.graph ?? this.graphName,
173
- branch: scope.branch ?? this.branchName,
174
174
  stack: scope.stack ?? this.stack,
175
175
  fetch: this.fetchImpl,
176
176
  apiVersion: this.apiVersion,
@@ -218,8 +218,6 @@ export class LbbClient {
218
218
  const push = (key, value) => params.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
219
219
  if (this.graphName !== undefined)
220
220
  push("graph", this.graphName);
221
- if (this.branchName !== undefined)
222
- push("branch", this.branchName);
223
221
  if (this.stack !== undefined)
224
222
  push("stack", this.stack);
225
223
  for (const [key, value] of Object.entries(query ?? {})) {
@@ -600,8 +598,8 @@ export class LbbClient {
600
598
  });
601
599
  }
602
600
  /**
603
- * Create the scoped graph/branch with an empty ontology. Construct the client
604
- * with the desired graph/branch first, then call `ontology.define` before
601
+ * Create the scoped graph with an empty ontology. Construct the client
602
+ * with the desired graph first, then call `ontology.define` before
605
603
  * writing typed data.
606
604
  */
607
605
  createGraph() {
@@ -654,46 +652,13 @@ export class LbbClient {
654
652
  idempotencyKey: opts.idempotencyKey ?? this.idempotencyKey("reload"),
655
653
  });
656
654
  }
657
- /** Fork the scoped branch from an existing branch in the same graph. */
658
- createBranch(body) {
659
- return this.request("POST", "/v1/graph/branch", { body });
660
- }
661
- /**
662
- * Validate-then-merge: replay `from_branch`'s post-fork commits onto the
663
- * SCOPED branch (its fork parent) as one new commit. A write — sends an
664
- * Idempotency-Key so a retry replays instead of re-applying.
665
- */
666
- mergeBranch(body, opts = {}) {
667
- return this.request("POST", "/v1/graph/branch/merge", {
668
- body,
669
- idempotencyKey: opts.idempotencyKey ?? this.idempotencyKey("branch-merge"),
670
- });
671
- }
672
- /**
673
- * Observe: store a conversation episode verbatim as EPISODE evidence,
674
- * anchor + gate extracted facts on an observe branch, and optionally
675
- * auto-merge when validation is clean. Flag-gated server-side
676
- * (`--enable-observe`). A write — carries an Idempotency-Key.
677
- */
678
- observe(body, opts = {}) {
679
- return this.request("POST", "/v1/memory/observe", {
680
- body,
681
- idempotencyKey: opts.idempotencyKey ?? this.idempotencyKey("observe"),
682
- });
683
- }
684
- /** Delete the scoped graph, including every branch, feedback, and active graph-scoped job. */
655
+ /** Delete the scoped graph, including its feedback and active graph-scoped jobs. */
685
656
  deleteGraph(opts) {
686
657
  return this.request("POST", "/v1/graph/delete", {
687
658
  query: { confirm: opts.confirm },
688
659
  retry: true,
689
660
  });
690
661
  }
691
- /** Delete only the scoped branch. The server refuses to delete a graph's final live branch. */
692
- deleteBranch(opts) {
693
- return this.request("DELETE", "/v1/graph/branch", {
694
- query: { confirm: opts.confirm },
695
- });
696
- }
697
662
  // --- models as runs (training-run registry + eval machinery) ---
698
663
  /**
699
664
  * Captured signals by flush-seq range, oldest first — the model-training
@@ -799,18 +764,6 @@ export class LbbClient {
799
764
  ],
800
765
  }, opts);
801
766
  }
802
- /** Planner training examples at or before an optional signal split. */
803
- plannerDataset(opts = {}) {
804
- return this.request("GET", "/v1/models/planner-dataset", {
805
- query: { limit: opts.limit, split_seq: opts.splitSeq },
806
- });
807
- }
808
- /** Planner preference pairs at or before an optional signal split. */
809
- plannerPreferenceDataset(opts = {}) {
810
- return this.request("GET", "/v1/models/planner-preference-dataset", {
811
- query: { limit: opts.limit, split_seq: opts.splitSeq },
812
- });
813
- }
814
767
  /** Suggest-ranker examples at or before an optional signal split. */
815
768
  suggestDataset(opts = {}) {
816
769
  return this.request("GET", "/v1/models/suggest-dataset", {
@@ -833,15 +786,6 @@ export class LbbClient {
833
786
  query: { run_id: opts.runId, allow_regression: opts.allowRegression },
834
787
  });
835
788
  }
836
- /**
837
- * Promote a finished `planner_lora` training run: gated on held-out slot
838
- * exactness and recorded as a `kind=planner` training run.
839
- */
840
- promotePlanner(opts) {
841
- return this.request("POST", "/v1/models/promote-planner", {
842
- query: { run_id: opts.runId, allow_regression: opts.allowRegression },
843
- });
844
- }
845
789
  // --- relevance feedback ---
846
790
  /**
847
791
  * Append relevance labels for a set of ranked results — how little big brain
@@ -1069,6 +1013,11 @@ export class LbbClient {
1069
1013
  publicationStatus() {
1070
1014
  return this.request("GET", "/v1/graph/publication-status");
1071
1015
  }
1016
+ /** The managed models the platform uses per role (embedding, judge,
1017
+ * rewriter): the operator's catalog, or the compiled defaults. */
1018
+ managedModels() {
1019
+ return this.request("GET", "/v1/managed-models");
1020
+ }
1072
1021
  /** Wait until background reconciliation folds `targetSeq` into the RDF base. */
1073
1022
  async waitForPublished(targetSeq, opts = {}) {
1074
1023
  if (!Number.isSafeInteger(targetSeq) || targetSeq < 0) {
@@ -1119,7 +1068,7 @@ export class LbbClient {
1119
1068
  schemaSummary() {
1120
1069
  return this.request("GET", "/v1/graph/schema-summary");
1121
1070
  }
1122
- /** List the graphs (and branches) under the scoped tenant. */
1071
+ /** List the graphs under the scoped tenant. */
1123
1072
  listGraphs() {
1124
1073
  return this.request("GET", "/v1/graphs");
1125
1074
  }