Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/memory / / ReRanker

Interface: ReRanker

Defined in: packages/memory/src/search/types.ts:17

Pluggable reranker contract. Concrete implementations live in @graphorin/memory/search (the built-in RRFReranker) and the Phase 16 optional packages (@graphorin/reranker-transformersjs, @graphorin/reranker-llm).

The reranker accepts one or more parallel ranked lists (vector + FTS5 + optional entity boost) and produces a single fused ranking. Implementations MUST be pure (no I/O outside signal-aware dependencies) so the agent runtime can call them mid-stream without deadlocking the main loop.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
idreadonlystringStable lowercase identifier surfaced on every span.packages/memory/src/search/types.ts:19

Methods

rerank()

ts
rerank<TRecord>(
   query, 
   lists, 
options?): Promise<readonly MemoryHit<TRecord>[]>;

Defined in: packages/memory/src/search/types.ts:25

Rerank one or more parallel ranked lists and return the fused top-K (default topK = 10). Each input list must already be sorted by score descending.

Type Parameters

Type Parameter
TRecord extends MemoryRecord

Parameters

ParameterType
querystring
listsreadonly readonly MemoryHit&lt;TRecord&gt;[][]
options?ReRankOptions

Returns

Promise<readonly MemoryHit&lt;TRecord&gt;[]>