whatisgithub

What is memledger?

riktar/memledger — explained in plain English

Analysis updated 2026-05-18

15PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

In one sentence

A memory system for AI agents that keeps a full, traceable history of every fact remembered, so you can see where it came from and why.

Mindmap

mindmap
  root((repo))
    What it does
      Traceable agent memory
      Provenance for every fact
      Regenerate with better models
    Tech stack
      Python
      SQLite
      Ollama
    Use cases
      Debuggable agent memory
      Memory regeneration
      Anti poisoning review
    Audience
      Developers
      AI agent 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

Give an AI agent long-term memory that logs exactly where every fact came from and why it was kept.

USE CASE 2

Debug a misbehaving AI agent's memory by tracing a fact back to the original conversation it was extracted from.

USE CASE 3

Regenerate an agent's entire memory using a newer, better model instead of being stuck with old extraction errors.

What is it built with?

PythonSQLiteOllama

How does it compare?

riktar/memledger13127905/deep-learning-based-air-gesture-text-recognition-42kyynfqjv-dot/deepseekradio
Stars151515
LanguagePythonPythonPython
Setup difficultymoderatemoderatehard
Complexity3/53/54/5
Audiencedeveloperdeveloperdeveloper

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

How do you get it running?

Difficulty · moderate Time to first run · 30min

Runs locally as a single SQLite file, works with a local Ollama model or any OpenAI-compatible endpoint.

MIT license, free to use for any purpose including commercial use.

So what is it?

MemLedger is a memory system for AI agents that keeps a full, traceable history of every fact the agent remembers, so you can always find out where a memory came from and why it was kept. Most memory tools let an AI chatbot remember things across conversations, but once a fact is stored you usually cannot tell which sentence it was pulled from, which model extracted it, or why an old preference suddenly disappeared. MemLedger solves that by logging every step: a single command, memledger why, shows the exact sentence a memory was born from, the model that extracted it, when it became a permanent fact, and who approved that promotion. The system stores memory in three layers that mirror how people remember things. Instinct holds core facts that get included in every conversation, either set by you directly or promoted automatically once a fact proves reliable across several sessions. Episodic holds longer term facts extracted by an AI model at checkpoints, each with a confidence score and an expiration time. Working memory holds the current conversation's turn by turn history. All three layers are built on top of a single append only log of events stored in SQLite, so the log itself, not any summary view, is treated as the true record. To keep costs down, MemLedger uses a free, rule based filter to decide which parts of a conversation are worth sending to an AI model for fact extraction at all, skipping small talk that carries no real information. New facts are also quarantined and need to be confirmed across multiple sessions, or approved by a person, before becoming permanent, and if a bad fact does slip through, its full history lets you trace it and delete it along with anything that was derived from it. Because the raw conversation history is always kept, you can regenerate the entire memory later with a better AI model instead of being stuck with whatever an earlier, weaker model extracted. It runs as a single SQLite file on your own machine, works with a local model through Ollama or with any cloud AI service, requires no server, and is released under the MIT license.

Copy-paste prompts

Prompt 1
Help me install memledger and set up a basic session that recalls memories and builds context for my agent.
Prompt 2
Show me how to use memledger why to trace a specific memory back to its source conversation.
Prompt 3
Explain how the instinct, episodic, and working memory layers in memledger work together.
Prompt 4
Walk me through regenerating my agent's memory with a different model using memledger's regenerate command.

Frequently asked questions

What is memledger?

A memory system for AI agents that keeps a full, traceable history of every fact remembered, so you can see where it came from and why.

What language is memledger written in?

Mainly Python. The stack also includes Python, SQLite, Ollama.

What license does memledger use?

MIT license, free to use for any purpose including commercial use.

How hard is memledger to set up?

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

Who is memledger for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.