Skip to content

Conversation

@pingSubhajit
Copy link
Contributor

Summary

This PR introduces the reranker battery, a new feature that enables two-stage retrieval with optional reranking for improved search precision. It includes Cohere integration as the default provider and support for custom rerankers.

Changes

New Features

Reranker Battery (packages/unrag/registry/rerank/)

  • Added createCohereReranker() for Cohere rerank-v3.5 model integration with configurable model, API key, and batch size
  • Added createCustomReranker() for custom reranker implementations
  • Added core rerank() method to the context engine for post-retrieval reranking
  • New types: Reranker, RerankerRerankArgs, RerankerRerankResult, CohereRerankerConfig, CustomRerankerConfig

CLI Updates

  • Extended unrag add command to support battery type installations
  • Added battery-specific dependency management in packageJson.ts
  • Updated manifest handling to support battery registry items

Documentation

  • New /docs/batteries/ section with comprehensive reranker documentation
  • Added proper type reference tables across multiple documentation pages:
    • Connectors: Google Drive API, Notion API
    • Providers: Custom providers
    • Guides: Build a search endpoint, Use with chat
    • Concepts: Architecture, Context engine, Performance
    • Getting started: Installation, Quickstart
    • Reference: CLI

Tests

Added comprehensive test coverage for reranking functionality:

  • core-rerank-basic.test.ts - Basic reranking operations
  • core-rerank-missing-reranker.test.ts - Error handling when reranker is not configured
  • core-rerank-missing-text.test.ts - Handling of chunks with missing text content
  • core-rerank-stability.test.ts - Stability and ordering guarantees

Installation

bunx unrag@latest add battery reranker

@pingSubhajit pingSubhajit self-assigned this Jan 9, 2026
@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
unrag-web Ready Ready Preview, Comment Jan 9, 2026 8:28am

@pingSubhajit pingSubhajit merged commit 918ba85 into release/v0.2.8 Jan 9, 2026
3 checks passed
@pingSubhajit pingSubhajit deleted the feat/reranker-battery branch January 9, 2026 08:29
pingSubhajit added a commit that referenced this pull request Jan 9, 2026
* fix: deep merge file not present after installation (#13)
* feat: robust logging for pdf:text-layer extractor (#14)
* docs: new supported runtimes page in the docs
* feat: Add unrag doctor command for installation validation and troubleshooting (#15)
* chore: add spec for eval harness feature
* feat: Add reranker battery with Cohere and custom reranker support (#16)
* chore: bump patch version & updated new badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants