|
@@ -1745,6 +1745,7 @@ type OutputOptions = {
|
|
|
context?: string; // Optional context for query expansion
|
|
context?: string; // Optional context for query expansion
|
|
|
candidateLimit?: number; // Max candidates to rerank (default: 40)
|
|
candidateLimit?: number; // Max candidates to rerank (default: 40)
|
|
|
intent?: string; // Domain intent for disambiguation
|
|
intent?: string; // Domain intent for disambiguation
|
|
|
|
|
+ skipRerank?: boolean; // Skip LLM reranking, use RRF scores only
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Highlight query terms in text (skip short words < 3 chars)
|
|
// Highlight query terms in text (skip short words < 3 chars)
|
|
@@ -2227,6 +2228,7 @@ async function querySearch(query: string, opts: OutputOptions, _embedModel: stri
|
|
|
limit: opts.all ? 500 : (opts.limit || 10),
|
|
limit: opts.all ? 500 : (opts.limit || 10),
|
|
|
minScore: opts.minScore || 0,
|
|
minScore: opts.minScore || 0,
|
|
|
candidateLimit: opts.candidateLimit,
|
|
candidateLimit: opts.candidateLimit,
|
|
|
|
|
+ skipRerank: opts.skipRerank,
|
|
|
explain: !!opts.explain,
|
|
explain: !!opts.explain,
|
|
|
intent,
|
|
intent,
|
|
|
hooks: {
|
|
hooks: {
|
|
@@ -2253,6 +2255,7 @@ async function querySearch(query: string, opts: OutputOptions, _embedModel: stri
|
|
|
limit: opts.all ? 500 : (opts.limit || 10),
|
|
limit: opts.all ? 500 : (opts.limit || 10),
|
|
|
minScore: opts.minScore || 0,
|
|
minScore: opts.minScore || 0,
|
|
|
candidateLimit: opts.candidateLimit,
|
|
candidateLimit: opts.candidateLimit,
|
|
|
|
|
+ skipRerank: opts.skipRerank,
|
|
|
explain: !!opts.explain,
|
|
explain: !!opts.explain,
|
|
|
intent,
|
|
intent,
|
|
|
hooks: {
|
|
hooks: {
|
|
@@ -2367,6 +2370,7 @@ function parseCLI() {
|
|
|
"line-numbers": { type: "boolean" }, // add line numbers to output
|
|
"line-numbers": { type: "boolean" }, // add line numbers to output
|
|
|
// Query options
|
|
// Query options
|
|
|
"candidate-limit": { type: "string", short: "C" },
|
|
"candidate-limit": { type: "string", short: "C" },
|
|
|
|
|
+ "no-rerank": { type: "boolean", default: false },
|
|
|
intent: { type: "string" },
|
|
intent: { type: "string" },
|
|
|
// MCP HTTP transport options
|
|
// MCP HTTP transport options
|
|
|
http: { type: "boolean" },
|
|
http: { type: "boolean" },
|
|
@@ -2406,6 +2410,7 @@ function parseCLI() {
|
|
|
collection: values.collection as string[] | undefined,
|
|
collection: values.collection as string[] | undefined,
|
|
|
lineNumbers: !!values["line-numbers"],
|
|
lineNumbers: !!values["line-numbers"],
|
|
|
candidateLimit: values["candidate-limit"] ? parseInt(String(values["candidate-limit"]), 10) : undefined,
|
|
candidateLimit: values["candidate-limit"] ? parseInt(String(values["candidate-limit"]), 10) : undefined,
|
|
|
|
|
+ skipRerank: !!values["no-rerank"],
|
|
|
explain: !!values.explain,
|
|
explain: !!values.explain,
|
|
|
intent: values.intent as string | undefined,
|
|
intent: values.intent as string | undefined,
|
|
|
};
|
|
};
|
|
@@ -2624,6 +2629,7 @@ function showHelp(): void {
|
|
|
console.log(" --min-score <num> - Minimum similarity score");
|
|
console.log(" --min-score <num> - Minimum similarity score");
|
|
|
console.log(" --full - Output full document instead of snippet");
|
|
console.log(" --full - Output full document instead of snippet");
|
|
|
console.log(" -C, --candidate-limit <n> - Max candidates to rerank (default 40, lower = faster)");
|
|
console.log(" -C, --candidate-limit <n> - Max candidates to rerank (default 40, lower = faster)");
|
|
|
|
|
+ console.log(" --no-rerank - Skip LLM reranking (use RRF scores only, much faster on CPU)");
|
|
|
console.log(" --line-numbers - Include line numbers in output");
|
|
console.log(" --line-numbers - Include line numbers in output");
|
|
|
console.log(" --explain - Include retrieval score traces (query --json/CLI)");
|
|
console.log(" --explain - Include retrieval score traces (query --json/CLI)");
|
|
|
console.log(" --files | --json | --csv | --md | --xml - Output format");
|
|
console.log(" --files | --json | --csv | --md | --xml - Output format");
|