fix: align search_workers + match_contract + /match to ethereal_workers_v1
Same index↔dataset misalignment as the /search fix (423400e), in three more paths that pair the ethereal_workers SQL dataset with the workers_500k_v1 vector index: - search_workers MCP tool - match_contract MCP tool - /match HTTP handler All now default to ethereal_workers_v1 (same 10K id-space as the SQL table). Verified: /match role=Forklift Operator state=IL returns only IL forklift operators (sql_matches 94). rag_question / /ask left as-is — pure RAG, no SQL join, so no id-space to misalign. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
423400e843
commit
35a80a7306
@ -151,7 +151,9 @@ server.tool(
|
|||||||
},
|
},
|
||||||
async ({ question, sql_filter, dataset, id_column, top_k }) => {
|
async ({ question, sql_filter, dataset, id_column, top_k }) => {
|
||||||
const body: any = {
|
const body: any = {
|
||||||
question, index_name: "workers_500k_v1", filter_dataset: dataset, id_column, top_k, generate: true,
|
// Index must share an id-space with filter_dataset (default ethereal_workers, 10K)
|
||||||
|
// → ethereal_workers_v1. workers_500k_v1 (50K, different workers) misaligned.
|
||||||
|
question, index_name: "ethereal_workers_v1", filter_dataset: dataset, id_column, top_k, generate: true,
|
||||||
use_playbook_memory: true,
|
use_playbook_memory: true,
|
||||||
};
|
};
|
||||||
if (sql_filter) body.sql_filter = sql_filter;
|
if (sql_filter) body.sql_filter = sql_filter;
|
||||||
@ -185,7 +187,8 @@ server.tool(
|
|||||||
if (city) filter += ` AND city = '${city}'`;
|
if (city) filter += ` AND city = '${city}'`;
|
||||||
const r = await api("POST", "/vectors/hybrid", {
|
const r = await api("POST", "/vectors/hybrid", {
|
||||||
question: `Find the best ${role} workers with relevant skills and certifications`,
|
question: `Find the best ${role} workers with relevant skills and certifications`,
|
||||||
index_name: "workers_500k_v1", sql_filter: filter,
|
// ethereal_workers_v1 aligns with filter_dataset ethereal_workers (same 10K ids).
|
||||||
|
index_name: "ethereal_workers_v1", sql_filter: filter,
|
||||||
filter_dataset: "ethereal_workers", id_column: "worker_id",
|
filter_dataset: "ethereal_workers", id_column: "worker_id",
|
||||||
top_k: headcount * 2, generate: false,
|
top_k: headcount * 2, generate: false,
|
||||||
use_playbook_memory: true,
|
use_playbook_memory: true,
|
||||||
@ -556,7 +559,8 @@ async function main() {
|
|||||||
if (b.city) filter += ` AND city = '${b.city}'`;
|
if (b.city) filter += ` AND city = '${b.city}'`;
|
||||||
return ok(await api("POST", "/vectors/hybrid", {
|
return ok(await api("POST", "/vectors/hybrid", {
|
||||||
question: `Best ${b.role} workers with relevant skills`,
|
question: `Best ${b.role} workers with relevant skills`,
|
||||||
index_name: b.index || "workers_500k_v1", sql_filter: filter,
|
// Align default index with the ethereal_workers dataset (see /search fix).
|
||||||
|
index_name: b.index || "ethereal_workers_v1", sql_filter: filter,
|
||||||
filter_dataset: b.dataset || "ethereal_workers",
|
filter_dataset: b.dataset || "ethereal_workers",
|
||||||
id_column: "worker_id", top_k: (b.headcount || 5) * 2, generate: false,
|
id_column: "worker_id", top_k: (b.headcount || 5) * 2, generate: false,
|
||||||
use_playbook_memory: true,
|
use_playbook_memory: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user