|
| 1 | +# Hybrid RAG Ranking with Graceful LLM Fallback |
| 2 | + |
| 3 | +> A two-stage retrieval ranker in which a deterministic, always-available lexical |
| 4 | +> stage owns the critical path and an optional language-model re-ranking stage — |
| 5 | +> bounded to a top-K subset and governed by a budget — runs off the critical path |
| 6 | +> and **fails open** to the deterministic result on any timeout, error, or budget |
| 7 | +> breach, without surfacing that failure to the caller. |
| 8 | +
|
| 9 | +--- |
| 10 | + |
| 11 | +**⚖️ DEFENSIVE PUBLICATION / PRIOR ART** |
| 12 | + |
| 13 | +This repository is a **Technical Defensive Publication**. It is published to |
| 14 | +establish a dated, citable record of prior art so that the technique described |
| 15 | +herein remains free for anyone to practice and **cannot be patented by others**. |
| 16 | + |
| 17 | +| Field | Value | |
| 18 | +|-------|-------| |
| 19 | +| Publisher / Copyright holder | **Gus IT LLC** (Florida, USA) | |
| 20 | +| Author | **Gustavo Assuncao, PhD** | |
| 21 | +| Publication date | **2026-06-25** | |
| 22 | +| Version | **1.0** | |
| 23 | +| Document type | Technical Defensive Publication (public prior art) | |
| 24 | +| Classification | Public | |
| 25 | +| License | AGPL-3.0-or-later (copyleft; commercial license available) | |
| 26 | +| Deposit channel | To be assigned (IP.com / Zenodo / arXiv) — establishes a public, dated, citable prior-art record | |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Abstract |
| 36 | + |
| 37 | +Retrieval-augmented generation (RAG) pipelines increasingly insert a |
| 38 | +language-model (LLM) re-ranking stage between candidate retrieval and answer |
| 39 | +synthesis, because LLM re-rankers materially improve ordering quality. But LLM |
| 40 | +re-rankers are slow, expensive, rate-limited, and occasionally unavailable. The |
| 41 | +naive integration — call the retriever, then *await* the LLM re-ranker, then |
| 42 | +return — promotes the slow, failure-prone stage onto the **critical path**: the |
| 43 | +end-to-end latency, availability, and cost of retrieval all become hostage to the |
| 44 | +LLM provider. A single provider timeout or a tripped spend cap turns a sub-100 ms |
| 45 | +retrieval into a multi-second failure. |
| 46 | + |
| 47 | +This publication describes a hybrid ranking architecture that inverts the |
| 48 | +dependency. A deterministic lexical stage (TF-IDF-style scoring with title and |
| 49 | +recency boosts) is the **critical path** and *always* returns a fully-ordered |
| 50 | +result within a tight latency budget. The LLM re-ranking stage is structurally a |
| 51 | +**non-critical-path enhancement**: it is invoked only on a bounded top-K subset of |
| 52 | +the already-ordered deterministic output, it is governed by a per-call budget and |
| 53 | +time bound, and — the central novelty — on **any** failure (bridge unavailability, |
| 54 | +timeout, malformed output, or budget breach) the system **fails open**, returning |
| 55 | +the deterministic ranking unchanged and *without surfacing the failure to the |
| 56 | +caller*. The contract guarantees a valid, ordered result on every call; the LLM |
| 57 | +can only ever *improve* the ordering, never degrade availability or latency. |
| 58 | + |
| 59 | +The disclosure provides the architecture, the fail-open state machine, the |
| 60 | +top-K/budget cost-bounding mechanics, a data model, a clean-room reference |
| 61 | +implementation, a worked example, security and failure-mode analysis, framework |
| 62 | +mappings, an evaluation methodology, and an enumerated set of inventive claims |
| 63 | +(one independent plus fourteen dependent). |
| 64 | + |
| 65 | +## Why this is published |
| 66 | + |
| 67 | +We believe two-stage retrieval that *fails open from an LLM re-ranker to a |
| 68 | +deterministic ranker* is a robustness pattern that should remain **freely |
| 69 | +practiceable by everyone** — RAG infrastructure authors, search teams, and agent |
| 70 | +builders alike. Rather than seek a patent on the fail-open guarantee, Gus IT LLC |
| 71 | +publishes it defensively. By placing a complete, enabling, dated technical |
| 72 | +description in the public domain under AGPL-3.0-or-later, we create prior art that bars a |
| 73 | +later party from patenting the same technique and asserting it against |
| 74 | +practitioners. The reference implementation is original, clean-room, and |
| 75 | +dependency-light so that anyone can read it, run it, and adopt the pattern. |
| 76 | + |
| 77 | +## Table of Contents |
| 78 | + |
| 79 | +- **[DEFENSIVE-PUBLICATION.md](DEFENSIVE-PUBLICATION.md)** — the full technical |
| 80 | + whitepaper (architecture, mechanics, data model, claims, evaluation, appendices). |
| 81 | +- **[docs/PRIOR-ART.md](docs/PRIOR-ART.md)** — prior-art landscape and delta table. |
| 82 | +- **[docs/FIGURES.md](docs/FIGURES.md)** — all figures with captions. |
| 83 | +- **[docs/OPEN-SOURCE-APP.md](docs/OPEN-SOURCE-APP.md)** — planned open-source |
| 84 | + reference app and deployment sketch. |
| 85 | +- **[src/](src/)** — clean-room illustrative reference implementation |
| 86 | + ([src/README.md](src/README.md)). |
| 87 | +- **[LICENSE](LICENSE)** — AGPL-3.0-or-later. |
| 88 | +- **[NOTICE](NOTICE)** — attribution and defensive-publication statement. |
| 89 | +- **[CITATION.cff](CITATION.cff)** — citation metadata. |
| 90 | + |
| 91 | +## Planned open-source app |
| 92 | + |
| 93 | +This repository is intended to seed a small open-source reference application: a |
| 94 | +self-contained hybrid RAG ranking service that demonstrates the fail-open pattern |
| 95 | +end-to-end, with a pluggable re-ranker adapter and a generic Kubernetes/AKS |
| 96 | +deployment sketch. See **[docs/OPEN-SOURCE-APP.md](docs/OPEN-SOURCE-APP.md)**. |
| 97 | + |
| 98 | +## License & Citation |
| 99 | + |
| 100 | +Licensed under the **GNU Affero General Public License v3.0** — see [LICENSE](LICENSE). The AGPL-3.0-or-later |
| 101 | +express patent grant is intentional for a prior-art release. |
| 102 | + |
| 103 | +To cite this publication, see [CITATION.cff](CITATION.cff). Short form: |
| 104 | + |
| 105 | +> Assuncao, Gustavo (2026). *Hybrid RAG Ranking with Graceful LLM Fallback.* |
| 106 | +> Technical Defensive Publication, v1.0, Gus IT LLC. Published 2026-06-25. |
0 commit comments