Seedlabs

FlowGate: gate expensive RAG loops to hard queries only

A system that sends simple AI queries to a fast path and complex ones to a deeper search.

A drop-in middleware that scores every incoming query with a lightweight hybrid keyword-plus-semantic signal and routes it to the cheapest sufficient RAG workflow — plain linear retrieve-then-generate for simple lookups, iterative loop workflows only for genuinely hard questions — cutting token spend and latency with no model retraining.

Computer ScienceTopic Modeling
Reasoning and Retrieval OptimizationLLMOps / inference-cost optimization for enterprise RAG assistants

Concept

A small service that sits in front of an existing RAG stack and decides, per query, how much RAG machinery to spend. For each incoming query it computes a hybrid score that balances keyword/metadata signals against semantic similarity using a single tunable weighting factor — the routing mechanism formalized in Modular RAG — and dispatches the query to one of several workflow patterns the team already runs: a cheap linear retrieve-then-generate flow for simple lookups, a conditional/branching flow for ambiguous or multi-source questions, and an iterative loop flow (rewrite, retrieve, generate, self-check, re-retrieve) only for hard knowledge-intensive queries. Because the score is a lexical-plus-embedding computation rather than an LLM call, routing itself adds negligible latency and no token cost (and sidesteps the paper's noted context-window limits of LLM-based fusion). A tuning dashboard lets teams calibrate the weighting factor and routing thresholds against their own labeled queries and preview per-flow cost and accuracy before enabling it. It is pure orchestration — no retriever or model changes.

Why now

Paper [0] formalizes RAG systems into a three-layer structure of 40+ specialized operators across 8 L1 modules and four orchestration patterns (linear, conditional, branching, loop), and shows through extensive experiments that different RAG workflows adapt differently to typical tasks — meaning a single fixed flow over-pays on easy traffic. Crucially, the paper defines and evaluates a hybrid routing mechanism that balances keyword-based and semantic-based scores (a weighting factor trading off metadata and semantic analysis) to assign queries to specific RAG flows, giving FlowGate a concrete, demonstrated routing signal rather than a bespoke classifier. Since loop/iterative patterns multiply LLM calls per query, gating them to the minority of hard queries is the biggest token-cost lever the paper's taxonomy exposes. Readiness caveat: the mechanism is demonstrated at framework level, so FlowGate ships as tunable middleware with per-deployment threshold calibration.

Written by GLM · 17 Nov 2026

AI assessment

Backed by 1 paper85

A highly feasible, evidence-backed cost-optimization tool that provides immediate value by routing queries to the most efficient RAG workflow.

Evidence strength
5/5
The idea directly implements the hybrid routing mechanism and the four orchestration patterns (linear, conditional, branching, loop) explicitly formalized and tested in the Modular RAG paper.
Market pull
4/5
Enterprise RAG users face a direct trade-off between the high cost/latency of iterative loops and the inaccuracy of simple linear flows, creating a strong incentive for cost-optimization middleware.
Novelty & moat
2/5
While similar to TierRouter and Relational Query Router, it specifically targets the orchestration patterns of Modular RAG rather than just model size or graph vs. vector search, though the 'routing for cost' mechanism is a known pattern.
Feasibility
5/5
The routing logic relies on lightweight keyword and semantic scoring rather than LLM calls, making it a low-latency, easy-to-implement middleware component.
Wedge clarity
5/5
The wedge is a specific, high-value cost-saving measure: gating expensive iterative RAG loops to only the hardest queries.
Simplicity / focus
5/5
The product is a focused routing middleware with a single clear purpose, avoiding the trap of becoming a full RAG framework itself.

Scored by Gemma 4 · 17 Nov 2026. Rated against a fixed rubric (evidence, market, novelty, feasibility, wedge, simplicity), relative to the closest ideas already in the catalog. A prior estimate to compare ideas before real-world signal arrives.

Act on this idea

Ideas only matter if someone runs with them. Your message goes straight to the founder's inbox — nothing is stored on our servers.

Who benefits

  • Gleancompany

    Glean's enterprise AI assistant serves high daily query volumes over company knowledge, and most queries are simple lookups that need no iterative retrieval; gating expensive loop flows to hard queries directly cuts per-query token cost and latency at scale.

  • Klarnacompany

    Klarna's AI customer-service assistant handles enormous conversation volume where most chats resolve on a single retrieval; routing simple queries to a linear flow reduces inference spend on the bulk of traffic.

  • LlamaIndexcompany

    LlamaIndex ships the workflow-orchestration primitives developers build these patterns with; a difficulty-gating router is a natural high-value component for its RAG users facing large token bills.

  • LangChaincompany

    LangGraph users default to agentic loop patterns for RAG; a router that reserves loops for genuinely hard queries addresses their most common cost complaint without rewriting their graphs.

  • Perplexitycompany

    Perplexity serves massive query volume where navigational and simple factual queries dominate; hybrid keyword/semantic routing of easy traffic to lighter flows reduces serving cost.

Research it builds on

  1. Modular RAG: Transforming RAG Systems into LEGO-like Reconfigurable Frameworks
    Yunfan Gao, Yun Xiong, Meng Wang et al. · 2026 · 125 citations
    All ideas from this paper →
Leave feedback
feasibility