Changelog¶
v0.2.0 — 2026-05¶
First public release.
Core¶
CogniCacheclass withquery()/query_with_meta()/cached()decorator APIMemoryStore(default) andRedisStore(Redis Stack 7+ with HNSW) backends- TTL eviction on
find_matchandlist_entriespaths - Per-instance configuration; multiple caches in one process supported
- Fail-open on backend errors (
CacheStoreErroris caught at call sites)
Quality¶
LLMJudgeABC withNoopJudgeandLLMJudgeOpenAIimplementations- "Write strict, hit lenient" policy:
write_min_quality— gate writes (default 0.8)low_quality_ttl— short-lived storage for marginal answersjudge_on_hit+hit_min_quality— async warning on degraded hits
Observability¶
MetricsCollectorwith thread-safe bounded deque + sink fan-outQueryEventfrozen dataclassPrometheusSinkwith lazyprometheus_clientimport- p50/p95/p99 latency breakdown by
cache_hit=true/false - Token savings ratio and quality score gauges
Integrations¶
cogcache.integrations.langchain.CogniCacheLangChain— LangChainBaseCacheadapter
Benchmarks¶
python -m cogcache.bench.run_benchreproducible offline benchmark--real-llmmode for DashScope / OpenAI compatible APIs- Built-in
ecommerce.jsonldataset (50 queries, 5 clusters)
Packaging¶
- PyPI:
pip install cogcache - Extras:
[redis],[prometheus],[openai-judge],[langchain],[bench],[all],[dev] - Single required dependency:
numpy - Wheel size: ~35 KB
Renamed¶
- Module
cognicache→cogcache(the class nameCogniCacheis unchanged). - Environment variable
COGNICACHE_*names are unchanged for compatibility with thecogcache-playgroundreference deployment.
v0.0.0 — 2026-05¶
Placeholder release on PyPI to reserve the name. Not functional.