# Component Bm25 Retriever

> Retrieve and rank title-and-text documents with a field-aware BM25F implementation. Use for exact names, identifiers, quotations, rare terms, and queries with reliable lexical overlap.

- Skill: `docailab/component-bm25-retriever` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add docailab/component-bm25-retriever`
- Raw SKILL.md: https://api.skillmd.com/api/skills/docailab/component-bm25-retriever/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: DocAILab (https://skillmd.com/u/docailab)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/docailab/component-bm25-retriever

---


# BM25F Retriever Component

Provide the `retriever` capability for an Agentic RAG slot.

## Interface

Input `RetrievalRequest`:

- `query`: retrieval query
- `documents`: JSON-compatible documents containing `id` and `text`
- `top_k`: maximum returned documents
- optional `k1` and `b` for saturation and body-length normalization
- optional `title_boost` and `title_b` for title weighting and normalization

Defaults are `top_k=10`, `k1=1.2`, `b=0.5`, `title_b=0.75`, and
`title_boost=3.0`. These are the B3 parameters selected by the frozen retrieval
benchmark; callers may override every value.

Output `RetrievalResult`:

- `documents`: ranked document dictionaries with BM25F `score`

## Execution

Run `scripts/component.py:run(inputs, context)`. Title and text term frequencies are
normalized against their own field lengths before being combined. This Component
performs retrieval only. Do not choose other Skills or generate an answer.

