@infino-ai/mcp-server 0.10.2 → 0.12.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 +5 -3
- package/dist/index.js +39 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -275,9 +275,9 @@ the data.
|
|
|
275
275
|
|
|
276
276
|
| Tool | Arguments | What it does |
|
|
277
277
|
| --- | --- | --- |
|
|
278
|
-
| `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `columns?`, `filter?` | Find passages by **meaning** — embeds the query with a local model (no key) and ranks by vector similarity. Handles paraphrase and synonyms. Optional `filter` (`{column, query, mode?}`) restricts the ranking to rows whose keyword column matches first (a pushdown pre-filter). Optional `columns` chooses which fields each hit returns (e.g. a path + line range to cite); defaults to the text column, with `_id` and `score` always included. |
|
|
279
|
-
| `infino_keyword_search` | `table`, `query`, `k`, `column?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. |
|
|
280
|
-
| `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `columns?` | **Fused** keyword + semantic search in one ranking pass — BM25 over the text column combined with vector similarity, so rows matching the literal terms *and* the meaning rank highest. |
|
|
278
|
+
| `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `columns?`, `filter?` | Find passages by **meaning** — embeds the query with a local model (no key) and ranks by vector similarity. Handles paraphrase and synonyms. `score` is a **distance** (lower is closer). Optional `filter` (`{column, query, mode?}`) restricts the ranking to rows whose keyword column matches first (a pushdown pre-filter). Optional `columns` chooses which fields each hit returns (e.g. a path + line range to cite); defaults to the text column, with `_id` and `score` always included. |
|
|
279
|
+
| `infino_keyword_search` | `table`, `query`, `k`, `column?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. `score` is a relevance (higher is better). |
|
|
280
|
+
| `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `columns?` | **Fused** keyword + semantic search in one ranking pass — BM25 over the text column combined with vector similarity, so rows matching the literal terms *and* the meaning rank highest. `score` is the fused rank (higher is better). |
|
|
281
281
|
| `infino_token_match` | `table`, `query`, `column?`, `mode?`, `limit?` | Unranked keyword filter — the set of rows whose text column contains the token(s). Use when you need the matches, not a relevance order. |
|
|
282
282
|
| `infino_exact_match` | `table`, `value`, `column?`, `limit?` | Unranked exact-equality filter over an indexed column (tag, status, id string). |
|
|
283
283
|
| `infino_count` | `table`, `query`, `column?`, `mode?` | Count how many rows match a keyword query, without fetching them — a fast tally over the text column. For the matching rows use `infino_keyword_search` or `infino_token_match`. |
|
|
@@ -288,6 +288,8 @@ the data.
|
|
|
288
288
|
| `infino_update_documents` | `table`, `predicate`, `documents` | Replace the rows matching a SQL predicate with new documents, 1:1 (missing vectors are embedded). Durable storage only. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
|
|
289
289
|
| `infino_delete_documents` | `table`, `predicate` | Delete the rows matching a SQL predicate. Durable storage only. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
|
|
290
290
|
|
|
291
|
+
Search hits return **full column values** — the `columns` argument is a projection passed straight to the engine (embedded or hosted), so any column in the table can come back with each hit: `["id"]` for compact hits at a large `k`, `["id", "text"]` for the full text alongside an id to cite, metadata columns for filtering. It defaults to the text column, with `_id` and `score` always included, and nothing is ever truncated; to keep results small, project fewer columns or ask for a smaller `k`. Every search response also carries `score_kind`, stating whether its `score` is a distance (semantic: lower is closer) or a relevance (keyword and hybrid: higher is better).
|
|
292
|
+
|
|
291
293
|
The engine's search table functions (`bm25_search`, `vector_search`, `hybrid_search`, …) are not callable from `infino_sql` — retrieval goes through the dedicated search tools above, which embed and project for you. `infino_sql` is for filters, joins, and aggregates.
|
|
292
294
|
|
|
293
295
|
---
|
package/dist/index.js
CHANGED
|
@@ -302,11 +302,20 @@ function searchProjection(columns, textCol) {
|
|
|
302
302
|
const base = columns && columns.length > 0 ? columns : textCol ? [textCol] : [];
|
|
303
303
|
return [...new Set([...base, "_id", "score"])];
|
|
304
304
|
}
|
|
305
|
+
// What a hit's `score` means differs per tool, and the direction flips: the
|
|
306
|
+
// engine reports vector kNN as a distance and BM25/RRF as relevance. Every
|
|
307
|
+
// search response says which, so a client never ranks or thresholds backwards.
|
|
308
|
+
const SCORE_KIND = {
|
|
309
|
+
semantic: "distance: lower is closer, 0 is an identical vector",
|
|
310
|
+
keyword: "bm25 relevance: higher is better",
|
|
311
|
+
hybrid: "reciprocal-rank fusion of keyword and semantic ranks: higher is better",
|
|
312
|
+
};
|
|
305
313
|
server.registerTool("infino_semantic_search", {
|
|
306
314
|
title: "Semantic (vector) search",
|
|
307
315
|
description: "Use when searching for a concept by meaning and the exact wording is unknown — this retrieves paraphrases and " +
|
|
308
316
|
"synonyms, not just literal matches. Embeds the query with a local model (no API key) and ranks a table's " +
|
|
309
|
-
"embedding column by vector similarity
|
|
317
|
+
"embedding column by vector similarity. Each hit carries a score that is a DISTANCE (lower is closer) plus the " +
|
|
318
|
+
"columns you project ('columns'; the full text column by default). Optional 'filter' restricts the ranking to rows " +
|
|
310
319
|
"whose keyword column matches a predicate first (a pushdown pre-filter, e.g. semantic search only within rows " +
|
|
311
320
|
"tagged 'billing'). For exact terms use infino_keyword_search; when the query has both literal terms and an " +
|
|
312
321
|
"intent use infino_hybrid_search.",
|
|
@@ -319,7 +328,7 @@ server.registerTool("infino_semantic_search", {
|
|
|
319
328
|
columns: z
|
|
320
329
|
.array(z.string())
|
|
321
330
|
.optional()
|
|
322
|
-
.describe("
|
|
331
|
+
.describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the text column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
|
|
323
332
|
filter: z
|
|
324
333
|
.object({
|
|
325
334
|
column: z.string().describe("Keyword-indexed (FTS) column the predicate applies to."),
|
|
@@ -342,7 +351,13 @@ server.registerTool("infino_semantic_search", {
|
|
|
342
351
|
const vector = await embed(query);
|
|
343
352
|
const projection = searchProjection(columns, textCol);
|
|
344
353
|
const { value: results, tookMs } = timed(() => handle.vectorSearch(vecCol, vector, k, { projection, filter }));
|
|
345
|
-
return ok({
|
|
354
|
+
return ok({
|
|
355
|
+
table,
|
|
356
|
+
query,
|
|
357
|
+
score_kind: SCORE_KIND.semantic,
|
|
358
|
+
results,
|
|
359
|
+
took_ms: tookMs,
|
|
360
|
+
});
|
|
346
361
|
}
|
|
347
362
|
catch (err) {
|
|
348
363
|
return fail(`semantic_search failed: ${errText(err)}`);
|
|
@@ -352,7 +367,8 @@ server.registerTool("infino_keyword_search", {
|
|
|
352
367
|
title: "Keyword (BM25) search",
|
|
353
368
|
description: "Use when the query is literal terms — identifiers, error codes, product names, exact phrases — and you want " +
|
|
354
369
|
"results ranked by relevance. BM25 full-text search over a text column: ranks rows by how well the query's " +
|
|
355
|
-
"tokens (and their stems) match, each with a relevance score
|
|
370
|
+
"tokens (and their stems) match, each with a relevance score (higher is better) plus the columns you project " +
|
|
371
|
+
"('columns'; the full text column by default). Matches exact tokens, not synonyms or paraphrases. " +
|
|
356
372
|
"Prefer this over SQL LIKE for known literal terms. For meaning-based search use infino_semantic_search; for " +
|
|
357
373
|
"both at once use infino_hybrid_search.",
|
|
358
374
|
inputSchema: {
|
|
@@ -366,7 +382,7 @@ server.registerTool("infino_keyword_search", {
|
|
|
366
382
|
columns: z
|
|
367
383
|
.array(z.string())
|
|
368
384
|
.optional()
|
|
369
|
-
.describe("
|
|
385
|
+
.describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the searched column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
|
|
370
386
|
},
|
|
371
387
|
}, async ({ table, query, k, column, columns }) => {
|
|
372
388
|
try {
|
|
@@ -376,7 +392,14 @@ server.registerTool("infino_keyword_search", {
|
|
|
376
392
|
return fail(`keyword_search: no text column found in '${table}' — pass 'column' explicitly.`);
|
|
377
393
|
}
|
|
378
394
|
const { value: results, tookMs } = timed(() => handle.bm25Search(col, query, k, { projection: searchProjection(columns, col) }));
|
|
379
|
-
return ok({
|
|
395
|
+
return ok({
|
|
396
|
+
table,
|
|
397
|
+
column: col,
|
|
398
|
+
query,
|
|
399
|
+
score_kind: SCORE_KIND.keyword,
|
|
400
|
+
results,
|
|
401
|
+
took_ms: tookMs,
|
|
402
|
+
});
|
|
380
403
|
}
|
|
381
404
|
catch (err) {
|
|
382
405
|
return fail(`keyword_search failed: ${errText(err)}`);
|
|
@@ -386,7 +409,8 @@ server.registerTool("infino_hybrid_search", {
|
|
|
386
409
|
title: "Hybrid (keyword + semantic) search",
|
|
387
410
|
description: "Use when a query carries both specific terms and an intent — you want exact-term precision without giving up " +
|
|
388
411
|
"paraphrase recall. Fuses BM25 over a text column with vector similarity over the embedding column in a single " +
|
|
389
|
-
"ranking pass, so rows matching the literal terms AND the meaning rank highest
|
|
412
|
+
"ranking pass, so rows matching the literal terms AND the meaning rank highest; the score is the fused rank " +
|
|
413
|
+
"(higher is better) plus the columns you project ('columns'; the full text column by default). Embeds the query with a local " +
|
|
390
414
|
"model (no API key). Sits between infino_keyword_search (literal only) and infino_semantic_search (meaning only).",
|
|
391
415
|
inputSchema: {
|
|
392
416
|
table: z.string().describe("Table to search."),
|
|
@@ -397,7 +421,7 @@ server.registerTool("infino_hybrid_search", {
|
|
|
397
421
|
columns: z
|
|
398
422
|
.array(z.string())
|
|
399
423
|
.optional()
|
|
400
|
-
.describe("
|
|
424
|
+
.describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the text column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
|
|
401
425
|
},
|
|
402
426
|
}, async ({ table, query, k, column, vectorColumn, columns }) => {
|
|
403
427
|
try {
|
|
@@ -412,7 +436,13 @@ server.registerTool("infino_hybrid_search", {
|
|
|
412
436
|
const { value: results, tookMs } = timed(() => handle.hybridSearch(textCol, query, vecCol, vector, k, {
|
|
413
437
|
projection: searchProjection(columns, textCol),
|
|
414
438
|
}));
|
|
415
|
-
return ok({
|
|
439
|
+
return ok({
|
|
440
|
+
table,
|
|
441
|
+
query,
|
|
442
|
+
score_kind: SCORE_KIND.hybrid,
|
|
443
|
+
results,
|
|
444
|
+
took_ms: tookMs,
|
|
445
|
+
});
|
|
416
446
|
}
|
|
417
447
|
catch (err) {
|
|
418
448
|
return fail(`hybrid_search failed: ${errText(err)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infino-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "MCP server for Infino — keyword, vector, hybrid, and SQL retrieval over data on object storage, for AI agents.",
|
|
5
5
|
"mcpName": "io.github.infino-ai/mcp-server",
|
|
6
6
|
"license": "Apache-2.0",
|