@lethe-memory/lethe
v0.17.0
Published
Node bindings to the lethe memory store (Rust core via napi-rs).
Readme
lethe
Node.js bindings to the Rust core of lethe, a self-improving memory store for LLM agents. Built with napi-rs and distributed as prebuilt platform binaries, so no Rust toolchain is needed at install time.
Install
npm install @lethe-memory/lethe
# or
bun add @lethe-memory/letheUse
import { MemoryStore } from "@lethe-memory/lethe";
const store = await MemoryStore.open("./my_memories");
await store.add("I prefer window seats on flights");
await store.add("My wife needs aisle seats");
await store.add("I work at Google as a software engineer");
const hits = await store.retrieve("What are my travel preferences?", 5);
for (const h of hits) {
console.log(` [${h.score.toFixed(1)}] ${h.content}`);
}
await store.save();add / retrieve / save are async. napi-rs runs them via
tokio::spawn_blocking so the Node event loop never stalls on the ONNX
inference or DuckDB I/O.
Open options
MemoryStore.open(path, {
biEncoder?: string, // default "Xenova/all-MiniLM-L6-v2"
crossEncoder?: string, // default "Xenova/ms-marco-MiniLM-L-6-v2"
nClusters?: number, // RIF clusters; 0 disables clustering
useRankGap?: boolean,
kShallow?: number, // default 30
kDeep?: number, // default 100
});See also
- Project landing page: architecture, benchmarks, research journey
lethe-cli(Homebrew:lethe): the standalone CLI
License: MIT.
