whatisgithub

What is memory-stack?

stas4000/memory-stack — explained in plain English

Analysis updated 2026-05-18

4PythonAudience · developerComplexity · 3/5LicenseSetup · easy

In one sentence

A five-layer memory system for AI assistants that keeps working even if one layer fails, so the assistant stays consistent over months of use.

Mindmap

mindmap
  root((memory-stack))
    What it does
      Layered AI memory
      Stays reliable over time
      Each layer fails alone
    Tech stack
      Python
      Standard library only
    Use cases
      Assistant memory
      Nightly summaries
      Fact storage
    Audience
      Developers
      AI builders
    Layers
      Raw log
      Short term
      Long term
      Retrieval
      Write back

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

Add a durable, layered memory system to a custom AI assistant or agent.

USE CASE 2

Build a nightly summary job that keeps an assistant's short-term memory current.

USE CASE 3

Store and search facts about a user or project without setting up a full vector database.

USE CASE 4

Use the command line tool to log, search, and promote memories for a personal AI project.

What is it built with?

Python

How does it compare?

stas4000/memory-stack1038lab/agnes-ai3eyedtiger/video2vrcemote
Stars444
LanguagePythonPythonPython
Setup difficultyeasyeasyeasy
Complexity3/52/51/5
Audiencedevelopervibe codervibe coder

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

How do you get it running?

Difficulty · easy Time to first run · 5min

No dependencies and no API keys needed to try the basic example.

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

So what is it?

Memory Stack is a design for giving long-running AI assistants a memory that stays reliable for months, not just a single conversation. The idea behind it is that no one memory technique works well on its own: vector databases drift over time, summaries lose detail, and context windows fill up. Instead of picking one system and hoping it holds, this project splits memory into five separate layers, each with one job, so that if any single layer breaks, the assistant still works with the layers that are left. The five layers are: a raw daily log that records every message exactly as it happened, a short-term rolling summary covering the last few days, a long-term file of durable facts and preferences, a semantic search layer that can look things up across everything stored, and a write-back step that saves new information after each turn. Layers below are treated as the source of truth: if the search layer disagrees with the curated long-term file, the file wins, not the search result. You do not need a vector database to start. The project explains how to get most of the benefit with just three markdown files and a scheduled job that rewrites the short-term summary each night. The full working version, in the memstack folder, is plain Python with no outside dependencies, so it can run anywhere Python 3.10 or later is available. It comes as both a command line tool, with commands to log, search, promote facts, and build context for the assistant, and as a Python library you can import directly. The search layer offers two options: a simple built-in method that compares word overlap, which many projects never need to outgrow, and a slot for plugging in your own vector-based search when you need something more powerful. There are no required accounts, API keys, or paid services baked into the project itself. This project is licensed under MIT, meaning it is free to use, modify, and build on with very few restrictions.

Copy-paste prompts

Prompt 1
Show me how to wire memstack into my own chatbot so it remembers past conversations.
Prompt 2
Explain how the five memory layers in this repo work together and when each one is used.
Prompt 3
Write a cron job that uses memstack's summarize command to refresh SHORT_TERM.md every night.
Prompt 4
Help me plug a real embedding model into memstack's VectorRetriever for better search.
Prompt 5
Walk me through running the example agent loop in this repo with no API keys.

Frequently asked questions

What is memory-stack?

A five-layer memory system for AI assistants that keeps working even if one layer fails, so the assistant stays consistent over months of use.

What language is memory-stack written in?

Mainly Python. The stack also includes Python.

What license does memory-stack use?

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

How hard is memory-stack to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is memory-stack for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.