{"_id":"@aid-on/whenm","_rev":"10-84f99d7c48c2efda1c05026b051a46f7","name":"@aid-on/whenm","dist-tags":{"latest":"0.3.9"},"versions":{"0.1.0":{"name":"@aid-on/whenm","version":"0.1.0","keywords":["event-calculus","prolog","temporal-reasoning","llm","memory","edge-computing","cloudflare-workers"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.1.0","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"0f4b120f9387b2cbd9754aa680ef9a5c860e0e2f","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.1.0.tgz","fileCount":65,"integrity":"sha512-4mMMh3qS5RrRUXdEDKbO9/msSENmRweaN4gLpVtW3A8VnZ5kd8hp8TjemlW+8KoRZbZt80dv5o9CTBlTzoRKaQ==","signatures":[{"sig":"MEUCICFBYncyRi6wqoyzg8c+DptWBtNEe3ye1/r+UkxBFUw8AiEAvXMuqcI9MhBmvOV01vHy1XjGtLaf1k4iiU1GQoCwsYY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":320895},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dcaafce4d93a829582fb93957b0113fd59f42abf","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","benchmark":"vitest run benchmarks/**/*.test.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system for LLMs with Event Calculus and Prolog reasoning","directories":{},"_nodeVersion":"20.19.6","dependencies":{"zod":"^3.25.0","trealla":"^0.28.8","kuromoji":"^0.1.2","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0","@types/kuromoji":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.1.0_1767081795174_0.9662329250658679","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aid-on/whenm","version":"0.1.1","keywords":["event-calculus","prolog","temporal-reasoning","llm","memory","edge-computing","cloudflare-workers"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.1.1","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"59ee3338d1a2675a73089fe872bb9118127b0200","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.1.1.tgz","fileCount":65,"integrity":"sha512-jOPKVpCjLlA0f7JnFB8knL29Vqp7HfFBxUuVCa8LW8Ccv020TTyi7yr0Q3P6UruHJ4YDsjQcGihuCgH/VaXxTg==","signatures":[{"sig":"MEQCIEmBbbbk9DG18UN/f6oJbfYSD8adQHzpyA8lLiIiOVHhAiB3Zne2lMEeAz+IL6mX2Pec6qyAmNfpKS+QrjXFhdLsvw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":320895},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dcaafce4d93a829582fb93957b0113fd59f42abf","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","benchmark":"vitest run benchmarks/**/*.test.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system for LLMs with Event Calculus and Prolog reasoning","directories":{},"_nodeVersion":"20.19.6","dependencies":{"zod":"^3.25.0","trealla":"^0.28.8","kuromoji":"^0.1.2","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0","@types/kuromoji":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.1.1_1767082814626_0.1973061871390871","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aid-on/whenm","version":"0.1.2","keywords":["event-calculus","prolog","temporal-reasoning","llm","memory","edge-computing","cloudflare-workers"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.1.2","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"d896c7a0956a7cbaa9b96f8b37a0696249af9ac2","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.1.2.tgz","fileCount":109,"integrity":"sha512-qNLPTTl1gliBRZ9e8wdpRVZMruJ6KoABRGBQHzog9ZtsZw7d51wVXztjelv+6VU2hzESIgqmYDdGzNp0BWIzIQ==","signatures":[{"sig":"MEUCIQCZaqNfghJnupMToKty4izNVyio94H9BmvfgDSO0eSN/gIgUy+SpHr2PD0bNNGa4p2PmrAw1/EEsgd2Qty/HJOiKgM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":471030},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fb15e1913df6dbfd919ad5ab401cec1d3a3e9075","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","benchmark":"vitest run benchmarks/**/*.test.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system for LLMs with Event Calculus and Prolog reasoning","directories":{},"_nodeVersion":"20.19.6","dependencies":{"zod":"^3.25.0","trealla":"^0.28.8","kuromoji":"^0.1.2","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0","@types/kuromoji":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.1.2_1767083296350_0.9021182457242747","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aid-on/whenm","version":"0.1.3","keywords":["event-calculus","prolog","temporal-reasoning","llm","memory","edge-computing","cloudflare-workers"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.1.3","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"311fb80bd0b5f902bebb98c9b1c0dd5c7d9aefd5","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.1.3.tgz","fileCount":109,"integrity":"sha512-L+682BhYSHpWSh1himgVp1JoLdv3ylCf2assXxVGwxYjLw38WcnZTOr+gdHeLR1RsPyJsvAA8OXqVdxtE14KYw==","signatures":[{"sig":"MEUCIQC6Eyx3SbdZLwLnRryZYWmtMXSQSGPZhex4l41jhjBgcgIgQ8o5qLHMQXM+AqtjGLze4NikCKTZFgTmlwjAogYbICU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":471030},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"c4fc964d4141f21221d0314f57f8f4a09d781ab3","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","benchmark":"vitest run benchmarks/**/*.test.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system for LLMs with Event Calculus and Prolog reasoning","directories":{},"_nodeVersion":"20.19.6","dependencies":{"zod":"^3.25.0","trealla":"^0.28.8","kuromoji":"^0.1.2","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0","@types/kuromoji":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.1.3_1767083817530_0.9202990112447804","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@aid-on/whenm","version":"0.3.3","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.3.3","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"1a3486f66ec16d62b408220490cf21b91c0a61e3","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.3.tgz","fileCount":109,"integrity":"sha512-ia1i8oR3gZKWQfv5OYOj6geOt0yv5vD4FoCtn91XMGeDTMsIcuQ65OlfFO2nrRxqGDguWUHGBVCngVj5eD9jjw==","signatures":[{"sig":"MEUCIGpG1Twh4/7/MwHzImWpAsj0IzV4IY7cEOo2SlpTd4HUAiEAxeBbeq3Hs5g9H+2NeeJju4jw5fzTwQEeslk/D0boHl4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":474378},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"80f43656a3e3b30735ee865afa0163a92cd31b8d","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","benchmark":"vitest run benchmarks/**/*.test.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system that understands when things happened, not just what happened","directories":{},"_nodeVersion":"20.19.6","dependencies":{"trealla":"^0.28.8","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.3.3_1767089470769_0.09091714099346415","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@aid-on/whenm","version":"0.3.4","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.3.4","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"a25b53da44f54a395272058b9c4169858ccd9fcd","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.4.tgz","fileCount":81,"integrity":"sha512-hu5tHEoXtj3jNZyd+oqhFw70QY2a0FPnxbUDb2yZ3SOYQnT/5EAJJb2TDlSOCTbecRHhTm6dSu1FQc+eclp+nA==","signatures":[{"sig":"MEYCIQDpW96bY7t1PpJJZB3UIrFtgso7xxdcP0wHuFV0pJGmcwIhAPEePZR6zDmGWvnx+zjdyX+ZEe6bTPl/vEp8pMZ7JrF3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":320190},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a380226cb400a78c9735f9d74117bb7c4d908f35","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsc","clean":"rm -rf dist","test:all":"npm run test && npm run test:prolog","benchmark":"vitest bench benchmarks/**/*.bench.ts","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:prolog":"node ./tests/prolog/test_runner.js","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build","test:prolog:swipl":"./tests/prolog/run_tests.sh"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system that understands when things happened, not just what happened","directories":{},"_nodeVersion":"20.19.6","dependencies":{"trealla":"^0.28.8","compromise":"^14.14.5","@aid-on/unillm":"^0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.6.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.3.4_1767099737783_0.9636581487594309","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"@aid-on/whenm","version":"0.3.5","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.3.5","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"742c4eaf5d309f8c235d4987a3b683936abb4346","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.5.tgz","fileCount":11,"integrity":"sha512-6wdDN9mFp1TO5WKtIAJBMWtQ4T8mMv6bkcpcZ075BVN4dv9Jmd9hPX+BNbUKyQuXhvG+B/iBMu1xLeLAeiY1Rg==","signatures":[{"sig":"MEUCIQDLfalv7tPlxXVyYcy0K5x5kfXIuCqofrFrTCviDtp1wgIgWXltGSEXHyKvzz5osCfnWZJcRn3bDiD7QgY7RaG9mn8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":537070},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"b4127269c82183c9a528caca5c4ffeffc037f0c7","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsup","clean":"rm -rf dist","test:all":"npm run test && npm run test:prolog","benchmark":"vitest bench benchmarks/**/*.bench.ts","build:tsc":"tsc","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:prolog":"node ./tests/prolog/test_runner.js","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build","test:prolog:swipl":"./tests/prolog/run_tests.sh"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system that understands when things happened, not just what happened","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","dependencies":{"trealla":"^0.28.8","compromise":"^14.14.5","@aid-on/unillm":"^0.5.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","dotenv":"^16.6.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.3.5_1767250292715_0.7544774954768012","host":"s3://npm-registry-packages-npm-production"}},"0.3.6":{"name":"@aid-on/whenm","version":"0.3.6","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.3.6","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"a47ffab36ed639a619526f942da6656bad4cfb13","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.6.tgz","fileCount":11,"integrity":"sha512-URMebv3pKpt3lGjfbXpRsu2s6fdiRzFTTfH062z5+zg0K6/DDpUCPZbPae3cmhfgmfLZJ0PnyRLfG0aqjsfMDw==","signatures":[{"sig":"MEYCIQDhVvmQNhCCA9Act3roVk26fNNn71HQXb1nEfcJcIqvnQIhAKppwzMd7Tzeglp1NSUt792KjaCqCgrL8rZPNFW937EQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":490820},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e8bcdbc75a7aaf8af5b7d07ec465e03534425c0c","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsup","clean":"rm -rf dist","test:all":"npm run test && npm run test:prolog","benchmark":"vitest bench benchmarks/**/*.bench.ts","build:tsc":"tsc","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:prolog":"node ./tests/prolog/test_runner.js","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build","test:prolog:swipl":"./tests/prolog/run_tests.sh"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system that understands when things happened, not just what happened","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","dependencies":{"trealla":"^0.28.8","compromise":"^14.14.5","@aid-on/unillm":"^0.5.2"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","dotenv":"^16.6.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.3.6_1771341606120_0.8233451321920917","host":"s3://npm-registry-packages-npm-production"}},"0.3.7":{"name":"@aid-on/whenm","version":"0.3.7","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"license":"MIT","_id":"@aid-on/whenm@0.3.7","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"homepage":"https://github.com/Aid-On/whenm#readme","bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"dist":{"shasum":"ae017405ffb394f03ed0a8800d0b74eb7f22f5cb","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.7.tgz","fileCount":11,"integrity":"sha512-BZ20gWM/t2dRySmBuYIFVIXP1rYnD+oOo9fJ6r+MjNzj7BKHPwlVQ53Xxch4SowTmLEVVRqgGai2B/5CCZs+sw==","signatures":[{"sig":"MEUCIQC/dh7pwFw2HZPCI+uRLo6nPNr+/WH2QA43R+0QZ9wbOwIgFKFDMIFCk/jpOXnzJHh19vfElk7m01LQe8aGo9mZOWc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":490820},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e8bcdbc75a7aaf8af5b7d07ec465e03534425c0c","scripts":{"test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","build":"tsup","clean":"rm -rf dist","test:all":"npm run test && npm run test:prolog","benchmark":"vitest bench benchmarks/**/*.bench.ts","build:tsc":"tsc","typecheck":"tsc --noEmit","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:prolog":"node ./tests/prolog/test_runner.js","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","prepublishOnly":"npm run clean && npm run build","test:prolog:swipl":"./tests/prolog/run_tests.sh"},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"repository":{"url":"git+https://github.com/Aid-On/whenm.git","type":"git"},"_npmVersion":"10.8.2","description":"Time-aware memory system that understands when things happened, not just what happened","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","dependencies":{"trealla":"^0.28.8","compromise":"^14.14.5","@aid-on/unillm":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","dotenv":"^16.6.1","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/whenm_0.3.7_1771343157157_0.7146173892304004","host":"s3://npm-registry-packages-npm-production"}},"0.3.9":{"name":"@aid-on/whenm","version":"0.3.9","description":"Time-aware memory system that understands when things happened, not just what happened","type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"scripts":{"build":"tsup","build:tsc":"tsc","typecheck":"tsc --noEmit","test":"vitest run --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:watch":"vitest --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:coverage":"vitest run --coverage --exclude 'benchmarks/**' --exclude 'tests/_old/**'","test:prolog":"node ./tests/prolog/test_runner.js","test:prolog:swipl":"./tests/prolog/run_tests.sh","test:all":"npm run test && npm run test:prolog","benchmark":"vitest bench benchmarks/**/*.bench.ts","clean":"rm -rf dist","prepublishOnly":"npm run clean && npm run build"},"dependencies":{"@aid-on/unillm":"^0.5.5","compromise":"^14.14.5","trealla":"^0.28.8"},"devDependencies":{"@types/node":"^22.10.2","@vitest/coverage-v8":"^2.1.9","dotenv":"^16.6.1","tsup":"^8.5.1","typescript":"^5.7.2","vitest":"^2.1.8"},"keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"author":{"name":"Aid-On Team"},"repository":{"type":"git","url":"git+https://github.com/Aid-On/whenm.git"},"bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"homepage":"https://github.com/Aid-On/whenm#readme","license":"MIT","_id":"@aid-on/whenm@0.3.9","gitHead":"36b0c0c2a78e02a959e6f774cd47d1d2e7b70cb5","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AZJlMHLlwP2v+k9kMvj6jENeegWOeE93YHcxWwK3jcGQyJP+THxJ7BrL+APArXH9nDytTX7pKiN+gMVW8h1uTw==","shasum":"09af6c499fd1694f1765a1189dffec33cea2e4aa","tarball":"https://registry.npmjs.org/@aid-on/whenm/-/whenm-0.3.9.tgz","fileCount":11,"unpackedSize":490820,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBjbWgTQklkgM3JG3P8YElUaRYIDfoBNAoo6iYqqxscqAiAX92NF81Y8C30AD3YJodTBZqunXx92cCSTknb876NuMQ=="}]},"_npmUser":{"name":"aid-on","email":"hiromi.motodera@aid-on.org"},"directories":{},"maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/whenm_0.3.9_1771435105512_0.3113431593686564"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-30T08:03:15.072Z","modified":"2026-02-18T17:18:25.791Z","0.1.0":"2025-12-30T08:03:15.326Z","0.1.1":"2025-12-30T08:20:14.795Z","0.1.2":"2025-12-30T08:28:16.487Z","0.1.3":"2025-12-30T08:36:57.690Z","0.3.3":"2025-12-30T10:11:10.907Z","0.3.4":"2025-12-30T13:02:17.926Z","0.3.5":"2026-01-01T06:51:32.858Z","0.3.6":"2026-02-17T15:20:06.296Z","0.3.7":"2026-02-17T15:45:57.323Z","0.3.9":"2026-02-18T17:18:25.687Z"},"bugs":{"url":"https://github.com/Aid-On/whenm/issues"},"author":{"name":"Aid-On Team"},"license":"MIT","homepage":"https://github.com/Aid-On/whenm#readme","keywords":["temporal-memory","event-calculus","prolog","temporal-reasoning","time-aware","llm","ai-memory","schemaless"],"repository":{"type":"git","url":"git+https://github.com/Aid-On/whenm.git"},"description":"Time-aware memory system that understands when things happened, not just what happened","maintainers":[{"name":"aid-on","email":"hiromi.motodera@aid-on.org"}],"readme":"# WhenM\n\n[English](README.md) | [日本語](README.ja.md)\n\n[![CI](https://github.com/Aid-On/whenm/actions/workflows/ci.yml/badge.svg)](https://github.com/Aid-On/whenm/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/@aid-on/whenm.svg)](https://www.npmjs.com/package/@aid-on/whenm)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n> Temporal memory system that understands **when** things happened, not just what happened\n\n## What is WhenM?\n\nWhenM is a **schemaless temporal memory system** that gives AI applications the ability to understand time, state changes, and causality. Unlike traditional databases or RAG systems, WhenM natively understands that facts change over time.\n\n### Core Difference from RAG\n\n| Aspect | RAG | WhenM |\n|--------|-----|-------|\n| **Time Understanding** | ❌ None | ✅ Native temporal reasoning |\n| **State Changes** | ❌ Can't track | ✅ Tracks all transitions |\n| **Contradictions** | ❌ Returns all versions | ✅ Resolves by timeline |\n| **Schema** | ⚠️ Predefined | ✅ Completely schemaless |\n| **Query** | \"What is X?\" | \"What was X at time Y?\" |\n\n## Quick Start\n\n```bash\n# Install\nnpm install @aid-on/whenm\n\n# Setup (copy and edit .env)\ncp .env.example .env\n```\n\n```typescript\nimport { WhenM } from '@aid-on/whenm';\n\n// Initialize (uses mock LLM by default, or your API keys from .env)\nconst memory = await WhenM.auto();\n\n// Or explicitly use mock for testing\nconst memory = await WhenM.mock();\n\n// Or use Groq (recommended for production)\nconst memory = await WhenM.groq(\n  process.env.GROQ_API_KEY  // Get from https://console.groq.com/keys\n);\n\n// Remember events - any language, any domain\nawait memory.remember(\"Alice joined as engineer\", \"2020-01-15\");\nawait memory.remember(\"Alice became team lead\", \"2022-06-01\");\nawait memory.remember(\"Pikachu learned Thunderbolt\", \"2023-01-01\");\n\n// Ask temporal questions\nawait memory.ask(\"What was Alice's role in 2021?\");\n// → \"engineer\"\n\nawait memory.ask(\"What is Alice's current role?\");\n// → \"team lead\"\n\nawait memory.ask(\"When did Pikachu learn Thunderbolt?\");\n// → \"January 1, 2023\"\n```\n\n## Key Features\n\n### 🌍 Truly Schemaless\nNo schemas, no configuration, no entity definitions. WhenM understands any concept in any language through LLM integration.\n\n```typescript\n// Gaming domain\nawait memory.remember(\"Mario collected a fire flower\", \"2024-01-01\");\n\n// Cooking domain  \nawait memory.remember(\"Added salt to the soup\", \"2024-02-01\");\n\n// Business domain\nawait memory.remember(\"Tanaka became director\", \"2024-03-01\");\n\n// All work without any setup!\n```\n\n### ⏰ Temporal Reasoning\nBuilt on formal Event Calculus, providing mathematically sound temporal logic for natural language queries about time and state changes.\n\n### 🌐 Any Language, Any Domain\nThe query refinement layer automatically handles multiple languages and domains.\n\n```typescript\n// Japanese example\nawait memory.remember(\"Pikachu learned Thunderbolt\");\n\n// Spanish example\nawait memory.remember(\"El gato subió al árbol\");\n\n// English with emojis\nawait memory.remember(\"🚀 launched to Mars\");\n```\n\n## Installation\n\n```bash\nnpm install @aid-on/whenm\n```\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { WhenM } from '@aid-on/whenm';\n\n// Simple string format (provider:apikey)\nconst memory = await WhenM.create('groq:your-api-key');\n\n// With model specification\nconst memory = await WhenM.create('groq:your-api-key:llama-3.3-70b-versatile');\n\n// Unified config object\nconst memory = await WhenM.create({\n  provider: 'groq',\n  apiKey: process.env.GROQ_API_KEY,\n  model: 'llama-3.3-70b-versatile'\n});\n\n// Provider-specific helpers\nconst memory = await WhenM.groq(process.env.GROQ_API_KEY);\nconst memory = await WhenM.gemini(process.env.GEMINI_API_KEY);\nconst memory = await WhenM.cloudflare({\n  apiKey: process.env.CLOUDFLARE_API_KEY,\n  accountId: process.env.CLOUDFLARE_ACCOUNT_ID,\n  email: process.env.CLOUDFLARE_EMAIL\n});\n```\n\n### Recording Events\n\n```typescript\n// Simple event\nawait memory.remember(\"Project started\", \"2024-01-01\");\n\n// Complex state change\nawait memory.remember(\"Bob promoted to manager\", \"2024-06-01\");\n\n// Multilingual support\nawait memory.remember(\"Experiment succeeded\", \"2024-07-01\");\n```\n\n### Querying\n\n```typescript\n// Natural language queries\nawait memory.ask(\"What happened in January?\");\nawait memory.ask(\"Who became manager this year?\");\nawait memory.ask(\"What is the current status of the project?\");\n\n// All queries use natural language through the ask() method\nconst events = await memory.ask(\"What did Alice do between January and December 2024?\");\nconst statusInMarch = await memory.ask(\"What was Project-X status on March 15, 2024?\");\nconst recentChanges = await memory.ask(\"What happened with Project-X in the last 30 days?\");\n```\n\n## Advanced Features\n\n### Query Refinement Layer\n\nWhenM includes a sophisticated refinement layer that standardizes queries across languages:\n\n```typescript\n// These all work seamlessly:\nawait memory.ask(\"What is Alice's role?\");\nawait memory.ask(\"What is Alice's role?\");\nawait memory.ask(\"¿Cuál es el rol de Alice?\");\n```\n\n### Enable Query Refinement\n\nFor better multilingual support:\n\n```typescript\nconst memory = await WhenM.cloudflare({\n  accountId: process.env.CLOUDFLARE_ACCOUNT_ID,\n  apiKey: process.env.CLOUDFLARE_API_KEY,\n  email: process.env.CLOUDFLARE_EMAIL,\n  enableRefiner: true  // Enable multilingual query refinement\n});\n```\n\n### Persistence (Plugin System) - 🧪 EXPERIMENTAL\n\n> ⚠️ **Note**: The persistence feature is experimental and has not been fully tested in production. Use with caution.\n\nWhenM provides a pluggable persistence layer for durable storage:\n\n#### Memory Persistence (Default)\n```typescript\n// Default - events stored in memory only\nconst memory = await WhenM.cloudflare(config);\n```\n\n#### D1 Database Persistence\n```typescript\n// Cloudflare D1 for durable storage\nconst memory = await WhenM.cloudflare({\n  accountId: process.env.CLOUDFLARE_ACCOUNT_ID,\n  apiKey: process.env.CLOUDFLARE_API_KEY,\n  email: process.env.CLOUDFLARE_EMAIL,\n  persistenceType: 'd1',\n  persistenceOptions: {\n    database: env.DB,           // D1 database binding\n    tableName: 'whenm_events',  // Optional: custom table name\n    namespace: 'my-app'         // Optional: namespace for multi-tenancy\n  }\n});\n\n// Save current state\nawait memory.persist();\n\n// Restore from database\nawait memory.restore();\n\n// Restore with filters\nawait memory.restore({\n  timeRange: { from: '2024-01-01', to: '2024-12-31' },\n  limit: 1000\n});\n\n// Check persistence stats\nconst stats = await memory.persistenceStats();\nconsole.log(`Total persisted events: ${stats.totalEvents}`);\n```\n\n#### Custom Persistence Plugin\n```typescript\n// Implement your own persistence\nclass MyCustomPersistence {\n  async save(event) { /* ... */ }\n  async load(query) { /* ... */ }\n  async stats() { /* ... */ }\n  // ... other required methods\n}\n\nconst memory = await WhenM.cloudflare({\n  // ... config\n  persistenceType: 'custom',\n  persistenceOptions: new MyCustomPersistence()\n});\n```\n\n#### Persistence API\n```typescript\n// Core persistence methods\nawait memory.persist();                    // Save all events to storage\nawait memory.restore();                    // Load all events from storage\nawait memory.restore({ limit: 100 });      // Load with query filters\nconst stats = await memory.persistenceStats(); // Get storage statistics\n\n// Export/Import Prolog format\nconst prolog = await memory.exportProlog();\nawait memory.importProlog(prolog);\n```\n\n## Architecture\n\nWhenM combines three powerful technologies:\n\n1. **Event Calculus** - Formal temporal logic for reasoning about time\n2. **Trealla Prolog** - High-performance logical inference engine (WASM)\n3. **LLM Integration** - Natural language understanding without schemas\n\n### Data Flow: How It Works\n\nThe system processes information through 5 stages:\n\n```\nInput → Language Normalization → Semantic Decomposition → Temporal Logic → Response\n```\n\n#### Example: Recording an Event\n\n**Input:**\n```typescript\nawait memory.remember(\"Taro became manager\", \"2024-03-01\");\n```\n\n**Stage 1: Language Normalization**\n```json\n{\n  \"original\": \"Taro became manager\",\n  \"language\": \"ja\",\n  \"refined\": \"Taro became manager\",\n  \"entities\": [\"Taro\"]\n}\n```\n\n**Stage 2: Semantic Analysis (LLM)**\n```json\n{\n  \"subject\": \"taro\",\n  \"verb\": \"became\",\n  \"object\": \"manager\",\n  \"temporalType\": \"STATE_UPDATE\",\n  \"affectedFluent\": {\n    \"domain\": \"role\",      // Dynamically determined\n    \"value\": \"manager\",\n    \"isExclusive\": true    // Only one role at a time\n  }\n}\n```\n\n**Stage 3: Prolog Facts Generation**\n```prolog\nevent_fact(\"evt_1234\", \"taro\", \"became\", \"manager\").\nhappens(\"evt_1234\", 1709251200000).\ninitiates(\"evt_1234\", role(\"taro\", \"manager\")).\nis_exclusive_domain(role).\n```\n\n#### Example: Querying Information\n\n**Input:**\n```typescript\nawait memory.ask(\"What is Taro's current role?\");\n```\n\n**Prolog Query:**\n```prolog\ncurrent_state(\"taro\", role, Value)\n```\n\n**Event Calculus Processing:**\n- Finds latest `initiates(\"evt_1234\", role(\"taro\", \"manager\"))`\n- Checks no newer role changes exist (clipping check)\n- Returns: `Value = \"manager\"`\n\n### True Schemaless Design\n\nTraditional systems require predefined schemas:\n```typescript\n// ❌ Hardcoded approach\nif (verb === \"became\") domain = \"role\";\nif (verb === \"learned\") domain = \"skill\";\n```\n\nWhenM dynamically understands any concept:\n```typescript\n// ✅ Dynamic understanding\n\"Pikachu learned Thunderbolt\" → {domain: \"skill\", value: \"thunderbolt\", isExclusive: false}\n\"Robot battery at 80%\" → {domain: \"battery\", value: \"80\", isExclusive: true}\n\"Alien transformed into energy\" → {domain: \"form\", value: \"energy\", isExclusive: true}\n```\n\nThe LLM determines the semantic meaning, domain, and exclusivity rules dynamically, enabling the system to handle any new concept without code changes.\n\n## Performance\n\n- **Insert Speed**: 25,000+ events/second\n- **Query Speed**: 1-30ms for typical queries  \n- **Memory**: Optimized for edge (runs in Cloudflare Workers)\n- **Languages**: Any human language supported\n\n## Use Cases\n\n### 🏢 Employee Performance & Career Tracking\n```typescript\nconst hr = await WhenM.cloudflare(config);\n\n// Track career progression with full context\nawait hr.remember(\"Sarah joined as Junior Developer\", \"2021-01-15\");\nawait hr.remember(\"Sarah completed React certification\", \"2021-06-20\");\nawait hr.remember(\"Sarah led the payment module project\", \"2021-09-01\");\nawait hr.remember(\"Sarah promoted to Senior Developer\", \"2022-01-15\");\nawait hr.remember(\"Sarah became Tech Lead\", \"2023-06-01\");\n\n// Temporal performance queries\nconst review = await hr.ask(\"What achievements led to Sarah's promotion to Senior?\");\n// → \"Completed React certification and successfully led payment module project\"\n\n// Compare growth between employees\nconst sarahGrowth = await hr.ask(\"How did Sarah's career progress from January 2021 to January 2024?\");\nconst johnGrowth = await hr.ask(\"How did John's career progress from January 2021 to January 2024?\");\n// → Career progression comparison\n\n// Find high performers\nconst fastGrowth = await hr.ask(\"Who was promoted, awarded, or recognized in the last 12 months?\");\n// → List of employees with recent achievements\n```\n\n### 🏥 Patient Medical History & Treatment Evolution\n```typescript\nconst medical = await WhenM.cloudflare(config);\n\n// Complex medical timeline\nawait medical.remember(\"Patient diagnosed with hypertension\", \"2020-03-15\");\nawait medical.remember(\"Started lisinopril 10mg daily\", \"2020-03-20\");\nawait medical.remember(\"Blood pressure improved to 130/80\", \"2020-06-15\");\nawait medical.remember(\"Developed dry cough side effect\", \"2020-09-01\");\nawait medical.remember(\"Switched to losartan 50mg\", \"2020-09-05\");\nawait medical.remember(\"Blood pressure stabilized to normal\", \"2021-01-15\"); // Multilingual support\n\n// Critical temporal queries for treatment decisions\nconst currentMeds = await medical.ask(\"What medication is the patient currently taking?\");\n// → Current medication and conditions\n\nconst medicationHistory = await medical.ask(\"Why was the medication changed in September 2020?\");\n// → \"Lisinopril caused dry cough side effect, switched to losartan\"\n\n// Track treatment effectiveness over time\nconst bpHistory = await medical.ask(\"What were the blood pressure measurements in the last 6 months?\");\n// → Blood pressure trends for treatment evaluation\n```\n\n### 🤖 AI Agent Memory & Learning System\n```typescript\nconst agent = await WhenM.cloudflare(config);\n\n// Agent learns and adapts over time\nawait agent.remember(\"User prefers TypeScript over JavaScript\", \"2024-01-01\");\nawait agent.remember(\"User works in Tokyo timezone\", \"2024-01-05\");\nawait agent.remember(\"User dislikes verbose explanations\", \"2024-01-10\");\nawait agent.remember(\"Failed to solve bug with approach A\", \"2024-02-01\");\nawait agent.remember(\"Successfully solved bug with approach B\", \"2024-02-01\");\n\n// Context-aware responses based on temporal memory\nconst preferences = await agent.ask(\"What are the user's preferences?\");\n// → All current user preferences and learned patterns\n\nconst debugging = await agent.ask(\"What debugging approach should I try?\");\n// → \"Use approach B, as approach A previously failed\"\n\n// Learn from interaction patterns\nconst interactions = await agent.ask(\"What failed, succeeded, or errored in the last 30 days?\");\n// → Analyze success/failure patterns to improve\n```\n\n### 📊 Real-time Incident Management & RCA\n```typescript\nconst ops = await WhenM.cloudflare(config);\n\n// Track incident timeline\nawait ops.remember(\"CPU usage spiked to 95%\", \"2024-03-15 14:30\");\nawait ops.remember(\"Database connection pool exhausted\", \"2024-03-15 14:31\");\nawait ops.remember(\"API response time degraded to 5s\", \"2024-03-15 14:32\");\nawait ops.remember(\"Deployed hotfix PR #1234\", \"2024-03-15 14:45\");\nawait ops.remember(\"System recovered\", \"2024-03-15 14:50\");\n\n// Root cause analysis with temporal reasoning\nconst rca = await ops.ask(\"What caused the API degradation?\");\n// → \"CPU spike led to connection pool exhaustion, causing API degradation\"\n\n// Pattern detection across incidents\nconst patterns = await ops.ask(\"What spiked, exhausted, or degraded in the last 90 days?\");\n// → Identify recurring issues\n\n// Automated incident correlation\nconst correlation = await ops.ask(\"What happened with the system between 2:00 PM and 3:00 PM on March 15, 2024?\");\n// → Complete incident timeline for postmortem\n```\n\n### 💰 Financial Audit Trail & Compliance\n```typescript\nconst audit = await WhenM.cloudflare(config);\n\n// Maintain complete audit trail\nawait audit.remember(\"Account opened by John\", \"2023-01-15\");\nawait audit.remember(\"KYC verification completed\", \"2023-01-16\");\nawait audit.remember(\"$50,000 deposited from Chase Bank\", \"2023-02-01\");\nawait audit.remember(\"Flagged for unusual activity\", \"2023-03-15\");\nawait audit.remember(\"Manual review cleared\", \"2023-03-16\");\nawait audit.remember(\"Account upgraded to Premium\", \"2023-06-01\");\n\n// Compliance queries\nconst kycStatus = await audit.ask(\"Was KYC completed before the first transaction?\");\n// → \"Yes, KYC completed on Jan 16, first transaction on Feb 1\"\n\n// Suspicious activity tracking\nconst flagged = await audit.ask(\"What was flagged, suspended, or investigated in 2023?\");\n// → All compliance events for regulatory reporting\n\n// Account state at any point for legal inquiries\nconst snapshot = await audit.ask(\"What was the account status on March 15, 2023?\");\n// → Exact account state when flagged\n```\n\n### 🎮 Game State & Player Progression\n```typescript\nconst game = await WhenM.cloudflare(config);\n\n// Rich player history\nawait game.remember(\"Player discovered hidden dungeon\", \"2024-01-01 10:00\");\nawait game.remember(\"Player defeated Dragon Boss\", \"2024-01-01 11:30\");\nawait game.remember(\"Player earned 'Dragon Slayer' title\", \"2024-01-01 11:31\");\nawait game.remember(\"Player joined guild 'Knights'\", \"2024-01-02\");\nawait game.remember(\"Won guild battle\", \"2024-01-03\"); // Multilingual support\n\n// Personalized gameplay based on history\nconst achievements = await game.ask(\"What titles and skills does the player have?\");\n// → All titles, skills, and progression\n\n// Quest eligibility based on temporal conditions\nconst eligible = await game.ask(\"Can player start the 'Ancient Evil' quest?\");\n// → \"Yes, player has defeated Dragon Boss and joined a guild\"\n\n// Leaderboard with time-based scoring\nconst weeklyChamps = await game.ask(\"Who defeated bosses, completed quests, or won battles in the last 7 days?\");\n// → This week's most active players\n```\n\n### 🏭 IoT Sensor Network & Predictive Maintenance\n```typescript\nconst iot = await WhenM.cloudflare(config);\n\n// Continuous sensor monitoring\nawait iot.remember(\"Machine-A vibration increased to 0.8mm/s\", \"2024-03-01\");\nawait iot.remember(\"Machine-A temperature at 75°C\", \"2024-03-02\");\nawait iot.remember(\"Machine-A bearing noise detected\", \"2024-03-03\");\nawait iot.remember(\"Machine-A scheduled maintenance\", \"2024-03-05\");\nawait iot.remember(\"Machine-A bearing replaced\", \"2024-03-05\");\n\n// Predictive maintenance queries\nconst warning = await iot.ask(\"What signs preceded the bearing failure?\");\n// → \"Vibration increased, temperature rose, then noise detected\"\n\n// Pattern recognition across fleet\nconst maintenance = await iot.ask(\"What increased, was detected, or failed in the last 30 days?\");\n// → Identify machines showing similar patterns\n\n// Optimal maintenance scheduling\nconst machineState = await iot.ask(\"How did Machine-A's condition change from February to March 2024?\");\n// → Degradation rate for maintenance planning\n```\n\n## API Reference\n\n### Core Methods\n\n#### `memory.remember(event: string, date?: string | Date)`\nRecords an event at a specific time.\n\n#### `memory.ask(question: string)`\nAnswers questions using temporal reasoning. This is the primary interface for all queries.\n\n#### `memory.remember(event: string, date?: string | Date)`\nRecords an event at a specific time.\n\n### Query Interface\n\nAll queries are performed through natural language using the `ask()` method:\n\n```typescript\n// Temporal queries\nawait memory.ask(\"What happened in January 2024?\");\nawait memory.ask(\"What is Alice's current role?\");\nawait memory.ask(\"When did Bob learn Python?\");\nawait memory.ask(\"Who joined the company last year?\");\n\n// State queries\nawait memory.ask(\"What skills does Alice have?\");\nawait memory.ask(\"Where does Bob currently work?\");\n\n// Historical queries\nawait memory.ask(\"What was the status on March 15?\");\nawait memory.ask(\"How did things change between February and April?\");\n\n// Complex queries\nawait memory.ask(\"Who was promoted in the last 12 months?\");\nawait memory.ask(\"What failures occurred before the system recovery?\");\n```\n\nThe LLM-powered query system understands:\n- Temporal relationships (before, after, during, between)\n- State transitions (became, changed, updated)\n- Current vs historical states\n- Aggregations (who, what, when, how many)\n- Causal relationships (why, what caused)\n\n\n## Requirements\n\n- Node.js 18+\n- LLM Provider API credentials (required - one of the following):\n  - Cloudflare AI (account ID, API key, email)\n  - Groq API key\n  - Google Gemini API key\n\n## Environment Variables\n\n```bash\n# Cloudflare AI\nCLOUDFLARE_ACCOUNT_ID=your_account_id\nCLOUDFLARE_API_KEY=your_api_key\nCLOUDFLARE_EMAIL=your_email\n\n# Or Groq\nGROQ_API_KEY=your_groq_key\n\n# Or Gemini\nGEMINI_API_KEY=your_gemini_key\n```\n\n## Testing\n\n```bash\n# Run unit tests only (fast)\nnpm run test:unit\n\n# Run integration tests only (requires API keys or uses mock)\nnpm run test:integration\n\n# Run all tests\nnpm run test:all\n\n# Run tests with coverage\nnpm run test:coverage\n\n# Watch mode for development\nnpm run test:watch\n```\n\n## Roadmap\n\n### Upcoming Features\n- **Query Builder API**: Structured query interface (currently all queries use natural language)\n- **Timeline API**: Dedicated timeline tracking and analysis\n- **Advanced Persistence**: Production-ready storage backends\n- **Performance Optimizations**: Faster Prolog integration\n- **Extended Language Support**: More LLM providers\n\n## License\n\nMIT © Aid-On\n\n## Credits\n\nWhenM stands on the shoulders of giants:\n\n### Core Technologies\n- **[Trealla Prolog](https://github.com/trealla-prolog/trealla)** - WebAssembly-powered Prolog engine providing the logical reasoning foundation\n- **[Event Calculus](https://en.wikipedia.org/wiki/Event_calculus)** - Formal temporal logic framework for rigorous time-based reasoning\n- **[@aid-on/unillm](https://www.npmjs.com/package/@aid-on/unillm)** - Unified LLM interface enabling seamless multi-provider support\n\n### Special Thanks\n- The Trealla Prolog team for their excellent WASM implementation\n- The Event Calculus research community for decades of temporal logic advancement\n- The Aid-On team for continuous support and innovation","readmeFilename":"README.md"}