Advanced Cache
Intentgine’s cache is your primary tool for reducing latency. Every request is automatically checked against the cache before any compute happens.
How Caching Applies Per Endpoint
Section titled “How Caching Applies Per Endpoint”| Endpoint | Cache Behavior |
|---|---|
/v1/resolve | Multi-tier caching with fuzzy and semantic matching. Identical and similar queries return cached results. |
/v1/classify | Exact-match caching with inline classes. Semantic caching when using Classification Sets — similar inputs return cached results. |
/v1/classify-batch | Same as classify, applied per item. Additionally, when using Classification Sets, near-identical items within the batch are deduplicated — only one compute call per group. |
/v1/correct | Automatically invalidates the cache for the corrected query. |
Why classify uses exact-match only (with inline classes)
Section titled “Why classify uses exact-match only (with inline classes)”Classification is sensitive to small differences in input — two sentences that look almost identical can have completely different correct labels. Fuzzy matching would risk returning wrong classifications, so classify endpoints only cache exact matches when classes are passed inline.
Semantic caching with Classification Sets
Section titled “Semantic caching with Classification Sets”When you use a Classification Set (a named, stored collection of classes), the classify endpoints unlock semantic caching. This works because:
- The class set is stable — the content hash ensures the same classes are always used.
- High similarity thresholds — only near-paraphrases match (stricter than resolve).
- Confidence filtering — only high-confidence results are cached for semantic reuse. Ambiguous inputs always get a fresh compute call.
This means “I love this product” and “I really enjoy this product” will return the same cached classification against the same class set.
Batch deduplication
Section titled “Batch deduplication”When using Classification Sets with /v1/classify-batch, the system embeds all inputs and groups near-identical items together. Only one representative from each group is sent for classification, and the result is copied to all members. This reduces the number of compute calls needed.
Standard vs Advanced Cache
Section titled “Standard vs Advanced Cache”Standard Cache (Default)
Section titled “Standard Cache (Default)”In standard mode, the cache matches based on your query text. Identical queries return cached results, and similar queries are matched using fuzzy text matching.
- Pros: High cache hit rate.
- Cons: Can return a cached tool call even if you changed the available tools since the last call.
Advanced Cache
Section titled “Advanced Cache”In advanced mode, the cache adds a semantic similarity layer — queries that mean the same thing but are phrased differently can still return cached results, even across languages or with significant rewording.
- Pros: Highest hit rates for diverse phrasing. Catches semantic equivalence that text matching alone would miss.
- Cons: Slightly higher per-request overhead for the similarity check.
Advanced cache is most valuable when:
- Your users phrase the same intent in many different ways.
- You serve multilingual queries.
- You have resolve-heavy workloads with diverse phrasing.
Self-Learning
Section titled “Self-Learning”The cache improves over time. When a query is resolved via compute, the system automatically learns a canonical form of that query. Future queries that match the canonical form get instant cache hits — even if the original phrasing was different.
This means your cache hit rate naturally increases as your application handles more traffic, without any action on your part.
Cache Invalidation
Section titled “Cache Invalidation”Cache is automatically invalidated in two scenarios:
Corrections
Section titled “Corrections”When you submit a correction via /v1/correct, the cache for that query is automatically invalidated. The next request for that query will go to compute, pick up the correction from your Memory Bank, and cache the corrected result.
Toolset & Classification Set Updates
Section titled “Toolset & Classification Set Updates”When you modify a Toolset or Classification Set (add, remove, or change tools/classes), the cache for affected endpoints is automatically cleared:
- Toolset change → all resolve cache for that App is cleared.
- Classification Set change → classify cache for that specific set is cleared.
The cache rebuilds naturally from incoming traffic — no action needed on your part. Renaming a Toolset or Classification Set without changing its contents does not clear the cache.
When to Use Advanced Cache
Section titled “When to Use Advanced Cache”- Your application has diverse user phrasing for the same intents.
- You want to maximize cache hit rates on
/v1/resolve. - You serve multilingual or informal input (slang, typos, abbreviations).
You can toggle Advanced Cache in your App settings in the Developer Console.