UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

28 lines • 1.59 kB
import type { Passage, RetrievalResult, RetrieveOptions, Retriever } from '../spi/retriever.js'; export interface HybridRetrieverOptions { /** RRF constant — larger flattens the rank weighting. Default 60 (the value from the original paper). */ k?: number; /** Candidates pulled from each retriever before fusion. Default 20. */ fetchTopK?: number; /** Per-retriever multipliers on each RRF contribution (same order as `retrievers`). Default all 1. */ weights?: number[]; } /** * Fuses several retrievers with Reciprocal Rank Fusion — the robust way to combine, say, dense vector * search with lexical BM25. RRF scores each passage by `Σ weight / (k + rank)` across the lists it * appears in, so it needs no score normalization between incompatible scales (cosine vs BM25). * Deduplicates by passage id, so aligned chunk ids from the two retrievers reinforce. Itself a * {@link Retriever}. Mirrors the reference `HybridRetriever` exactly. */ export declare class HybridRetriever implements Retriever { private readonly retrievers; private readonly options; constructor(retrievers: Retriever[], options?: HybridRetrieverOptions); retrieve(query: string, options?: RetrieveOptions): Promise<Passage[]>; /** * {@link HybridRetriever.retrieve} plus the embedding usage of every leg that reports one (summed), so * a hybrid over an embedding leg still reaches the ledger and the quota. */ retrieveWithUsage(query: string, options?: RetrieveOptions): Promise<RetrievalResult>; } //# sourceMappingURL=hybrid-retriever.d.ts.map