@agent-trace-cache/core
v0.1.0
Published
Deterministic TypeScript trajectory cache for agentic systems. ContextDiff, ReplayEngine, HNSW, in-memory + LibSQL stores. Zero LLM on the hit path.
Maintainers
Readme
@agent-trace-cache/core
Deterministic TypeScript trajectory cache for agentic systems. Caches goal + context → plan rather than query → response (semantic-cache layer) or thread messages (Mastra Memory layer).
The hit path is 100% deterministic TypeScript — no LLM is invoked when the cache returns a result. Embeddings (OpenAI text-embedding-3-small) are precomputed at write time and compared deterministically at read time.
Install
pnpm add @agent-trace-cache/core
# or: npm install @agent-trace-cache/coreFor the higher-level createCache / withCache ergonomics, install the SDK package instead:
pnpm add @agent-trace-cache/sdkWhat's in this package
AgentTraceCache— the cache facade withlookup/store/invalidate/recordReplayQuality- ContextDiff — four normalization pipelines (ephemeral / structural / semantic / discrete) with per-pipeline ablation
- ReplayEngine + TaintRecorder — L1 (full match) / L2 (partial replay via taint analysis) / miss
- HNSWIndex — in-process vector ANN
- Storage adapters —
InMemoryTrajectoryStore,LibSqlTrajectoryStore(with opt-in HNSW persistence) assertSerializable, hash utilities, embedding helpers
Documentation + benchmarks
- Project overview and quickstart: github.com/kylemaa/agent-trace-cache
- Methodology and τ-bench airline benchmarks (69% hit rate, 90% judge precision, 62.7% L2 partial replay under 4-axis context drift): see
blog/agent-trace-cache.mdin the repo
License
MIT
