Skip to content

API Reference parrot.rerankers

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.rerankers

View source

Reranker subsystem for AI-Parrot.

This package provides cross-encoder and LLM-based reranking for the RAG retrieval pipeline. Rerankers sit between the vector-store retrieval step and the LLM prompt assembly step, scoring (query, passage) pairs jointly to produce a more accurate relevance ranking than cosine similarity alone.

PEP 420 namespace merging: extend_path allows satellite distributions (e.g. ai-parrot-embeddings) to contribute concrete backend modules to the parrot.rerankers namespace (local.py, llm.py).

Public API:

>>> from parrot.rerankers import (
...     AbstractReranker,
...     LocalCrossEncoderReranker,
...     LLMReranker,
...     RerankedDocument,
...     RerankerConfig,
... )

Lazy imports:

``LocalCrossEncoderReranker`` and ``LLMReranker`` are imported lazily
to avoid loading ``transformers`` / ``torch`` at Python startup.  Only
``AbstractReranker``, ``RerankedDocument``, and ``RerankerConfig`` are
imported eagerly because they are lightweight (Pydantic + ABC only).

Alias AbstractReranker

Re-exported from parrot.rerankers.abstract.AbstractReranker.

Alias RerankedDocument

Re-exported from parrot.rerankers.models.RerankedDocument.

Alias RerankerConfig

Re-exported from parrot.rerankers.models.RerankerConfig.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally