@functional-systems/lambdadb-mcp 0.1.2-dev.8 → 0.1.2

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,22 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.2] - 2026-10-04
6
+
7
+ - Pin the LambdaDB TypeScript SDK to 0.7.0 and expose all 49 fixed lowercase
8
+ analyzer presets in collection-tool guidance; preserve analyzer serialization.
9
+ - Add optional per-query managed reranking to the MCP schema and SDK request path,
10
+ preserving omission/null, distinct sizes, custom criteria, envelope scores and
11
+ status metadata, including document downloads. Retain SDK validation and errors.
12
+ - Extend local and installed-package contracts for analyzer expansion and reranking;
13
+ update the opt-in live analyzer check to cover all 49 names.
14
+ - Add a separate opt-in managed-reranking live suite for real default/custom
15
+ inference, empty candidates, omitted/null behavior and docsUrl envelope
16
+ preservation, with owned-resource cleanup and no fixed relevance expectations.
17
+ - Native SDK usage is unchanged; no Qdrant mapping exists in this server. Supporting
18
+ backend deployment/model availability remains required; existing MCP installations
19
+ require a version containing these changes.
20
+
5
21
  ## [0.1.1] - 2026-09-29
6
22
 
7
23
  - Pin the LambdaDB TypeScript SDK to 0.6.0, including all 16 text analyzers.
package/README.md CHANGED
@@ -14,14 +14,16 @@ 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-09-29 (KST),
18
- `latest` resolves to `0.1.1` and `dev` to `0.1.1-dev.7`. Use an exact version for
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
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) is published
23
- with SDK 0.6.0, keyword facets, match-all queries, and 16 text analyzers. Develop
24
- starts the next `0.1.2-dev.1` base; check npm for the current published dev version.
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`.
25
27
  Existing installations need an MCP version containing these changes; upgrading
26
28
  the SDK separately does not update them.
27
29
 
@@ -101,9 +103,8 @@ Optional write tools:
101
103
 
102
104
  ## API contract and tool inputs
103
105
 
104
- The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.6.0`, checked against
105
- the published package and [v0.6.0 release](https://github.com/lambdadb/lambdadb-typescript-client/releases/tag/v0.6.0)
106
- at [`491d01e`](https://github.com/lambdadb/lambdadb-typescript-client/commit/491d01e0eb54bd135823fab79cbe32396ec03691).
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
108
  This dependency update applies to builds containing this change. Publishing the SDK
108
109
  alone does not update previously published or installed MCP packages.
109
110
 
@@ -173,6 +174,69 @@ This MCP update does not migrate existing Collections or indexes. Partial update
173
174
  segment merging, and old Tags do not upgrade old indexes. If migration is needed,
174
175
  plan and authorize reinsertion into a new Collection separately.
175
176
 
177
+ ### Optional managed reranking
178
+
179
+ `lambdadb_query_collection` accepts per-query `rerank`; omission or `null`
180
+ preserves existing searches. Collection creation has no rerank setting.
181
+ LambdaDB manages provider credentials; only the existing project API key is needed.
182
+ See the [managed reranking contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.7.0/docs/managed-reranking.md).
183
+
184
+ ```json
185
+ {
186
+ "collectionName": "articles",
187
+ "size": 10,
188
+ "query": { "knn": { "field": "bodyEmbedding", "queryText": "Restore a collection", "k": 50 } },
189
+ "fields": { "include": ["id", "title"] },
190
+ "rerank": {
191
+ "provider": "typesafe",
192
+ "model": "jev-1.13.0",
193
+ "queryText": "Restore a collection",
194
+ "fields": ["title", "body"],
195
+ "candidateSize": 50,
196
+ "onFailure": "error"
197
+ }
198
+ }
199
+ ```
200
+
201
+ Provider/model are fixed. `queryText` is required nonblank text, at most 8 KiB
202
+ UTF-8, even with raw vectors. Rerank `fields` selects 1–8 unique stored scalar
203
+ text paths in input order, independently of returned document projection.
204
+ Optional `criteria` replaces the default with 2–10 distinct nonblank descriptions
205
+ ordered from lowest to highest relevance (2 KiB each, 8 KiB total UTF-8).
206
+ Omitted/null criteria uses defaults; text, order, nulls and omission are preserved.
207
+
208
+ Final `size`, vector-leg `knn.k`, and merged `candidateSize` are separate.
209
+ Require `1 <= size <= candidateSize <= 100`; omitted/null candidateSize defaults
210
+ on the server to `max(50, size)`, with final size defaulting to 10. MCP never
211
+ increases `k`. Reranking requires a scoring retrieval query, forbids `sort`,
212
+ match-all and filter-only Boolean requests, and preserves ref/consistentRead
213
+ restrictions. It does not enable vector/hybrid facets; supported lexical facets
214
+ still count all matches. Field types, candidate text and model availability
215
+ remain server validations.
216
+
217
+ Results retain server order, precision and zero. Applied envelope `score` is the
218
+ final evaluation score in [0,1], not a probability; envelope `retrievalScore`
219
+ retains the search score. Top-level `rerank` retains status (`applied`, `skipped`,
220
+ `fallback`), provider/model, optional resolvedModel, counts, stage took, optional
221
+ criteriaVersion and reason. Applied criteriaVersion is `default-relevance-v1`
222
+ or `custom`; `custom` is not a unique rubric identity. `maxScore` retains zero;
223
+ empty results omit it and report skipped/noCandidates with zero counts.
224
+ Without reranking, rerank metadata and retrievalScore are absent. Metadata and
225
+ scores survive `docsUrl` downloads.
226
+
227
+ Omitted/null `onFailure` defaults to `error`. `returnOriginal` applies only to
228
+ provider timeout, rateLimit, unavailable, invalidResponse and credentials failures.
229
+ Fallback retains retrieval order/scores for the first size documents, discards
230
+ partial evaluation scores and omits retrievalScore/criteriaVersion. Invalid
231
+ input/candidates, disabled models, authorization, retrieval/hydration/ref, quota
232
+ and capacity failures remain errors; cancellation or an exhausted deadline does
233
+ not trigger fallback. A hybrid fallback can differ from a separate query with
234
+ a smaller candidate cap. No extra client fallback is implemented.
235
+
236
+ SDK publication and local fixtures do not establish deployment to an endpoint,
237
+ search quality, load/failure coverage or billing readiness. Backend feature/model
238
+ availability and operational verification remain separate dependencies.
239
+
176
240
  ### Text analyzers in collection creation
177
241
 
178
242
  With write tools explicitly enabled, `lambdadb_create_collection` accepts:
@@ -190,12 +254,29 @@ With write tools explicitly enabled, `lambdadb_create_collection` accepts:
190
254
 
191
255
  Supported lowercase names: `standard`, `english`, `korean`, `japanese`, `chinese`,
192
256
  `cjk`, `arabic`, `french`, `german`, `hindi`, `indonesian`, `italian`, `portuguese`,
193
- `russian`, `spanish`, `turkish`. Omitting `analyzers` uses the server default
257
+ `russian`, `spanish`, `turkish`, `armenian`, `basque`, `bengali`, `brazilian`,
258
+ `bulgarian`, `catalan`, `czech`, `danish`, `dutch`, `estonian`, `finnish`, `galician`,
259
+ `greek`, `hungarian`, `irish`, `latvian`, `lithuanian`, `norwegian`, `persian`,
260
+ `romanian`, `serbian`, `sorani`, `swedish`, `thai`, `simple`, `whitespace`, `stop`,
261
+ `keyword`, `pattern`, `fingerprint`, `nepali`, `tamil`, `telugu` (49 total).
262
+ Omitting `analyzers` uses the server default
194
263
  `["standard"]`; an empty list is passed through and does not select that default.
195
264
  Analyzers run independently without automatic language detection. Lists are sent
196
265
  unchanged; avoid duplicate names, which the server rejects. Index configuration
197
266
  validation remains in the SDK. Write tools remain disabled by default.
198
267
 
268
+ These are fixed presets with backend default settings; custom pipelines/options
269
+ are unsupported. The `keyword` analyzer keeps text in one token and is distinct
270
+ from the `keyword` field type used for sorting/facets. Nepali, Tamil and Telugu
271
+ are Lucene extensions, not common Elasticsearch/OpenSearch support. New presets
272
+ require a supporting backend deployment. See the [analyzer contract](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.7.0/docs/models/analyzer.md).
273
+
274
+ This repository uses the native SDK only and has no Qdrant payload-schema mapping.
275
+ The SDK's [Qdrant adapter](https://github.com/lambdadb/lambdadb-typescript-client/blob/v0.7.0/docs/compatibility/qdrant.md)
276
+ now rejects extra schema options with `UnsupportedQdrantFeatureError`. Its mapping
277
+ remains type-only; text omits analyzers for the standard default. Migration callers
278
+ must reject or explicitly resolve unsupported options rather than discard them.
279
+
199
280
  ## Tests
200
281
 
201
282
  ```bash
@@ -211,7 +292,9 @@ HTTP 201, ref/branch forwarding, invalid combinations, pagination, and `docsUrl`
211
292
  arrays/errors and local environment-file loading. Facet tests validate the published
212
293
  MCP JSON Schema and actual tool-to-SDK HTTP path, including match-all, facet-only,
213
294
  document+facet, omitted/null/default bucket options, boundaries, invalid requests,
214
- and all 16 analyzers. They do not require credentials
295
+ and all 49 analyzers. Rerank tests cover JSON Schema, request preservation,
296
+ local bounds/UTF-8 rejection, score envelopes, skipped/fallback results and
297
+ metadata downloads. They do not require credentials
215
298
  or create remote collections. `test:package` additionally installs the actual
216
299
  tarball in a clean consumer directory and repeats the tool contracts over real
217
300
  stdio, checking version identity, config errors, stdout and process termination.
@@ -229,7 +312,7 @@ LAMBDADB_RUN_LIVE_TESTS=1 LAMBDADB_LIVE_CONFIRM_PROJECT=YOUR_DEV_PROJECT npm run
229
312
 
230
313
  The live test creates one uniquely named temporary collection, checks real HTTP
231
314
  201/202 responses, metadata, pagination, filters, sorting, and Branch/Tag/Alias
232
- reads. It also checks all 16 analyzers in collection metadata, match-all, facet-only
315
+ reads. It also checks all 49 analyzers in collection metadata, match-all, facet-only
233
316
  and document+facet results, default/null bucket size, keyword arrays, dotted paths,
234
317
  and facet preservation across refs and `docsUrl` downloads. The designated server
235
318
  must support these features. It writes two 3 MiB documents to force actual `docsUrl` array downloads
@@ -239,6 +322,27 @@ temporary collection in cleanup, and verifies that the collection is absent.
239
322
  Branch/Tag/Alias setup and collection cleanup use the SDK directly because these
240
323
  operations are not exposed as MCP tools. This test is separate from `npm run check`.
241
324
 
325
+ Managed reranking has a separate live suite because it requires an enabled
326
+ `typesafe` / `jev-1.13.0` model and can incur inference cost. Use the same explicitly
327
+ authorized development project and write opt-in, with an additional inference opt-in:
328
+
329
+ ```bash
330
+ LAMBDADB_RUN_LIVE_TESTS=1 LAMBDADB_RUN_LIVE_RERANK_TESTS=1 LAMBDADB_LIVE_CONFIRM_PROJECT=YOUR_DEV_PROJECT npm run test:live:rerank
331
+ ```
332
+
333
+ It creates one temporary collection and two synthetic documents. It verifies
334
+ omitted/null retrieval behavior, applied default and custom criteria, final size
335
+ versus candidate count, envelope evaluation/retrieval scores, inline and actual
336
+ `docsUrl` order/precision/metadata preservation, download credential isolation,
337
+ and empty `skipped` results. Only short stored text is sent for evaluation; the
338
+ large synthetic payload forces document offload without enlarging model input.
339
+ Cleanup deletes the collection and verifies its absence even after a failed check.
340
+ It does not assert fixed model scores or relevance rankings, and a fallback result
341
+ does not pass as applied inference. Provider failures remain fixture tests; this
342
+ suite does not deliberately induce failures or verify search quality, load,
343
+ production deployment or billing readiness. Both live suites are outside default
344
+ checks and credential-free CI.
345
+
242
346
  If the environment file is outside the worktree:
243
347
 
244
348
  ```bash
package/RELEASING.md CHANGED
@@ -1,5 +1,30 @@
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.
22
+
23
+ Both live suites require explicit designation of a development project. Reranking
24
+ also requires managed inference opt-in; no Jev API key is required. Live contract
25
+ checks do not establish production deployment, search quality, load/failure
26
+ coverage or billing readiness. Backend feature/model availability remains required.
27
+
3
28
  ## Current stable release: 0.1.1 (2026-09-29 KST)
4
29
 
5
30
  [v0.1.1](https://github.com/lambdadb/lambdadb-mcp/releases/tag/v0.1.1) tags main
@@ -14,10 +39,9 @@ See `docs/validation/2026-09-29-0.1.1.md` in this source for separate candidate,
14
39
  development-service, and published-package evidence. Do not repeat the 0.1.1
15
40
  publication or move its tag.
16
41
 
17
- This synchronization brings main back into develop with the next base
18
- `0.1.2-dev.1`. Review it into develop using a merge commit to preserve ancestry.
19
- Eligible develop merges may publish a new dev version while `latest` stays on
20
- 0.1.1. Do not merge stable version metadata directly into develop.
42
+ The 0.1.1 synchronization is complete: main was brought back into develop with
43
+ the `0.1.2-dev.1` base through PR #10. Eligible develop merges publish dev versions
44
+ while leaving `latest` on 0.1.1 until an explicitly published stable release.
21
45
  Facets need a supporting server and newly built keyword indexes; this release
22
46
  does not migrate existing Collections or indexes.
23
47
 
@@ -9,6 +9,21 @@ const facetsSchema = z.record(z.string(), z.strictObject({
9
9
  // Zod refinements are not represented in JSON Schema without explicit metadata.
10
10
  .meta({ maxProperties: 5 })
11
11
  .describe("Keyword field names (including dotted paths) mapped to bucket options. Requires newly built keyword indexes on a supporting server.");
12
+ // The SDK validates UTF-8 byte budgets, nonblank text, unique paths/criteria,
13
+ // scoring-query requirements and cross-field bounds before sending HTTP.
14
+ const rerankSchema = z.strictObject({
15
+ provider: z.literal("typesafe"),
16
+ model: z.literal("jev-1.13.0"),
17
+ queryText: z.string().min(1).describe("Required nonblank query text, at most 8 KiB UTF-8, including for raw vector queries."),
18
+ fields: z.array(z.string().min(1)).min(1).max(8).meta({ uniqueItems: true })
19
+ .describe("Unique stored scalar text paths in model input order; separate from returned fields projection."),
20
+ candidateSize: z.number().int().min(1).max(100).nullable().optional()
21
+ .describe("Merged candidate cap, at least final size. Omitted/null defaults to max(50, size); never changes knn.k."),
22
+ onFailure: z.enum(["error", "returnOriginal"]).nullable().optional()
23
+ .describe("Omitted/null defaults to error. returnOriginal covers only eligible provider failures."),
24
+ criteria: z.array(z.string().min(1)).min(2).max(10).meta({ uniqueItems: true }).nullable().optional()
25
+ .describe("Distinct nonblank descriptions from lowest to highest relevance, at most 2 KiB each and 8 KiB total UTF-8. Omitted/null uses defaults.")
26
+ }).nullable().optional().describe("Optional per-query managed reranking; requires a scoring query and positive size, forbids sort. LambdaDB manages provider credentials.");
12
27
  export function registerReadTools(server, config) {
13
28
  server.registerTool("lambdadb_list_collections", {
14
29
  title: "List Collections",
@@ -53,7 +68,7 @@ export function registerReadTools(server, config) {
53
68
  });
54
69
  server.registerTool("lambdadb_query_collection", {
55
70
  title: "Query Collection",
56
- description: "Search documents and optionally return keyword facet counts across all matches. Omit query for match-all; size: 0 requires at least one facet and returns only facets. Facets require a supporting server and newly built keyword indexes.",
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.",
57
72
  annotations: {
58
73
  readOnlyHint: true,
59
74
  openWorldHint: false
@@ -64,6 +79,7 @@ export function registerReadTools(server, config) {
64
79
  .describe("Documents to return (1–100), or 0 with nonempty facets."),
65
80
  query: z.record(z.string(), z.any()).optional().describe("Omit for match-all."),
66
81
  facets: facetsSchema.optional(),
82
+ rerank: rerankSchema,
67
83
  ref: readRefSchema.optional(),
68
84
  consistentRead: z.boolean().optional().describe("true requires a direct branch ref or omitted ref (main)."),
69
85
  includeVectors: z.boolean().optional(),
@@ -80,14 +96,22 @@ export function registerReadTools(server, config) {
80
96
  allOf: [{
81
97
  if: { properties: { size: { const: 0 } }, required: ["size"] },
82
98
  then: { required: ["facets"], properties: { facets: { minProperties: 1 } } }
99
+ }, {
100
+ if: { properties: { rerank: { type: "object" } }, required: ["rerank"] },
101
+ then: {
102
+ required: ["query"],
103
+ properties: { size: { minimum: 1 } },
104
+ not: { required: ["sort"] }
105
+ }
83
106
  }]
84
107
  })
85
- }, async ({ collectionName, size, query, facets, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
108
+ }, async ({ collectionName, size, query, facets, rerank, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
86
109
  try {
87
110
  const client = createLambdaDBClient(config);
88
111
  const input = {
89
112
  query,
90
113
  facets,
114
+ rerank,
91
115
  size,
92
116
  ...readOptions(ref, consistentRead),
93
117
  includeVectors,
@@ -1,3 +1,4 @@
1
+ import { Analyzer } from "@functional-systems/lambdadb/models";
1
2
  import { z } from "zod";
2
3
  import { createLambdaDBClient } from "../lambdadb/client.js";
3
4
  import { formatLambdaDBError } from "../lambdadb/errors.js";
@@ -5,7 +6,7 @@ import { jsonResult, nameSchema, partitionFilterSchema } from "./shared.js";
5
6
  export function registerWriteTools(server, config) {
6
7
  server.registerTool("lambdadb_create_collection", {
7
8
  title: "Create Collection",
8
- description: "Create a new collection in the configured project. Text index analyzers: standard, english, korean, japanese, chinese, cjk, arabic, french, german, hindi, indonesian, italian, portuguese, russian, spanish, turkish. 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.`,
9
10
  annotations: {
10
11
  openWorldHint: false
11
12
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functional-systems/lambdadb-mcp",
3
- "version": "0.1.2-dev.8",
3
+ "version": "0.1.2",
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:rerank": "npm run build && bash ./scripts/with-env.sh --test test/integration/rerank-live.test.mjs",
14
15
  "test:live": "npm run build && bash ./scripts/with-env.sh --test test/integration/live.test.mjs",
15
16
  "dev": "tsx watch src/index.ts",
16
17
  "inspect": "bash ./scripts/inspect.sh",
@@ -22,7 +23,7 @@
22
23
  "test:package": "node scripts/test-package.mjs"
23
24
  },
24
25
  "dependencies": {
25
- "@functional-systems/lambdadb": "0.6.0",
26
+ "@functional-systems/lambdadb": "0.7.0",
26
27
  "@modelcontextprotocol/sdk": "1.29.0",
27
28
  "zod": "^4.1.12"
28
29
  },
@@ -60,5 +61,5 @@
60
61
  "access": "public",
61
62
  "registry": "https://registry.npmjs.org"
62
63
  },
63
- "gitHead": "e706cf744d21ded011853ac6ffb34409e739de36"
64
+ "gitHead": "627ffbb3161bc3d41d5f2a5f2a0f5289fd73de3f"
64
65
  }