feat(rag): hybrid BM25 + FAISS retrieval with reciprocal-rank fusion

Open
#802 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@DerekRoberts is already working on this.

Since Oct 24, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement

Problem

Steward questions often name exact references ("s. 21", "Article 32.04", "Schedule 1") or defined terms. A small embedding model (bge-small) handles these poorly, while BM25 keyword search handles them well. The corpus is small (about 3k chunks), so BM25 in memory needs no new service.

Proposed change

Run BM25 (e.g. rank_bm25) over the existing chunk text and combine its results with FAISS candidates using reciprocal-rank fusion, before the existing tier re-scoring in search_index_batch. Keep FAISS.

Dependencies

  • Blocked by #801. The eval from that issue decides this one. If the eval shows no gain, close this unmerged.

Note for #699

When BC Laws PDF ingestion is built, keep section and part numbers in the chunk header prefix ([Source - Header]). That makes keyword matching on references work better at no extra cost.

Acceptance criteria

  • Hybrid retrieval raises the eval's hit rate on section-number and defined-term questions, with no drop overall. Otherwise this is closed unmerged.
Dominant language
Python
Stars
2
Forks
1
Avg merge
4h 16m
Merged PRs (30d)
38

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MinionTech/vexilon

All issues in MinionTech/vexilon

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.