Logo IconGuided Mind
v2.4Sign In
RAG Types

Hybrid RAG

Combine dense (embedding) and sparse (BM25) search for better coverage and precision.

Hybrid RAG combines dense retrieval (embedding similarity) with sparse retrieval (BM25 keyword matching). This gives you the best of both worlds: semantic understanding AND exact keyword matching.

How it Works

  1. Your query is processed two ways:
    • Dense: Converted to embedding vector for semantic search
    • Sparse: Keywords extracted for BM25 matching
  2. Both result sets are merged using Reciprocal Rank Fusion (RRF)
  3. Final results combine semantic relevance with keyword precision

RAG Wizard Configuration

Step 1: Project Setup

  • Domain: Any domain (works well with mixed content)
  • Use Case: "Document Analysis", "Q&A", or "Research"

Step 2: Data Sources

Hybrid RAG handles mixed-domain documents better than Naive RAG since BM25 catches exact matches.

Step 3: Document Processing

SettingRecommended Value
Chunking MethodRecursive
Chunk Size512-768 tokens
Overlap100 tokens
Respect Sentence BoundariesEnabled

Step 4: Pipeline Configuration

SettingValue
Search MethodHybrid
Embedding Modeltext-embedding-3-small
BM25 EnabledYes
Dense Weight0.6
Sparse Weight0.4

Adjust the Dense/Sparse weights based on your query patterns. More keyword-heavy queries = increase Sparse weight. More natural language = increase Dense weight.

BM25 Configuration

BM25 parameters can be tuned in the Pipeline tab:

ParameterDefaultDescription
k11.5Term frequency saturation
b0.75Document length normalization

Step 5: API Endpoints

Generate your API key and integrate using REST API, Python SDK, or MCP Protocol:

curl -X POST "https://api.guidedmind.ai/rag/search" \
-H "X-API-Key: rk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
  "query": "ERROR-402 payment failed",
  "options": {
    "limit": 5,
    "threshold": 0.5,
    "search_method": "hybrid"
  }
}'

Performance Comparison

MetricNaive RAGHybrid RAG
Semantic queries85% recall88% recall
Keyword queries45% recall92% recall
Mixed queries65% recall90% recall
Latency~100ms~150ms

When to Use Hybrid RAG

ScenarioFit
Mixed content typesExcellent
Product codes / error messagesExcellent
Natural language + keywordsExcellent
Legal / compliance docsGood
Simple single-domain Q&AOverkill

When to Upgrade

Consider Graph RAG if:

  • Your documents reference each other extensively
  • Users ask multi-hop questions
  • You need relationship discovery across documents