bigRAG
Concepts

Search

Semantic, keyword, and hybrid search modes with reranking.

bigRAG supports three search modes that can be configured per collection or per query.

Search Modes

ModeDescription
semanticDefault. Cosine similarity vector search using embeddings.
keywordText-based keyword matching with term frequency scoring.
hybridRuns both semantic and keyword search, merges results using Reciprocal Rank Fusion (RRF).

The default mode. Your query is embedded using the collection's configured model and compared against stored vectors using cosine similarity.

Best for: natural language questions, conceptual queries, finding related content.

curl -X POST http://localhost:6100/v1/collections/docs/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"query": "What are the main findings about climate change?"}'

Text-based matching using term frequency. No embedding is involved.

Best for: exact terms, product codes, IDs, proper nouns.

curl -X POST http://localhost:6100/v1/collections/docs/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"query": "ERR-4021", "search_mode": "keyword"}'

Combines both semantic and keyword search, then merges results using Reciprocal Rank Fusion (RRF). This gives the best of both worlds.

Best for: queries that mix natural language with specific terms.

curl -X POST http://localhost:6100/v1/collections/docs/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"query": "error code ERR-4021 authentication", "search_mode": "hybrid"}'

Query Parameters

FieldTypeRequiredDefaultDescription
querystringyesNatural language query text
top_kintegernoCollection default (10)Number of results (1–1,000)
filtersobjectnoMetadata filters (see operators below)
min_scorefloatnoCollection defaultMinimum similarity score threshold
search_modestringnoCollection defaultsemantic, keyword, or hybrid
rerankbooleannoCollection settingOverride collection reranking

Filters

Filters narrow results by metadata fields. Pass a plain value for exact match, or use operators for more control.

Exact Match

{ "filters": { "author": "Smith", "year": 2026 } }

Comparison Operators

OperatorDescriptionValue Type
$eqEqualstring, number, boolean
$neNot equalstring, number, boolean
$gtGreater thannumber
$gteGreater than or equalnumber
$ltLess thannumber
$lteLess than or equalnumber
$inIn listarray of strings or numbers
{
  "filters": {
    "year": { "$gte": 2024 },
    "status": { "$in": ["published", "preprint"] },
    "score": { "$gt": 0.8 }
  }
}

Multiple filters are combined with AND.

Multi-Collection Query

Search across multiple collections in a single request. Results are merged and sorted by score.

curl -X POST http://localhost:6100/v1/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "machine learning",
    "collections": ["docs", "papers"],
    "top_k": 20
  }'

Each result includes a collection field indicating which collection it came from.

Batch Query

Run up to 20 independent queries in a single request. Queries execute in parallel.

curl -X POST http://localhost:6100/v1/batch/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      {"collection": "docs", "query": "authentication", "top_k": 5},
      {"collection": "papers", "query": "neural networks", "top_k": 10, "search_mode": "hybrid"}
    ]
  }'

Reranking

When enabled on a collection, results are re-scored by a Cohere cross-encoder model after initial retrieval:

# Enable on a collection
curl -X POST http://localhost:6100/v1/collections \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "docs",
    "reranking_enabled": true,
    "reranking_model": "rerank-v3.5",
    "reranking_api_key": "your-cohere-key"
  }'

# Override per query
curl -X POST http://localhost:6100/v1/collections/docs/query \
  -H "Authorization: Bearer $BIGRAG_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"query": "...", "rerank": false}'

Analytics

Each collection tracks query statistics automatically:

curl http://localhost:6100/v1/collections/docs/analytics \
  -H "Authorization: Bearer $BIGRAG_API_SECRET"

Returns 24h, 7d, and 30d aggregates including query count, average latency, average score, and top queries.

On this page