Search Modes
Snipara offers three search modes for querying documentation. Choose the right mode based on your query type for optimal results.
Overview
| Mode | Description | Plan | Speed | Best For |
|---|---|---|---|---|
| Keyword | Traditional term matching | FREE | Fast | Exact terms, function names |
| Semantic | Embedding-based similarity | PRO+ | Medium | Concepts, natural language |
| Hybrid | Combined approach (recommended) | PRO+ | Medium | General queries, best overall |
Keyword Search
Keyword search uses TF-IDF-like scoring optimized for documentation. Great for finding specific terms, function names, or error codes.
How It Works
score = (title_matches × 3) + (content_matches × 1) + (exact_phrase × 2) Weights: • Title match: 3× (query terms in section title) • Content match: 1× (query terms in section content) • Exact phrase: 2× (exact query phrase found) • Section level: 1.2× per level (H1 > H2 > H3)
Configuration
rlm_context_query({ query: "handleAuthError function", search_mode: "keyword", max_tokens: 8000})Best Use Cases
- Exact term searches: Function names, error codes
- Technical queries: API endpoints, configuration keys
- Low latency needs: When speed is critical
- FREE plan users: Only option available on free tier
Semantic Search
Semantic search uses embedding vectors to find conceptually similar content. Understands meaning, not just keywords.
How It Works
1. Generate embedding for query using BAAI/bge-large-en-v1.5 2. Compare against pre-computed document chunk embeddings 3. Rank by cosine similarity 4. Return top N results with similarity > 0.3 Model: BAAI/bge-large-en-v1.5 Dimensions: 1024 Max tokens per chunk: 512
Configuration
rlm_context_query({ query: "How does the system handle authentication errors?", search_mode: "semantic", max_tokens: 8000})Best Use Cases
- Conceptual queries:"How does the system handle errors?"
- Natural language: Questions phrased conversationally
- Synonym handling:Finds "auth" when searching "login"
- Cross-reference: Finds related concepts across docs
Hybrid Search (Recommended)
Hybrid search combines keyword and semantic using Adaptive Reciprocal Rank Fusion. Automatically adjusts weights based on query type.
Recommended Default
Hybrid mode is the best choice for most queries. It combines the strengths of both keyword and semantic search while mitigating their weaknesses.
Adaptive Weight Profiles
| Profile | Keyword | Semantic | Triggered When |
|---|---|---|---|
| Keyword-Heavy | 70% | 30% | Exact terms, specific lookups (pricing, schema, endpoint) |
| Balanced | 50% | 50% | Default for most queries |
| Semantic-Heavy | 30% | 70% | Conceptual queries (how/why/explain) |
Query Classification (Auto)
The system automatically classifies your query in ~0ms (no LLM call) to choose the optimal weights:
- Keyword-heavy: Query contains specific terms like
pricing,schema,endpoint,api - Semantic-heavy:Query starts with "how does", "why", "explain", "compare"
- Balanced: Everything else
Configuration
rlm_context_query({ query: "How does the system handle authentication errors?", search_mode: "hybrid", // default max_tokens: 8000})Performance Comparison
Latency (P50)
| Mode | Cold Start | Warm |
|---|---|---|
| Keyword | 50ms | 15ms |
| Semantic | 200ms | 80ms |
| Hybrid | 250ms | 100ms |
Accuracy (F1 Score)
| Query Type | Keyword | Semantic | Hybrid |
|---|---|---|---|
| Exact term | 0.92 | 0.75 | 0.93 |
| Conceptual | 0.55 | 0.88 | 0.92 |
| Natural language | 0.45 | 0.85 | 0.88 |
| Mixed | 0.68 | 0.82 | 0.94 |
When to Use Each Mode
Keyword
- Looking for specific function
- Error code lookup
- API endpoint discovery
- Configuration key search
- Need maximum speed
Semantic
- "How does X work?"
- Architecture understanding
- Conceptual explanations
- Finding related content
- Natural language questions
Hybrid (Default)
- General documentation search
- Complex questions
- Best practices search
- When unsure which to use
- Production recommended
Plan Gating
| Search Mode | FREE | PRO | TEAM | ENTERPRISE |
|---|---|---|---|---|
| Keyword | Yes | Yes | Yes | Yes |
| Semantic | No | Yes | Yes | Yes |
| Hybrid | No | Yes | Yes | Yes |
Downgrade behavior: If a FREE plan user requests semantic or hybrid, the request is automatically downgraded to keyword search with a warning in the response.