negative caching
**Negative Caching** in RAG (Retrieval-Augmented Generation) stores query-document pairs that resulted in no relevant matches to avoid repeated futile searches.
## What Is Negative Caching?
- **Purpose**: Cache "no results found" responses for repeated queries
- **Mechanism**: Store query fingerprints with negative hit flags
- **Benefit**: Reduces unnecessary retrieval calls and latency
- **TTL**: Time-limited to allow index updates to take effect
## Why Negative Caching Matters
Without negative caching, repeated queries for non-existent information trigger expensive retrieval operations every time.
```svg
```
**Implementation Considerations**:
| Parameter | Typical Value | Reason |
|-----------|---------------|--------|
| Cache TTL | 1-24 hours | Allow index updates |
| Key format | Query hash | Exact match lookup |
| Max entries | 10K-100K | Memory budget |
| Invalidation | On index update | Freshness |