UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

28 lines (27 loc) • 1.39 kB
/** * Per-search retrieval planning. * * `RAGPipeline.query()` resolves four knobs — `topK`, `hybrid`, `graph`, * `rerank` — and every one of them is config with an optional per-call * override. Nothing inspects the query. The same plan is used for "what is * the refund window?" (one precise passage, an exact phrase worth matching * lexically) and "how does billing relate to entitlements?" (many passages, * relationships between documents). * * One decision request answers all four for the query in hand, in ~400ms. * Every answer is a *suggestion*: an explicit per-call option always wins, * and a capability the pipeline was not configured with can never be turned * on by a model — `graph: true` against a pipeline with no graph index would * be a failure, not a plan. * * @module rag/retrieval/searchDecision */ import type { DecisionCallerFn, SearchPlanCapabilities, SearchPlanResult } from "../../types/index.js"; /** * Ask how this particular query should be retrieved. * * Returns `null` when nothing should change — no decision provider, a failed * call, or an answer set that suggests nothing. Every returned field is * optional and means "use this unless the caller said otherwise". */ export declare function decideSearchPlan(query: string, decide: DecisionCallerFn, capabilities: SearchPlanCapabilities): Promise<SearchPlanResult | null>;