()
| 14 | }); |
| 15 | |
| 16 | async function memoryExamples() { |
| 17 | console.log("\n=== first run ==="); |
| 18 | const first = await openreason.reason("what is photosynthesis?"); |
| 19 | console.log({ verdict: first.verdict, confidence: first.confidence, metadata: first.metadata }); |
| 20 | |
| 21 | console.log("\n=== repeated query (should hit cache) ==="); |
| 22 | const second = await openreason.reason("what is photosynthesis?"); |
| 23 | console.log({ verdict: second.verdict, cached: second.metadata?.cached, cacheSimilarity: second.metadata?.cacheSimilarity }); |
| 24 | |
| 25 | console.log("\n=== similar query ==="); |
| 26 | const third = await openreason.reason("explain plant energy production"); |
| 27 | console.log({ verdict: third.verdict, mode: third.mode, metadata: third.metadata }); |
| 28 | |
| 29 | console.log("\n=== memory stats ==="); |
| 30 | console.log(get_memory_stats()); |
| 31 | } |
| 32 | |
| 33 | memoryExamples().catch(console.error); |
no test coverage detected