teimurjan/lethe

A memory store for LLM agents. Hybrid BM25 + dense retrieval, cross-encoder reranking, clustered retrieval-induced forgetting (RIF), and an optional LLM enrichment layer at write time.

Rust

11

144 commits

updated Jul 16, 2026

See the code
agents
bm25
duckdb
llm
memory
rag

README

lethe

Λήθη — the ancient Greek personification of forgetfulness.

A memory store for LLM agents that gets better the more you use it. Hybrid BM25 + dense retrieval, cross-encoder reranking, clustered retrieval-induced forgetting (RIF). Every retrieval teaches it which entries are chronic distractors — no fine-tuning, just bookkeeping (Anderson, 1994).

Install

1. Install the CLI

Homebrew installs the lethe CLI:

brew tap teimurjan/lethe
brew install lethe

For the standalone CLI only, use Cargo on any platform with a Rust toolchain:

cargo install lethe-cli

Prebuilt CLI bundles are also available from GitHub Releases.

Verify the installation, then index and search the current project's Claude Code, Codex, and Oh My Pi transcripts:

lethe --version
lethe index
lethe search "query" --top-k 5
lethe                              # TUI

Transcript discovery uses ~/.claude, ~/.codex, and ~/.omp/agent by default and honors each agent's directory override environment variables.

2. Add a coding agent

The CLI works on its own. Install a plugin only if you want recall and recall-global available directly inside a coding agent.

Claude Code

/plugin marketplace add teimurjan/lethe
/plugin install lethe

Recall via skills — lethe indexes your Claude Code transcripts directly and writes nothing into your repos. See plugins/claude-code/README.md.

Codex CLI

codex plugin marketplace add teimurjan/lethe

Then run codex, open /plugins, and install lethe — it wires the recall / recall-global skills into Codex automatically. See plugins/codex/README.md.

Oh My Pi

omp plugin marketplace add teimurjan/lethe
omp plugin install lethe@teimurjan

Restart omp to load the recall / recall-global skills and the background index freshness hook. See plugins/omp/README.md.

Cross-project search and periodic compaction are also available from the CLI:

lethe search "query" --all --top-k 5
lethe dedupe --all

lethe TUI

Python

pip install lethe-memory
from lethe_memory import MemoryStore

store = MemoryStore("./my_memories")
store.add("I prefer window seats on flights", session_id="trip")
for hit in store.retrieve("travel preferences", k=5):
    print(f"[{hit.score:.1f}] {hit.content}")
store.save()

Node

npm install @lethe-memory/lethe
import { MemoryStore } from "@lethe-memory/lethe";
const store = new MemoryStore("./my_memories", { dim: 384 });
await store.add("first entry");
const hits = await store.retrieve("query", { k: 5 });

Benchmark

LongMemEval-S, full 199,509-turn corpus, turn-level NDCG@10:

StageNDCG@10Gain
Hybrid BM25 + vector (RRF)0.241baseline
+ cross-encoder reranking0.382+59%
+ clustered + gap RIF0.342+3.4% over RRF-truncation baseline
+ LLM enrichment, covered queries0.473+20–25%

Scope. RIF targets chronic-false-positives in long-term conversational memory. On NFCorpus (medical IR) it regresses — workload-specific by design. Full methodology + checkpoints in BENCHMARKS.md.

How it works

License

MIT

Contributors

teimurjan

129 commits

teimurjan/lethe

A memory store for LLM agents. Hybrid BM25 + dense retrieval, cross-encoder reranking, clustered retrieval-induced forgetting (RIF), and an optional LLM enrichment layer at write time.

Rust

11

144 commits

updated Jul 16, 2026

See the code
agents
bm25
duckdb
llm
memory
rag

README

lethe

Λήθη — the ancient Greek personification of forgetfulness.

A memory store for LLM agents that gets better the more you use it. Hybrid BM25 + dense retrieval, cross-encoder reranking, clustered retrieval-induced forgetting (RIF). Every retrieval teaches it which entries are chronic distractors — no fine-tuning, just bookkeeping (Anderson, 1994).

Install

1. Install the CLI

Homebrew installs the lethe CLI:

brew tap teimurjan/lethe
brew install lethe

For the standalone CLI only, use Cargo on any platform with a Rust toolchain:

cargo install lethe-cli

Prebuilt CLI bundles are also available from GitHub Releases.

Verify the installation, then index and search the current project's Claude Code, Codex, and Oh My Pi transcripts:

lethe --version
lethe index
lethe search "query" --top-k 5
lethe                              # TUI

Transcript discovery uses ~/.claude, ~/.codex, and ~/.omp/agent by default and honors each agent's directory override environment variables.

2. Add a coding agent

The CLI works on its own. Install a plugin only if you want recall and recall-global available directly inside a coding agent.

Claude Code

/plugin marketplace add teimurjan/lethe
/plugin install lethe

Recall via skills — lethe indexes your Claude Code transcripts directly and writes nothing into your repos. See plugins/claude-code/README.md.

Codex CLI

codex plugin marketplace add teimurjan/lethe

Then run codex, open /plugins, and install lethe — it wires the recall / recall-global skills into Codex automatically. See plugins/codex/README.md.

Oh My Pi

omp plugin marketplace add teimurjan/lethe
omp plugin install lethe@teimurjan

Restart omp to load the recall / recall-global skills and the background index freshness hook. See plugins/omp/README.md.

Cross-project search and periodic compaction are also available from the CLI:

lethe search "query" --all --top-k 5
lethe dedupe --all

lethe TUI

Python

pip install lethe-memory
from lethe_memory import MemoryStore

store = MemoryStore("./my_memories")
store.add("I prefer window seats on flights", session_id="trip")
for hit in store.retrieve("travel preferences", k=5):
    print(f"[{hit.score:.1f}] {hit.content}")
store.save()

Node

npm install @lethe-memory/lethe
import { MemoryStore } from "@lethe-memory/lethe";
const store = new MemoryStore("./my_memories", { dim: 384 });
await store.add("first entry");
const hits = await store.retrieve("query", { k: 5 });

Benchmark

LongMemEval-S, full 199,509-turn corpus, turn-level NDCG@10:

StageNDCG@10Gain
Hybrid BM25 + vector (RRF)0.241baseline
+ cross-encoder reranking0.382+59%
+ clustered + gap RIF0.342+3.4% over RRF-truncation baseline
+ LLM enrichment, covered queries0.473+20–25%

Scope. RIF targets chronic-false-positives in long-term conversational memory. On NFCorpus (medical IR) it regresses — workload-specific by design. Full methodology + checkpoints in BENCHMARKS.md.

How it works

License

MIT

Contributors

teimurjan

129 commits

Languages

Rust

51.5%

Python

37.1%

TeX

5.3%

TypeScript

3.3%

Shell

1.5%

JavaScript

1.3%