Observed since 20 Oct, 19:07 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Adaptive Retrieval-Augmented Generation (RAG) Engine with Hybrid Retrieval, LangChain, Cross-Encoder Reranking, FAISS Vector Search, Gemini LLM Integration and FastAPI.
Production-ready Adaptive Retrieval-Augmented Generation (Adaptive RAG) Engine built using FastAPI, LangChain, FAISS, SentenceTransformers, BM25, Cross-Encoder Reranking and Google Gemini.
Adaptive RAG Engine is a modular Retrieval-Augmented Generation framework designed to improve retrieval quality through adaptive query routing, hybrid retrieval, reciprocal rank fusion (RRF), cross-encoder reranking, confidence estimation, and optimized context construction before passing relevant information to a Large Language Model (LLM).
Unlike conventional RAG systems that rely on a single retrieval strategy, Adaptive RAG dynamically selects Dense, Sparse, or Hybrid Retrieval based on query analysis to improve retrieval precision while maintaining low latency.
flowchart TD
A[User Query]
A --> B[FastAPI REST API]
B --> C[Adaptive RAG Pipeline]
C --> D[Query Analyzer]
D --> E[Adaptive Query Router]
E -->|Semantic Query| F[Dense Retriever]
E -->|Keyword Query| G[BM25 Retriever]
E -->|Mixed Query| H[Hybrid Retrieval]
F --> I[SentenceTransformer Embeddings]
I --> J[FAISS Vector Store]
G --> K[BM25 Index]
J --> H
K --> H
H --> L[Reciprocal Rank Fusion]
L --> M[Cross Encoder Reranker]
M --> N[Confidence Estimator]
N --> O[Context Optimizer]
O --> P[LangChain Retriever Adapter]
P --> Q[Prompt Builder]
Q --> R[Gemini LLM]
R --> S[Generated Answer]
S --> T[FastAPI Response]
User Query
↓
FastAPI REST API
↓
Query Analyzer
↓
Adaptive Query Router
↓
Dense Retriever (MiniLM)
BM25 Retriever
↓
Hybrid Retriever
↓
RRF Fusion
↓
Cross Encoder Reranker
↓
Confidence Estimator
↓
Context Optimizer
↓
LangChain Retriever
↓
Prompt Builder
↓
Gemini
↓
Generated Response
| Category | Technologies |
|---|---|
| Backend | FastAPI |
| LLM | Google Gemini |
| Framework | LangChain |
| Vector Search | FAISS |
| Embeddings | SentenceTransformers |
| Sparse Retrieval | BM25 |
| Reranking | Cross Encoder |
| Programming Language | Python |
| Packaging | Docker, PyPI |
app/
src/
tests/
docs/
data/
logs/
git clone ...
cd adaptive-rag-engine
pip install -r requirements.txt
GEMINI_API_KEY=
GEMINI_MODEL=
HF_TOKEN=
uvicorn app.main:app --reload
POST /rag/ask
Example
{
"question":"Explain Retrieval Augmented Generation."
}
docker build -t adaptive-rag-engine .
docker run -p 8000:8000 adaptive-rag-engine
pip install adaptive-rag-engine
MIT License
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.1 | 4 Aug 2026 | 17 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-21 | 0 | 2026-10-21T11:15:06.2332534Z |
Observed since 20 Oct, 19:07 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:ad22e26be2a30aac86b2fc76f4b9c0d457a3fce8655c2010cf1e8e93dd3efe18