@functional-systems/lambdadb-mcp 0.1.3-dev.10 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.3] - 2026-10-06
6
+
7
+ - Pin the stable LambdaDB SDK to 0.8.0; expose Bayesian candidate budgets and
8
+ native embedding configuration in MCP guidance while preserving free-form
9
+ queries, SDK/server validation, rerank defaults, errors and response metadata.
10
+ - Retain legacy `managedEmbedding: true` and existing tool names/inputs. Native
11
+ embedding-only requests require a supporting server; no defaults are promoted.
12
+ - Add Bayesian/native contract tests, installed-package coverage, practical MCP
13
+ examples and an opt-in live suite with verified temporary-collection cleanup.
14
+
5
15
  ## [0.1.2] - 2026-10-04
6
16
 
7
17
  - Pin the LambdaDB TypeScript SDK to 0.7.0 and expose all 49 fixed lowercase
package/README.md CHANGED
@@ -14,16 +14,17 @@ MCP server for LambdaDB using the official TypeScript MCP SDK and the official L
14
14
  Package: `@functional-systems/lambdadb-mcp`. Executable: `lambdadb-mcp`.
15
15
  Requires Node.js >=22.14.0; CI tests the minimum and current Node 22/24 LTS.
16
16
 
17
- The stable package is available on npm. As verified on 2026-10-04 (KST),
18
- `latest` resolves to `0.1.2` and `dev` to `0.1.2-dev.9`. Use an exact version for
17
+ The stable package is available on npm. As verified on 2026-10-06 (KST),
18
+ `latest` resolves to `0.1.2` and `dev` to `0.1.3-dev.11`. Use an exact version for
19
19
  reproducibility or the default stable channel for initial setup. See
20
20
  [release status and policy](RELEASING.md).
21
21
 
22
22
  [MCP 0.1.2](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.2) is the
23
23
  published stable release with SDK 0.7.0, 49 fixed text analyzer presets and optional
24
- managed reranking. This synchronization starts the next `0.1.3-dev.1` source base;
25
- check npm for the current published dev version. Use the exact stable version
26
- `0.1.2` for reproducible installed execution.
24
+ managed reranking. Published `0.1.3-dev.11` contains SDK 0.8.0, Bayesian hybrid
25
+ search and native embedding configuration. This source prepares stable `0.1.3`;
26
+ it has not yet been published. To preview these changes, use
27
+ `npx --yes @functional-systems/lambdadb-mcp@0.1.3-dev.11`.
27
28
  Existing installations need an MCP version containing these changes; upgrading
28
29
  the SDK separately does not update them.
29
30
 
@@ -103,8 +104,8 @@ Optional write tools:
103
104
 
104
105
  ## API contract and tool inputs
105
106
 
106
- The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.7.0`, checked against
107
- the published package and [v0.7.0 release](https://github.com/lambdadb/lambdadb-typescript-client/releases/tag/v0.7.0).
107
+ The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.8.0`, checked against
108
+ the published package and [v0.8.0 release](https://github.com/lambdadb/lambdadb-typescript-client/releases/tag/v0.8.0).
108
109
  This dependency update applies to builds containing this change. Publishing the SDK
109
110
  alone does not update previously published or installed MCP packages.
110
111
 
@@ -174,6 +175,114 @@ This MCP update does not migrate existing Collections or indexes. Partial update
174
175
  segment merging, and old Tags do not upgrade old indexes. If migration is needed,
175
176
  plan and authorize reinsertion into a new Collection separately.
176
177
 
178
+ ### Bayesian hybrid search
179
+
180
+ Arguments for `lambdadb_query_collection` using an existing two-dimensional
181
+ caller-provided vector field `embedding` and text field `body`:
182
+
183
+ ```json
184
+ {
185
+ "collectionName": "articles",
186
+ "query": {
187
+ "bayesian": [
188
+ { "queryString": { "query": "body:restore" } },
189
+ { "knn": { "field": "embedding", "queryVector": [1, 0], "k": 30 } }
190
+ ]
191
+ },
192
+ "size": 10,
193
+ "candidateSize": 30
194
+ }
195
+ ```
196
+
197
+ Bayesian requires exactly two signals. Boolean subqueries may combine clauses
198
+ within a signal, but explicit boosts (even `1`) on either signal or its Boolean
199
+ descendants and nested rank-fusion queries are unsupported. Do not supply fusion
200
+ weights. Without rerank, top-level `candidateSize` is required and must satisfy
201
+ `1 <= size <= candidateSize <= 100`; omitted `size` retains the server default of
202
+ 10. The budget is per signal, independent of final output size and `knn.k`.
203
+
204
+ With rerank, omit top-level `candidateSize` and use `rerank.candidateSize`:
205
+
206
+ ```json
207
+ {
208
+ "collectionName": "articles",
209
+ "query": {
210
+ "bayesian": [
211
+ { "queryString": { "query": "body:restore" } },
212
+ { "knn": { "field": "embedding", "queryVector": [1, 0], "k": 30 } }
213
+ ]
214
+ },
215
+ "size": 10,
216
+ "rerank": {
217
+ "provider": "typesafe",
218
+ "model": "jev-1.13.0",
219
+ "queryText": "How do I restore a previous version?",
220
+ "fields": ["body"],
221
+ "candidateSize": 30
222
+ }
223
+ }
224
+ ```
225
+
226
+ Omitted/null `rerank.candidateSize` retains `max(50, size)`; omitted/null `rerank`
227
+ requires the top-level Bayesian budget. Ordinary text/KNN/RRF/Min-Max/L2 queries
228
+ must omit top-level `candidateSize`. MCP preserves free-form queries, passes
229
+ integer candidate budgets unchanged, and leaves Bayesian structure, bounds and
230
+ cross-field validation to the server, retaining service errors. No query defaults,
231
+ weights or candidate counts are inserted by MCP. Bayesian scores are heuristic
232
+ fusion scores; applied reranking preserves them in `retrievalScore` and retains
233
+ all rerank status metadata, including through SDK-managed `docsUrl` downloads.
234
+
235
+ The [Bayesian contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.8.0/docs/bayesian-search.md)
236
+ and native embedding additions below are pinned to backend
237
+ `9072a1bc8925954369a887f558f1eaf387b7ea0e`. A source pin does not establish deployment
238
+ in another environment. Existing fusion methods and tool names remain unchanged.
239
+
240
+ ### Native embedding configuration
241
+
242
+ With write tools enabled, call `lambdadb_create_collection` with:
243
+
244
+ ```json
245
+ {
246
+ "collectionName": "native-articles",
247
+ "indexConfigs": {
248
+ "body": { "type": "text" },
249
+ "embedding": {
250
+ "type": "vector",
251
+ "embedding": {
252
+ "provider": "openai",
253
+ "model": "text-embedding-3-small",
254
+ "sourceField": "body",
255
+ "dimensions": 512,
256
+ "similarity": "cosine"
257
+ }
258
+ }
259
+ }
260
+ }
261
+ ```
262
+
263
+ Then call `lambdadb_upsert_docs` with
264
+ `{"collectionName":"native-articles","docs":[{"id":"one","body":"Restore a saved version."}]}`.
265
+ The source must be a text field; omit the generated vector from documents.
266
+ Use `knn.queryText` instead of `queryVector` for this field, including in either
267
+ Bayesian example above. For example, call `lambdadb_query_collection` with:
268
+
269
+ ```json
270
+ {
271
+ "collectionName": "native-articles",
272
+ "query": { "knn": { "field": "embedding", "queryText": "Restore a version", "k": 30 } },
273
+ "size": 10
274
+ }
275
+ ```
276
+
277
+ Native dimensions and similarity are optional and belong inside `embedding`.
278
+ MCP does not infer a flag, provider, model or native dimensions/similarity default.
279
+ The SDK rejects `managedEmbedding: false` with `embedding`, and native embedding
280
+ with top-level dimensions/similarity. Caller-provided vectors continue to use
281
+ top-level dimensions/similarity. Free-form nested object configurations retain
282
+ server validation. For older servers, explicitly add `managedEmbedding: true`
283
+ beside `type`; it is preserved. Normalized collection metadata may still contain
284
+ that true flag. See the [native embedding contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.8.0/docs/native-embeddings.md).
285
+
177
286
  ### Optional managed reranking
178
287
 
179
288
  `lambdadb_query_collection` accepts per-query `rerank`; omission or `null`
@@ -205,7 +314,7 @@ Optional `criteria` replaces the default with 2–10 distinct nonblank descripti
205
314
  ordered from lowest to highest relevance (2 KiB each, 8 KiB total UTF-8).
206
315
  Omitted/null criteria uses defaults; text, order, nulls and omission are preserved.
207
316
 
208
- Final `size`, vector-leg `knn.k`, and merged `candidateSize` are separate.
317
+ Final `size`, vector-leg `knn.k`, and merged `rerank.candidateSize` are separate.
209
318
  Require `1 <= size <= candidateSize <= 100`; omitted/null candidateSize defaults
210
319
  on the server to `max(50, size)`, with final size defaulting to 10. MCP never
211
320
  increases `k`. Reranking requires a scoring retrieval query, forbids `sort`,
@@ -294,7 +403,9 @@ MCP JSON Schema and actual tool-to-SDK HTTP path, including match-all, facet-onl
294
403
  document+facet, omitted/null/default bucket options, boundaries, invalid requests,
295
404
  and all 49 analyzers. Rerank tests cover JSON Schema, request preservation,
296
405
  local bounds/UTF-8 rejection, score envelopes, skipped/fallback results and
297
- metadata downloads. They do not require credentials
406
+ metadata downloads. Bayesian tests cover untouched free-form requests, candidate
407
+ budgets, server errors, native/legacy configurations and contradictory inputs.
408
+ They do not require credentials
298
409
  or create remote collections. `test:package` additionally installs the actual
299
410
  tarball in a clean consumer directory and repeats the tool contracts over real
300
411
  stdio, checking version identity, config errors, stdout and process termination.
@@ -340,9 +451,23 @@ Cleanup deletes the collection and verifies its absence even after a failed chec
340
451
  It does not assert fixed model scores or relevance rankings, and a fallback result
341
452
  does not pass as applied inference. Provider failures remain fixture tests; this
342
453
  suite does not deliberately induce failures or verify search quality, load,
343
- production deployment or billing readiness. Both live suites are outside default
454
+ production deployment or billing readiness. These live suites are outside default
344
455
  checks and credential-free CI.
345
456
 
457
+ Bayesian/native embedding verification also requires explicit managed inference
458
+ opt-in for OpenAI embeddings and TypeSafe reranking:
459
+
460
+ ```bash
461
+ LAMBDADB_RUN_LIVE_TESTS=1 LAMBDADB_RUN_LIVE_RERANK_TESTS=1 LAMBDADB_LIVE_CONFIRM_PROJECT=YOUR_DEV_PROJECT npm run test:live:bayesian
462
+ ```
463
+
464
+ This suite creates one owned collection with native, legacy and caller-provided
465
+ vector fields. It checks real embedding generation and text queries, Bayesian
466
+ budgets and server rejections, existing fusion methods, applied reranking with
467
+ retrieval scores and actual docsUrl hydration, then deletes and verifies absence.
468
+ These live suites are outside default checks and credential-free CI. Verify the
469
+ target's deployment provenance before running; the source pin alone is insufficient.
470
+
346
471
  If the environment file is outside the worktree:
347
472
 
348
473
  ```bash
package/RELEASING.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Releasing LambdaDB MCP
2
2
 
3
+ ## Stable candidate: 0.1.3 (2026-10-06 KST)
4
+
5
+ `release/0.1.3` prepares the SDK 0.8.0 changes merged in
6
+ [PR #14](https://github.com/lambdadb/lambdadb-mcp/pull/14) for review into `main`.
7
+ The implementation matches develop commit
8
+ `bd1ae5547f868991a22c92b5a07849edfcf696fb`; only release metadata and validation
9
+ documentation change. Package and both root lockfile versions are `0.1.3`.
10
+
11
+ This candidate adds Bayesian candidate budgets and native embedding configuration
12
+ while preserving existing tool names, free-form inputs, rerank defaults and
13
+ metadata, SDK downloads, and read-only defaults. Older servers still require
14
+ `managedEmbedding: true`. See `docs/validation/2026-10-06-sdk-0.8.0.md` for the
15
+ authorized development-service evidence and `docs/validation/2026-10-06-0.1.3.md`
16
+ for publication, candidate checks and their separate scopes.
17
+
18
+ Review this candidate into main using a merge commit to preserve ancestry.
19
+ Then obtain authorization for the `v0.1.3` tag and published GitHub Release; no
20
+ tag, stable publication or default promotion is part of candidate preparation.
21
+ After stable publication, synchronize main back to develop with the next
22
+ `0.1.4-dev.1` base. Do not merge stable metadata directly into develop.
23
+
3
24
  ## Current stable release: 0.1.2 (2026-10-04 KST)
4
25
 
5
26
  [v0.1.2](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.2) tags main
@@ -18,12 +39,12 @@ reranking. Read-only defaults and explicit write opt-in remain. See
18
39
  source-build live, published dev and published stable evidence. Do not repeat the
19
40
  0.1.2 publication or move its tag.
20
41
 
21
- This synchronization brings main back into develop with the next base
22
- `0.1.3-dev.1`. Review it into develop using a merge commit to preserve ancestry.
23
- Eligible develop merges may publish a new dev version while `latest` stays on
24
- 0.1.2. Do not merge stable version metadata directly into develop.
42
+ The 0.1.2 synchronization is complete: PR #13 brought main back into develop
43
+ with the `0.1.3-dev.1` base. Eligible develop merges may publish new dev versions
44
+ while `latest` stays on 0.1.2 until an explicitly authorized stable release.
45
+ Do not merge stable version metadata directly into develop.
25
46
 
26
- Both live suites require explicit designation of a development project. Reranking
47
+ Live suites require explicit designation of a development project. Reranking
27
48
  also requires managed inference opt-in; no Jev API key is required. Live contract
28
49
  checks do not establish production deployment, search quality, load/failure
29
50
  coverage or billing readiness. Supporting backend deployment/model availability
@@ -68,7 +68,7 @@ export function registerReadTools(server, config) {
68
68
  });
69
69
  server.registerTool("lambdadb_query_collection", {
70
70
  title: "Query Collection",
71
- description: "Search documents with optional managed reranking and keyword facet counts across all matches. Omit query for match-all; size: 0 requires facets and forbids reranking. Reranking requires a scoring query and forbids sort; it does not enable vector/hybrid facets. Applied envelope score is an evaluation score, retrievalScore preserves search score, and rerank metadata reports status. Features require a supporting server; facets require newly built keyword indexes.",
71
+ description: "Search documents with optional Bayesian hybrid search, managed reranking and keyword facet counts across all matches. Omit query for match-all; size: 0 requires facets and forbids reranking. Reranking requires a scoring query and forbids sort; it does not enable vector/hybrid facets. Applied envelope score is an evaluation score, retrievalScore preserves search score, and rerank metadata reports status. Features require a supporting server; facets require newly built keyword indexes.",
72
72
  annotations: {
73
73
  readOnlyHint: true,
74
74
  openWorldHint: false
@@ -77,7 +77,9 @@ export function registerReadTools(server, config) {
77
77
  collectionName: nameSchema,
78
78
  size: z.number().int().min(0).max(100).optional()
79
79
  .describe("Documents to return (1–100), or 0 with nonempty facets."),
80
- query: z.record(z.string(), z.any()).optional().describe("Omit for match-all."),
80
+ // Preserve SDK/server validation and error classification for free-form queries.
81
+ candidateSize: z.number().int().optional().describe("Bayesian without rerank requires 1 <= size <= candidateSize <= 100 (size defaults to 10 on the server). With rerank, omit this field and use rerank.candidateSize, whose default is unchanged. Unsupported for other queries; server validates these combinations."),
82
+ query: z.record(z.string(), z.any()).optional().describe("Free-form query; omit for match-all. Top-level bayesian is an array of exactly two subqueries, with no explicit boosts on either subquery or its Boolean descendants. Nested rank fusion and fusion weights are unsupported. Server validates the query contract."),
81
83
  facets: facetsSchema.optional(),
82
84
  rerank: rerankSchema,
83
85
  ref: readRefSchema.optional(),
@@ -105,7 +107,7 @@ export function registerReadTools(server, config) {
105
107
  }
106
108
  }]
107
109
  })
108
- }, async ({ collectionName, size, query, facets, rerank, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
110
+ }, async ({ collectionName, size, candidateSize, query, facets, rerank, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
109
111
  try {
110
112
  const client = createLambdaDBClient(config);
111
113
  const input = {
@@ -113,6 +115,7 @@ export function registerReadTools(server, config) {
113
115
  facets,
114
116
  rerank,
115
117
  size,
118
+ candidateSize,
116
119
  ...readOptions(ref, consistentRead),
117
120
  includeVectors,
118
121
  sort,
@@ -6,13 +6,13 @@ import { jsonResult, nameSchema, partitionFilterSchema } from "./shared.js";
6
6
  export function registerWriteTools(server, config) {
7
7
  server.registerTool("lambdadb_create_collection", {
8
8
  title: "Create Collection",
9
- description: `Create a new collection in the configured project. Fixed lowercase text analyzer presets: ${Object.values(Analyzer).join(", ")}. Omitted analyzers uses standard; custom pipelines/options are unsupported. The keyword text analyzer is distinct from the keyword field type. Keyword indexes built on a supporting server support facets.`,
9
+ description: `Create a new collection in the configured project. Fixed lowercase text analyzer presets: ${Object.values(Analyzer).join(", ")}. Omitted analyzers uses standard; custom pipelines/options are unsupported. The keyword text analyzer is distinct from the keyword field type. Keyword indexes built on a supporting server support facets. Native vector fields accept embedding without managedEmbedding; explicit managedEmbedding: true remains supported for older servers.`,
10
10
  annotations: {
11
11
  openWorldHint: false
12
12
  },
13
13
  inputSchema: z.strictObject({
14
14
  collectionName: nameSchema,
15
- indexConfigs: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, "indexConfigs must contain at least one field."),
15
+ indexConfigs: z.record(z.string(), z.any()).refine((value) => Object.keys(value).length > 0, "indexConfigs must contain at least one field.").describe("Field configurations validated by the SDK/server. Native vectors: {type: 'vector', embedding: {provider, model, sourceField, dimensions?, similarity?}}; declare sourceField as text. Native dimensions/similarity belong inside embedding, never at the field top level. Do not combine embedding with managedEmbedding: false. Legacy true is preserved; no provider/model or native defaults are inferred. Caller-provided vectors retain top-level dimensions/similarity."),
16
16
  description: z.string().max(255).optional(),
17
17
  tags: z.record(z.string().regex(/^[A-Za-z0-9_.-]{1,63}$/), z.string().min(1).max(127).regex(/^[^:#,]+$/))
18
18
  .refine((value) => Object.keys(value).length <= 5, "At most five tags are allowed.")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functional-systems/lambdadb-mcp",
3
- "version": "0.1.3-dev.10",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "MCP server for LambdaDB data plane",
6
6
  "type": "module",
@@ -11,6 +11,7 @@
11
11
  "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json && node -e \"require('node:fs').chmodSync('dist/index.js', 0o755)\"",
12
12
  "check": "npm run check:version && npm run typecheck && npm test",
13
13
  "test": "npm run build && node --test test/*.test.mjs",
14
+ "test:live:bayesian": "npm run build && bash ./scripts/with-env.sh --test test/integration/bayesian-live.test.mjs",
14
15
  "test:live:rerank": "npm run build && bash ./scripts/with-env.sh --test test/integration/rerank-live.test.mjs",
15
16
  "test:live": "npm run build && bash ./scripts/with-env.sh --test test/integration/live.test.mjs",
16
17
  "dev": "tsx watch src/index.ts",
@@ -23,7 +24,7 @@
23
24
  "test:package": "node scripts/test-package.mjs"
24
25
  },
25
26
  "dependencies": {
26
- "@functional-systems/lambdadb": "0.7.0",
27
+ "@functional-systems/lambdadb": "0.8.0",
27
28
  "@modelcontextprotocol/sdk": "1.29.0",
28
29
  "zod": "^4.1.12"
29
30
  },
@@ -61,5 +62,5 @@
61
62
  "access": "public",
62
63
  "registry": "https://registry.npmjs.org"
63
64
  },
64
- "gitHead": "df4be52ea47726f4d3d82a99b3ee2a755139c1f9"
65
+ "gitHead": "159b84aace7d9352cf8e5315bc7f7192e8d65a41"
65
66
  }