{"_id":"@agent-trace-cache/core","_rev":"2-512b4632e65a0688d2a027799ce43690","name":"@agent-trace-cache/core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agent-trace-cache/core","version":"0.1.0","keywords":["agent","cache","trajectory","ai","llm","embeddings","typescript","hnsw","libsql"],"author":{"name":"Kyle Ma"},"license":"MIT","_id":"@agent-trace-cache/core@0.1.0","maintainers":[{"name":"kylepma","email":"kylephuma@gmail.com"}],"homepage":"https://github.com/kylemaa/agent-trace-cache#readme","bugs":{"url":"https://github.com/kylemaa/agent-trace-cache/issues"},"dist":{"shasum":"cd44aeb4e637c159a4b9a4519e770ec546bd728d","tarball":"https://registry.npmjs.org/@agent-trace-cache/core/-/core-0.1.0.tgz","fileCount":98,"integrity":"sha512-bUBCwD3QfKE5aganuIX4rHt9YxRy5WfsJOjnOeYEuaTyd33jw0IOc5/+NyovLF59sKhOYPJUPhZbS1yitdgLZQ==","signatures":[{"sig":"MEYCIQDItMQEKRAJGN6ecuOS9CpldstfpJmAwgx3mZSx3eQREwIhAPKINqxxagC4lXueJWZUzpeVGpVCj2fMZIV4PQfMvFg9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":158272},"main":"./dist/index.js","type":"module","_from":"file:agent-trace-cache-core-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc --build","typecheck":"tsc --build"},"_npmUser":{"name":"kylepma","email":"kylephuma@gmail.com"},"_resolved":"C:\\Users\\kylep\\AppData\\Local\\Temp\\a24f2969a2ee099e9f68a00916f348b3\\agent-trace-cache-core-0.1.0.tgz","_integrity":"sha512-bUBCwD3QfKE5aganuIX4rHt9YxRy5WfsJOjnOeYEuaTyd33jw0IOc5/+NyovLF59sKhOYPJUPhZbS1yitdgLZQ==","repository":{"url":"git+https://github.com/kylemaa/agent-trace-cache.git","type":"git","directory":"packages/core"},"_npmVersion":"10.2.4","description":"Deterministic TypeScript trajectory cache for agentic systems. ContextDiff, ReplayEngine, HNSW, in-memory + LibSQL stores. Zero LLM on the hit path.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"openai":"^4.0.0","@libsql/client":"^0.14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"*","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.0_1777337952916_0.9497577654114531","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @pomerene/core — install @pomerene/core instead"}},"time":{"created":"2026-04-28T00:59:12.784Z","modified":"2026-06-02T03:50:03.395Z","0.1.0":"2026-04-28T00:59:13.074Z"},"bugs":{"url":"https://github.com/kylemaa/agent-trace-cache/issues"},"author":{"name":"Kyle Ma"},"license":"MIT","homepage":"https://github.com/kylemaa/agent-trace-cache#readme","keywords":["agent","cache","trajectory","ai","llm","embeddings","typescript","hnsw","libsql"],"repository":{"url":"git+https://github.com/kylemaa/agent-trace-cache.git","type":"git","directory":"packages/core"},"description":"Deterministic TypeScript trajectory cache for agentic systems. ContextDiff, ReplayEngine, HNSW, in-memory + LibSQL stores. Zero LLM on the hit path.","maintainers":[{"name":"kylepma","email":"kylephuma@gmail.com"}],"readme":"# @agent-trace-cache/core\n\nDeterministic TypeScript trajectory cache for agentic systems. Caches `goal + context → plan` rather than `query → response` (semantic-cache layer) or thread messages (Mastra Memory layer).\n\nThe 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.\n\n## Install\n\n```bash\npnpm add @agent-trace-cache/core\n# or: npm install @agent-trace-cache/core\n```\n\nFor the higher-level `createCache` / `withCache` ergonomics, install the SDK package instead:\n\n```bash\npnpm add @agent-trace-cache/sdk\n```\n\n## What's in this package\n\n- `AgentTraceCache` — the cache facade with `lookup` / `store` / `invalidate` / `recordReplayQuality`\n- **ContextDiff** — four normalization pipelines (ephemeral / structural / semantic / discrete) with per-pipeline ablation\n- **ReplayEngine** + **TaintRecorder** — L1 (full match) / L2 (partial replay via taint analysis) / miss\n- **HNSWIndex** — in-process vector ANN\n- **Storage adapters** — `InMemoryTrajectoryStore`, `LibSqlTrajectoryStore` (with opt-in HNSW persistence)\n- **`assertSerializable`**, hash utilities, embedding helpers\n\n## Documentation + benchmarks\n\n- Project overview and quickstart: [github.com/kylemaa/agent-trace-cache](https://github.com/kylemaa/agent-trace-cache)\n- 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.md` in the repo\n\n## License\n\nMIT\n","readmeFilename":"README.md"}