Install
openclaw skills install certainlogic-treCut AI token costs by 60-85% with deterministic query validation and intelligent caching. Standalone or integrates with Company Brain Core OS. Free, open-source.
openclaw skills install certainlogic-treCompany Brain Core OS — Free, local, deterministic knowledge base for your agent. Start here if you need persistent facts before optimizing token spend.
Cut AI costs. Not quality. Not accuracy.
v1.0.0
Built and dogfooded by CertainLogicAI — Saves us 79%+ on every cached query. Measurement beats hope.
This skill works standalone. You don't need anything else to start cutting token costs today.
Works even better with Company Brain Core OS (clawhub install company-brain-os):
All four are independent. Pick the one that solves your problem. Add others when you need them.
TRE sits between your agent and the LLM. It intercepts queries and decides: cache hit, deterministic lookup, or expensive LLM call.
User Query → TRE Decision Layer → Result (cache | brain | LLM)
Stores LLM responses so repeated queries return instantly — zero tokens.
# After first LLM call:
tre.cache_answer("What is our refund policy?", "30 days, no questions.")
# Every subsequent call:
answer = tre.get_cached_answer("What is our refund policy?")
# → Instant. Zero tokens. No LLM hit.
For questions with factual answers, skip the LLM entirely.
"What products do we offer?" → Intent: product → Facts DB → Instant answer
"How does the brain work?" → Intent: strategy → Facts DB → Instant answer
"Who wrote the security policy?" → Intent: security → Facts DB → Instant answer
Prevents expensive LLM calls that can't possibly have good answers.
| Workload | Without TRE | With TRE | Savings |
|---|---|---|---|
| Repetitive queries (support, FAQ) | $10-15/day | $1-3/day | 85% |
| Mixed unique + repeat | $300/mo | $45-90/mo | 40-70% |
# Works with any backend
llm_provider: openai # or anthropic, local, azure, etc.
tre:
cache_ttl: 3600
max_cache_size: 10000
hallucination_guard: true
clawhub install certainlogic-tre
from tre import cache_answer, get_cached_answer, get_metrics
# After getting an LLM response
tre.cache_answer(query, answer)
# Next time — zero tokens
cached = tre.get_cached_answer(query)
if cached:
answer, token_count = cached
print(f"Instant! Saved {token_count} tokens.")
# Check your savings
print(tre.get_metrics())
# {'cache_hits': 853, 'cache_misses': 223, 'cache_hit_rate_percent': 79.3}
See references/CONFIGURATION.md for full config options (TTL, cache size, guard sensitivity, forbidden commands).
See references/API.md for Python API reference.
When Brain is installed, TRE gets smarter:
# Install both
clawhub install company-brain-os certainlogic-tre
# Brain loads facts → TRE caches them → instant responses for common questions
| Metric | Value | Measurement Period |
|---|---|---|
| Cache hit rate | 79.3% | 2026-05-09, 615 queries |
| Avg latency (cache hit) | <10ms | Local SQLite |
| Avg latency (LLM miss) | 757ms | OpenRouter fallback |
| Hallucination guard flags | 0.2% | Hedge language detection |
| Token cost savings | 85% | Cached queries vs LLM calls |
| Forbidden command blocks | 100% | All delete_brain, purge blocked |
| Feature | Free | Pro (Planned) |
|---|---|---|
| Query answer cache | ✅ | ✅ |
| Deterministic lookup | ✅ | ✅ |
| Hallucination guard | ✅ | ✅ |
| Intent filtering | ✅ | ✅ |
| Cache persistence | ✅ | ✅ |
| Brain integration | ✅ | ✅ |
| Distributed cache (Redis) | ❌ | ✅ |
| Cache analytics dashboard | ❌ | ✅ |
| A/B testing policies | ❌ | ✅ |
| Team policy sharing | ❌ | ✅ |
| Auto policy optimization | ❌ | ✅ |
Pro pricing: TBD — join the waitlist at certainlogic.ai/tre
MIT — free to use, modify, distribute.
Built with brutal honesty by CertainLogic