@littlebigbrain/client 0.3.0 → 0.4.1
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 +2 -1
- package/dist/client.d.ts +13 -0
- package/dist/client.js +20 -0
- package/dist/namespaces.d.ts +12 -0
- package/dist/namespaces.js +30 -0
- package/dist/schema.d.ts +3377 -482
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,13 +95,14 @@ and `elapsedMs`.
|
|
|
95
95
|
| Area | Methods |
|
|
96
96
|
| --- | --- |
|
|
97
97
|
| Write | `graph("main").facts.create` |
|
|
98
|
+
| Managed embeddings | `graph("main").embeddingConfig`, `graph("main").setEmbeddingConfig`, `graph("main").backfillEmbeddings`, `graph("main").promoteEmbedding` |
|
|
98
99
|
| Search | `search.hybrid`, `search.multi`, `search.fullText`, `search.vector` |
|
|
99
100
|
| Context substrate | `context.ask`, `context.suggest`, `context.resolve`, `context.decode`, `context.groundability` |
|
|
100
101
|
| Search feedback (training data) | `search.feedback`, `search.feedbackExport` |
|
|
101
102
|
| Traversal | `traverse`, `semanticTraverse` |
|
|
102
103
|
| Temporal / lineage / shapes | `currentState`, `history`, `why`, `shacl` |
|
|
103
104
|
| Query | `query.sparql`, `query.structured`, `query.analytics`, `query.shacl`, `query.infer`, `query.premises` |
|
|
104
|
-
| Ontology | `ontology.view`, `ontology.conformance`, `ontology.search`, `ontology.resolve`, `ontology.define`, `ontology.evolve` |
|
|
105
|
+
| Ontology | `ontology.view`, `ontology.conformance`, `ontology.search`, `ontology.resolve`, `ontology.define`, `ontology.evolve`, `ontology.induce` |
|
|
105
106
|
| Index lifecycle | `indexes.run`, `indexes.build`, `indexes.delta`, `indexes.gc`, `compact` |
|
|
106
107
|
| Inspection | `entities.list`, `entities.filterByAttributes`, `status`, `metadata`, `summary` |
|
|
107
108
|
| Schema activation | `schema.view`, `schema.preview`, `schema.publish`, `schema.audit` |
|
package/dist/client.d.ts
CHANGED
|
@@ -131,6 +131,17 @@ export declare class LbbClient {
|
|
|
131
131
|
deleteGraph(opts: {
|
|
132
132
|
confirm: string;
|
|
133
133
|
}): Promise<unknown>;
|
|
134
|
+
embeddingConfig(): Promise<Schemas["ManagedEmbeddingConfigResponse"]>;
|
|
135
|
+
setEmbeddingConfig(body: Schemas["ManagedEmbeddingConfigRequest"]): Promise<Schemas["ManagedEmbeddingConfigResponse"]>;
|
|
136
|
+
backfillEmbeddings(opts?: {
|
|
137
|
+
batchSize?: number;
|
|
138
|
+
limit?: number;
|
|
139
|
+
full?: boolean;
|
|
140
|
+
}): Promise<Schemas["ManagedEmbeddingBackfillResponse"]>;
|
|
141
|
+
promoteEmbedding(opts: {
|
|
142
|
+
runId: string;
|
|
143
|
+
allowRegression?: boolean;
|
|
144
|
+
}): Promise<Schemas["ManagedEmbeddingPromoteResponse"]>;
|
|
134
145
|
/**
|
|
135
146
|
* The graph's grounding vocabulary as byte-sorted, deduped string sections —
|
|
136
147
|
* the canonical input for a decoder-side automaton (FST/trie) and the
|
|
@@ -474,6 +485,8 @@ export declare class LbbClient {
|
|
|
474
485
|
* migration is needed — and a request that changes nothing is a no-op.
|
|
475
486
|
*/
|
|
476
487
|
evolveOntology(body: Schemas["OntologyEvolveRequest"]): Promise<Schemas["OntologyEvolveResponse"]>;
|
|
488
|
+
/** Suggest ontology additions from the current graph without mutating it. */
|
|
489
|
+
induceOntology(body: Schemas["OntologyInduceRequest"]): Promise<Schemas["OntologyInduceResponse"]>;
|
|
477
490
|
/**
|
|
478
491
|
* Build default ANN + BM25 indexes. With `{ background: true }` the build
|
|
479
492
|
* runs detached on the server and the call returns immediately — use it for
|
package/dist/client.js
CHANGED
|
@@ -389,6 +389,22 @@ export class LbbClient {
|
|
|
389
389
|
query: { confirm: opts.confirm },
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
+
embeddingConfig() {
|
|
393
|
+
return this.request("GET", "/v1/graph/embedding");
|
|
394
|
+
}
|
|
395
|
+
setEmbeddingConfig(body) {
|
|
396
|
+
return this.request("POST", "/v1/graph/embedding", { body });
|
|
397
|
+
}
|
|
398
|
+
backfillEmbeddings(opts = {}) {
|
|
399
|
+
return this.request("POST", "/v1/graph/embedding/backfill", {
|
|
400
|
+
query: { batch_size: opts.batchSize, limit: opts.limit, full: opts.full },
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
promoteEmbedding(opts) {
|
|
404
|
+
return this.request("POST", "/v1/graph/embedding/promote", {
|
|
405
|
+
query: { run_id: opts.runId, allow_regression: opts.allowRegression },
|
|
406
|
+
});
|
|
407
|
+
}
|
|
392
408
|
// --- models as runs (training-run registry + eval machinery) ---
|
|
393
409
|
/**
|
|
394
410
|
* The graph's grounding vocabulary as byte-sorted, deduped string sections —
|
|
@@ -852,6 +868,10 @@ export class LbbClient {
|
|
|
852
868
|
evolveOntology(body) {
|
|
853
869
|
return this.request("POST", "/v1/ontology/evolve", { body });
|
|
854
870
|
}
|
|
871
|
+
/** Suggest ontology additions from the current graph without mutating it. */
|
|
872
|
+
induceOntology(body) {
|
|
873
|
+
return this.request("POST", "/v1/ontology/induce", { body, retry: true });
|
|
874
|
+
}
|
|
855
875
|
// --- index lifecycle ---
|
|
856
876
|
/**
|
|
857
877
|
* Build default ANN + BM25 indexes. With `{ background: true }` the build
|
package/dist/namespaces.d.ts
CHANGED
|
@@ -33,6 +33,17 @@ export declare class GraphNamespace {
|
|
|
33
33
|
delete(opts: {
|
|
34
34
|
confirm: string;
|
|
35
35
|
} & CallOptions): Promise<unknown>;
|
|
36
|
+
embeddingConfig(opts?: CallOptions): Promise<Schemas["ManagedEmbeddingConfigResponse"]>;
|
|
37
|
+
setEmbeddingConfig(body: Schemas["ManagedEmbeddingConfigRequest"], opts?: CallOptions): Promise<Schemas["ManagedEmbeddingConfigResponse"]>;
|
|
38
|
+
backfillEmbeddings(options?: CallOptions & {
|
|
39
|
+
batchSize?: number;
|
|
40
|
+
limit?: number;
|
|
41
|
+
full?: boolean;
|
|
42
|
+
}): Promise<Schemas["ManagedEmbeddingBackfillResponse"]>;
|
|
43
|
+
promoteEmbedding(options: CallOptions & {
|
|
44
|
+
runId: string;
|
|
45
|
+
allowRegression?: boolean;
|
|
46
|
+
}): Promise<Schemas["ManagedEmbeddingPromoteResponse"]>;
|
|
36
47
|
/** Retract edges/entities from the scoped graph. See {@link LbbClient.retract}. */
|
|
37
48
|
retract(body: Schemas["GraphRetractRequest"], opts?: CallOptions): Promise<Schemas["GraphRetractResponse"]>;
|
|
38
49
|
/** Export this graph's current snapshot as Turtle, N-Triples, TriG, or N-Quads. */
|
|
@@ -170,6 +181,7 @@ export declare class OntologyNamespace {
|
|
|
170
181
|
resolve(body: Schemas["OntologyResolveRequest"], opts?: CallOptions): Promise<Schemas["OntologyResolveResponse"]>;
|
|
171
182
|
define(body: Schemas["OntologyDefineRequest"], opts?: CallOptions): Promise<Schemas["OntologyDefineResponse"]>;
|
|
172
183
|
evolve(body: Schemas["OntologyEvolveRequest"], opts?: CallOptions): Promise<Schemas["OntologyEvolveResponse"]>;
|
|
184
|
+
induce(body: Schemas["OntologyInduceRequest"], opts?: CallOptions): Promise<Schemas["OntologyInduceResponse"]>;
|
|
173
185
|
}
|
|
174
186
|
/** Structured, SPARQL-text, reasoning, and analytical query operations. */
|
|
175
187
|
export declare class QueryNamespace {
|
package/dist/namespaces.js
CHANGED
|
@@ -43,6 +43,29 @@ export class GraphNamespace {
|
|
|
43
43
|
query: { confirm },
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
embeddingConfig(opts = {}) {
|
|
47
|
+
return this.client.request("GET", "/v1/graph/embedding", opts);
|
|
48
|
+
}
|
|
49
|
+
setEmbeddingConfig(body, opts = {}) {
|
|
50
|
+
return this.client.request("POST", "/v1/graph/embedding", {
|
|
51
|
+
...opts,
|
|
52
|
+
body,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
backfillEmbeddings(options = {}) {
|
|
56
|
+
const { batchSize, limit, full, ...request } = options;
|
|
57
|
+
return this.client.request("POST", "/v1/graph/embedding/backfill", {
|
|
58
|
+
...request,
|
|
59
|
+
query: { batch_size: batchSize, limit, full },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
promoteEmbedding(options) {
|
|
63
|
+
const { runId, allowRegression, ...request } = options;
|
|
64
|
+
return this.client.request("POST", "/v1/graph/embedding/promote", {
|
|
65
|
+
...request,
|
|
66
|
+
query: { run_id: runId, allow_regression: allowRegression },
|
|
67
|
+
});
|
|
68
|
+
}
|
|
46
69
|
/** Retract edges/entities from the scoped graph. See {@link LbbClient.retract}. */
|
|
47
70
|
retract(body, opts = {}) {
|
|
48
71
|
return this.client.request("POST", "/v1/graph/retract", {
|
|
@@ -413,6 +436,13 @@ export class OntologyNamespace {
|
|
|
413
436
|
body,
|
|
414
437
|
});
|
|
415
438
|
}
|
|
439
|
+
induce(body, opts = {}) {
|
|
440
|
+
return this.client.request("POST", "/v1/ontology/induce", {
|
|
441
|
+
...opts,
|
|
442
|
+
retry: opts.retry ?? true,
|
|
443
|
+
body,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
416
446
|
}
|
|
417
447
|
/** Structured, SPARQL-text, reasoning, and analytical query operations. */
|
|
418
448
|
export class QueryNamespace {
|