@functional-systems/lambdadb-mcp 0.1.2 → 0.1.3-dev.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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Pin the stable LambdaDB SDK to 0.8.0; expose Bayesian candidate budgets and
6
+ native embedding configuration in MCP guidance while preserving free-form
7
+ queries, SDK/server validation, rerank defaults, errors and response metadata.
8
+ - Retain legacy `managedEmbedding: true` and existing tool names/inputs. Native
9
+ embedding-only requests require a supporting server; no defaults are promoted.
10
+ - Add Bayesian/native contract tests, installed-package coverage, practical MCP
11
+ examples and an opt-in live suite with verified temporary-collection cleanup.
12
+
5
13
  ## [0.1.2] - 2026-10-04
6
14
 
7
15
  - Pin the LambdaDB TypeScript SDK to 0.7.0 and expose all 49 fixed lowercase
package/README.md CHANGED
@@ -15,22 +15,22 @@ 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
17
  The stable package is available on npm. As verified on 2026-10-04 (KST),
18
- `latest` resolves to `0.1.1` and `dev` to `0.1.2-dev.9`. Use an exact version for
18
+ `latest` resolves to `0.1.2` and `dev` to `0.1.2-dev.9`. 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
- [MCP 0.1.1](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.1) remains the
23
- published stable release with SDK 0.6.0. Published `0.1.2-dev.9` contains SDK 0.7.0,
24
- 49 fixed text analyzer presets and optional managed reranking. This source prepares
25
- stable `0.1.2`; it has not yet been published. To preview the published changes,
26
- use `npx --yes @functional-systems/lambdadb-mcp@0.1.2-dev.9`.
22
+ [MCP 0.1.2](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.2) is the
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.
27
27
  Existing installations need an MCP version containing these changes; upgrading
28
28
  the SDK separately does not update them.
29
29
 
30
30
  ```sh
31
31
  npx --yes @functional-systems/lambdadb-mcp
32
32
  # Pin the stable release:
33
- npx --yes @functional-systems/lambdadb-mcp@0.1.1
33
+ npx --yes @functional-systems/lambdadb-mcp@0.1.2
34
34
  # Or install globally:
35
35
  npm install -g @functional-systems/lambdadb-mcp
36
36
  lambdadb-mcp
@@ -103,8 +103,8 @@ Optional write tools:
103
103
 
104
104
  ## API contract and tool inputs
105
105
 
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).
106
+ The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.8.0`, checked against
107
+ the published package and [v0.8.0 release](https://github.com/lambdadb/lambdadb-typescript-client/releases/tag/v0.8.0).
108
108
  This dependency update applies to builds containing this change. Publishing the SDK
109
109
  alone does not update previously published or installed MCP packages.
110
110
 
@@ -174,6 +174,114 @@ This MCP update does not migrate existing Collections or indexes. Partial update
174
174
  segment merging, and old Tags do not upgrade old indexes. If migration is needed,
175
175
  plan and authorize reinsertion into a new Collection separately.
176
176
 
177
+ ### Bayesian hybrid search
178
+
179
+ Arguments for `lambdadb_query_collection` using an existing two-dimensional
180
+ caller-provided vector field `embedding` and text field `body`:
181
+
182
+ ```json
183
+ {
184
+ "collectionName": "articles",
185
+ "query": {
186
+ "bayesian": [
187
+ { "queryString": { "query": "body:restore" } },
188
+ { "knn": { "field": "embedding", "queryVector": [1, 0], "k": 30 } }
189
+ ]
190
+ },
191
+ "size": 10,
192
+ "candidateSize": 30
193
+ }
194
+ ```
195
+
196
+ Bayesian requires exactly two signals. Boolean subqueries may combine clauses
197
+ within a signal, but explicit boosts (even `1`) on either signal or its Boolean
198
+ descendants and nested rank-fusion queries are unsupported. Do not supply fusion
199
+ weights. Without rerank, top-level `candidateSize` is required and must satisfy
200
+ `1 <= size <= candidateSize <= 100`; omitted `size` retains the server default of
201
+ 10. The budget is per signal, independent of final output size and `knn.k`.
202
+
203
+ With rerank, omit top-level `candidateSize` and use `rerank.candidateSize`:
204
+
205
+ ```json
206
+ {
207
+ "collectionName": "articles",
208
+ "query": {
209
+ "bayesian": [
210
+ { "queryString": { "query": "body:restore" } },
211
+ { "knn": { "field": "embedding", "queryVector": [1, 0], "k": 30 } }
212
+ ]
213
+ },
214
+ "size": 10,
215
+ "rerank": {
216
+ "provider": "typesafe",
217
+ "model": "jev-1.13.0",
218
+ "queryText": "How do I restore a previous version?",
219
+ "fields": ["body"],
220
+ "candidateSize": 30
221
+ }
222
+ }
223
+ ```
224
+
225
+ Omitted/null `rerank.candidateSize` retains `max(50, size)`; omitted/null `rerank`
226
+ requires the top-level Bayesian budget. Ordinary text/KNN/RRF/Min-Max/L2 queries
227
+ must omit top-level `candidateSize`. MCP preserves free-form queries, passes
228
+ integer candidate budgets unchanged, and leaves Bayesian structure, bounds and
229
+ cross-field validation to the server, retaining service errors. No query defaults,
230
+ weights or candidate counts are inserted by MCP. Bayesian scores are heuristic
231
+ fusion scores; applied reranking preserves them in `retrievalScore` and retains
232
+ all rerank status metadata, including through SDK-managed `docsUrl` downloads.
233
+
234
+ The [Bayesian contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.8.0/docs/bayesian-search.md)
235
+ and native embedding additions below are pinned to backend
236
+ `9072a1bc8925954369a887f558f1eaf387b7ea0e`. A source pin does not establish deployment
237
+ in another environment. Existing fusion methods and tool names remain unchanged.
238
+
239
+ ### Native embedding configuration
240
+
241
+ With write tools enabled, call `lambdadb_create_collection` with:
242
+
243
+ ```json
244
+ {
245
+ "collectionName": "native-articles",
246
+ "indexConfigs": {
247
+ "body": { "type": "text" },
248
+ "embedding": {
249
+ "type": "vector",
250
+ "embedding": {
251
+ "provider": "openai",
252
+ "model": "text-embedding-3-small",
253
+ "sourceField": "body",
254
+ "dimensions": 512,
255
+ "similarity": "cosine"
256
+ }
257
+ }
258
+ }
259
+ }
260
+ ```
261
+
262
+ Then call `lambdadb_upsert_docs` with
263
+ `{"collectionName":"native-articles","docs":[{"id":"one","body":"Restore a saved version."}]}`.
264
+ The source must be a text field; omit the generated vector from documents.
265
+ Use `knn.queryText` instead of `queryVector` for this field, including in either
266
+ Bayesian example above. For example, call `lambdadb_query_collection` with:
267
+
268
+ ```json
269
+ {
270
+ "collectionName": "native-articles",
271
+ "query": { "knn": { "field": "embedding", "queryText": "Restore a version", "k": 30 } },
272
+ "size": 10
273
+ }
274
+ ```
275
+
276
+ Native dimensions and similarity are optional and belong inside `embedding`.
277
+ MCP does not infer a flag, provider, model or native dimensions/similarity default.
278
+ The SDK rejects `managedEmbedding: false` with `embedding`, and native embedding
279
+ with top-level dimensions/similarity. Caller-provided vectors continue to use
280
+ top-level dimensions/similarity. Free-form nested object configurations retain
281
+ server validation. For older servers, explicitly add `managedEmbedding: true`
282
+ beside `type`; it is preserved. Normalized collection metadata may still contain
283
+ that true flag. See the [native embedding contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.8.0/docs/native-embeddings.md).
284
+
177
285
  ### Optional managed reranking
178
286
 
179
287
  `lambdadb_query_collection` accepts per-query `rerank`; omission or `null`
@@ -205,7 +313,7 @@ Optional `criteria` replaces the default with 2–10 distinct nonblank descripti
205
313
  ordered from lowest to highest relevance (2 KiB each, 8 KiB total UTF-8).
206
314
  Omitted/null criteria uses defaults; text, order, nulls and omission are preserved.
207
315
 
208
- Final `size`, vector-leg `knn.k`, and merged `candidateSize` are separate.
316
+ Final `size`, vector-leg `knn.k`, and merged `rerank.candidateSize` are separate.
209
317
  Require `1 <= size <= candidateSize <= 100`; omitted/null candidateSize defaults
210
318
  on the server to `max(50, size)`, with final size defaulting to 10. MCP never
211
319
  increases `k`. Reranking requires a scoring retrieval query, forbids `sort`,
@@ -294,7 +402,9 @@ MCP JSON Schema and actual tool-to-SDK HTTP path, including match-all, facet-onl
294
402
  document+facet, omitted/null/default bucket options, boundaries, invalid requests,
295
403
  and all 49 analyzers. Rerank tests cover JSON Schema, request preservation,
296
404
  local bounds/UTF-8 rejection, score envelopes, skipped/fallback results and
297
- metadata downloads. They do not require credentials
405
+ metadata downloads. Bayesian tests cover untouched free-form requests, candidate
406
+ budgets, server errors, native/legacy configurations and contradictory inputs.
407
+ They do not require credentials
298
408
  or create remote collections. `test:package` additionally installs the actual
299
409
  tarball in a clean consumer directory and repeats the tool contracts over real
300
410
  stdio, checking version identity, config errors, stdout and process termination.
@@ -340,9 +450,23 @@ Cleanup deletes the collection and verifies its absence even after a failed chec
340
450
  It does not assert fixed model scores or relevance rankings, and a fallback result
341
451
  does not pass as applied inference. Provider failures remain fixture tests; this
342
452
  suite does not deliberately induce failures or verify search quality, load,
343
- production deployment or billing readiness. Both live suites are outside default
453
+ production deployment or billing readiness. These live suites are outside default
344
454
  checks and credential-free CI.
345
455
 
456
+ Bayesian/native embedding verification also requires explicit managed inference
457
+ opt-in for OpenAI embeddings and TypeSafe reranking:
458
+
459
+ ```bash
460
+ LAMBDADB_RUN_LIVE_TESTS=1 LAMBDADB_RUN_LIVE_RERANK_TESTS=1 LAMBDADB_LIVE_CONFIRM_PROJECT=YOUR_DEV_PROJECT npm run test:live:bayesian
461
+ ```
462
+
463
+ This suite creates one owned collection with native, legacy and caller-provided
464
+ vector fields. It checks real embedding generation and text queries, Bayesian
465
+ budgets and server rejections, existing fusion methods, applied reranking with
466
+ retrieval scores and actual docsUrl hydration, then deletes and verifies absence.
467
+ These live suites are outside default checks and credential-free CI. Verify the
468
+ target's deployment provenance before running; the source pin alone is insufficient.
469
+
346
470
  If the environment file is outside the worktree:
347
471
 
348
472
  ```bash
package/RELEASING.md CHANGED
@@ -1,31 +1,35 @@
1
1
  # Releasing LambdaDB MCP
2
2
 
3
- ## Prepared stable candidate: 0.1.2 (2026-10-04 KST)
4
-
5
- [PR #11](https://github.com/lambdadb/lambdadb-mcp/pull/11) merged SDK 0.7.0,
6
- 49 fixed text analyzer presets and optional per-query managed reranking into
7
- develop at `99896e0279fa7610358e9abafc032dd507b10f40`. The
8
- [develop workflow](https://github.com/lambdadb/lambdadb-mcp/actions/runs/37189420462)
9
- completed and published `0.1.2-dev.9`. Registry metadata matches that commit and
10
- pins SDK 0.7.0; a downloaded tarball was integrity-checked and passed clean
11
- consumer stdio contracts. As verified on 2026-10-04, `latest` remains `0.1.1`.
12
-
13
- `release/0.1.2` prepares stable package/lock versions and a dated changelog for
14
- review into main. Source, tests, scripts and CI match the merged develop tree.
15
- Candidate validation is recorded in `docs/validation/2026-10-04-0.1.2.md`.
16
- Do not treat this preparation as a published stable release. Merge into main with
17
- a merge commit to retain ancestry, then obtain separate authorization to tag the
18
- verified main commit as `v0.1.2` and publish its GitHub Release. The release
19
- workflow tests its exact publication artifact before publishing to `latest`.
20
- After verification, synchronize main into develop through a PR with the next
21
- `0.1.3-dev.1` base; do not put stable version metadata on develop.
3
+ ## Current stable release: 0.1.2 (2026-10-04 KST)
4
+
5
+ [v0.1.2](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.2) tags main
6
+ commit `627ffbb3161bc3d41d5f2a5f2a0f5289fd73de3f`, which merged
7
+ [release PR #12](https://github.com/lambdadb/lambdadb-mcp/pull/12) with preserved
8
+ ancestry. The [release workflow](https://github.com/lambdadb/lambdadb-mcp/actions/runs/37191117220)
9
+ passed Node 22.14.0 / 22 / 24 validation and published its exact tested artifact
10
+ with OIDC and provenance. Registry snapshot: `latest=0.1.2`, `dev=0.1.2-dev.9`.
11
+ A downloaded stable tarball matched registry integrity, source commit and SDK
12
+ 0.7.0 and passed 31 clean-consumer stdio tests. Provenance statement repository,
13
+ workflow, tag, source commit and subject digest matched the publication.
14
+
15
+ SDK 0.7.0 adds 49 fixed text analyzer presets and optional per-query managed
16
+ reranking. Read-only defaults and explicit write opt-in remain. See
17
+ `docs/validation/2026-10-04-0.1.2.md` for separate candidate, authorized
18
+ source-build live, published dev and published stable evidence. Do not repeat the
19
+ 0.1.2 publication or move its tag.
20
+
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.
22
25
 
23
26
  Both live suites require explicit designation of a development project. Reranking
24
27
  also requires managed inference opt-in; no Jev API key is required. Live contract
25
28
  checks do not establish production deployment, search quality, load/failure
26
- coverage or billing readiness. Backend feature/model availability remains required.
29
+ coverage or billing readiness. Supporting backend deployment/model availability
30
+ and keyword-index requirements remain; existing collections/indexes are not migrated.
27
31
 
28
- ## Current stable release: 0.1.1 (2026-09-29 KST)
32
+ ## Previous stable release: 0.1.1 (2026-09-29 KST)
29
33
 
30
34
  [v0.1.1](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.1) tags main
31
35
  commit `40a8afc25bb93fb14d03d23e3ab38aa1924cf060`, which merged the reviewed release
@@ -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.2",
3
+ "version": "0.1.3-dev.11",
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": "627ffbb3161bc3d41d5f2a5f2a0f5289fd73de3f"
65
+ "gitHead": "bd1ae5547f868991a22c92b5a07849edfcf696fb"
65
66
  }