explaingit

leapmemory/memory-bench

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

An open benchmark tool that measures how many fewer tokens LeapMemory's recall uses compared to pasting full conversation history, at matched accuracy.

Mindmap

mindmap
  root((memory-bench))
    What it does
      Compares memory vs paste
      Token reduction
      Both-correct gate
    Tech stack
      Python
      bench.py
    Use cases
      Memory system evaluation
      Cost measurement
    Audience
      Developers
      LLM builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Measure real token savings from using a memory service instead of pasting chat history.

USE CASE 2

Check whether a memory system's recall accuracy matches pasting full context.

USE CASE 3

Run the benchmark against your own exported conversation history.

USE CASE 4

Compare token costs as conversations grow longer.

What is it built with?

Python

How does it compare?

leapmemory/memory-bench0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a LeapMemory account with prepaid credits and a model provider API key.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

memory-bench is an open benchmark tool for testing whether an AI memory service called LeapMemory actually saves on cost and effort compared to the common approach of pasting a full conversation history into an AI model every time. The comparison works by asking the exact same question twice under two conditions: once with the entire past conversation pasted in as context, and once using only a single relevant memory returned by LeapMemory. Both answers are checked against a known correct answer, and only questions that both approaches answer correctly count toward the final comparison, which the project says prevents a memory failure from being hidden in the numbers. The results show real token savings, growing larger as conversations get longer, since pasting the full history grows with every turn while the memory-based approach stays roughly the same size no matter how long the conversation gets. In the tests reported, the memory-based approach used significantly fewer tokens than pasting full history while matching accuracy exactly. The tool tests direct factual recall, such as names, numbers, dates, and one changed fact, not deeper reasoning, contradiction handling across many facts, or performance after months of real use, and the author states these gaps plainly rather than hiding them. Running the tool yourself requires signing up for a LeapMemory account, creating an API key, adding a small amount of prepaid credit, and running a provided Python script against either a public sample conversation or your own exported chat history. The project is written in Python and released under the MIT license, meaning it can be freely used, copied, and modified, including for commercial purposes.

Copy-paste prompts

Prompt 1
Run memory-bench against the sample_30 corpus and explain the results table.
Prompt 2
Explain how memory-bench prevents a memory failure from inflating the token-reduction number.
Prompt 3
Help me convert my own exported chat history into memory-bench's jsonl corpus format.
Prompt 4
Walk me through LeapMemory's write and read paths described in this repo.

Frequently asked questions

What is memory-bench?

An open benchmark tool that measures how many fewer tokens LeapMemory's recall uses compared to pasting full conversation history, at matched accuracy.

What language is memory-bench written in?

Mainly Python. The stack also includes Python.

What license does memory-bench use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is memory-bench to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is memory-bench for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.