Docs Home | API | Configuration | Examples | Basic | Events | LLM | Architecture | Agent-Native | Benchmarks | Ecosystem
Qirrel uses LRU + TTL caching to reduce repeated work.
- Pipeline result cache (
Pipeline.processandPipeline.processBatch). - Component-level cache wrappers for cacheable processors.
- LLM response cache in adapter implementations.
cache:
maxEntries: 1000
ttl: 300000maxEntries: max entries before LRU eviction.ttl: entry lifetime in milliseconds.- Set
maxEntries: 0to disable cache globally.
import { Pipeline } from 'qirrel';
const pipeline = new Pipeline();
const input = 'hello@example.com';
await pipeline.process(input);
console.log(pipeline.isCached(input));
console.log(pipeline.getCached(input)?.data?.entities ?? []);
pipeline.setCached(input, { data: { text: input, tokens: [], entities: [] } });- Pipeline result keys are SHA-256 based on raw input text.
- Component caches use stable hashed keys from component name + relevant context fields.
- Cached contexts are cloned on set/get to avoid cross-request mutation leakage.
For adapter-level response caching:
llm:
cacheTtl: 300000
timeout: 30000Provider behavior currently differs:
- OpenAI adapter implements explicit cache read/write in the adapter.
- Generic and Gemini adapters cache through shared base adapter logic.
- Reuse one
Pipelineinstance per process/service worker. - Prefer
processBatch(..., { concurrency })for bounded parallelism. - Tune
ttlby freshness requirements.
- Disabling cache in config affects both result and component-level cache wrapping.
- Recreating
Pipelinefor every request resets cache and eliminates most cache benefit. - High concurrency with very low TTL may still miss cache frequently.