@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
21 lines • 1.15 kB
TypeScript
import type { Reranker } from '../spi/reranker.js';
import type { Passage, RetrieveOptions, Retriever } from '../spi/retriever.js';
export interface RerankingRetrieverOptions {
/** How many candidates to pull from the base retriever before reranking. Default 20. */
fetchTopK?: number;
}
/**
* Two-stage retrieval: over-fetch cheap candidates from a base {@link Retriever}, then reorder them with
* a stronger {@link Reranker} and keep the top few. The standard precision boost — a fast first stage
* casts a wide net, a slow accurate second stage sharpens it. Composes over ANY retriever (vector,
* hybrid, keyword), and is itself a `Retriever` so it drops straight into the config's `retriever` slot.
* Mirrors the reference `RerankingRetriever` exactly.
*/
export declare class RerankingRetriever implements Retriever {
private readonly base;
private readonly reranker;
private readonly options;
constructor(base: Retriever, reranker: Reranker, options?: RerankingRetrieverOptions);
retrieve(query: string, options?: RetrieveOptions): Promise<Passage[]>;
}
//# sourceMappingURL=reranking-retriever.d.ts.map