git404hub

what is pyforge-memory fr?

forgedlogicdev/pyforge-memory — explained in plain English

Analysis updated 2026-05-18

2PythonAudience · developerComplexity · 2/5LicenseSetup · easy

tl;dr

pyforge-memory gives AI agents three-tier memory, combining verbatim recency, keyword relevance, and a compressed digest, so context stays small and relevant instead of dumping the full chat history.

vibe map

mindmap
  root((pyforge-memory))
    What it does
      Three-tier memory
      Verbatim recency
      Keyword relevance
      Digest summary
    Tech stack
      Python
      JSONL storage
    Use cases
      Compact agent context
      Poison filtering
      Knowledge file search
    Design
      No database
      Framework agnostic
      Configurable filters

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 make with this?

VIBE 1

Build a compact, relevant context window for an LLM agent instead of sending the full conversation history.

VIBE 2

Filter out generic AI-assistant boilerplate before it gets saved into an agent's memory.

VIBE 3

Search a folder of plain text knowledge files by keyword alongside conversation memory.

what's the stack?

Python

how it stacks up fr

forgedlogicdev/pyforge-memory0-bingwu-0/live-interpreter0cm-labs/tokenizer-benchmark
Stars222
LanguagePythonPythonPython
Setup difficultyeasymoderatemoderate
Complexity2/52/52/5
Audiencedevelopergeneralresearcher

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

how do i run it?

Difficulty · easy time til it works · 30min

Installs via pip with no database or API keys required, but you still need your own LLM API call to wire it to.

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

in plain english

pyforge-memory gives AI agents a smarter way to remember past conversations, instead of stuffing the entire chat history into the prompt every time. The README explains that most memory tools dump every exchange into the context window, and after enough turns the agent's core instructions get pushed out and it starts behaving like a generic assistant. This library solves that by building context out of three separate tiers with their own small character budgets. The first tier is verbatim recall, the last several exchanges kept exactly as they happened, so the conversation still flows naturally. The second tier is keyword recall, older memory entries and knowledge-base files that match keywords found in the current message, so relevant older context gets pulled back in when it matters. The third tier is a digest, a compressed rolling summary of everything older than that, which keeps a sense of continuity without keeping every word. Combined, the README reports this drops total context from roughly 3000 characters down to about 1000, while keeping the parts that actually matter. The library also includes what it calls poison filtering, which detects and blocks generic assistant phrases such as declaring itself an AI language model, so that kind of boilerplate does not get saved into memory and repeated back later. It stores everything as plain JSONL files rather than in a database, needs no API keys of its own, and works with any language model API you call yourself, including Ollama, OpenAI, Claude, or a local model. You can also point it at a folder of plain text files as a knowledge base that gets keyword-searched alongside conversation memory. To use it, you install the package, create a MemoryEngine pointed at storage folders for memory and knowledge, and call it to build a context list for each incoming user message before passing that to your own language model call, then save the exchange afterward so it becomes part of future memory. The forbidden terms used for poison detection are configurable. The project is released under the MIT license and describes itself as used in production at the author's own company.

prompts (copy fr)

prompt 1
Show me how to initialize pyforge-memory's MemoryEngine with a memory and knowledge directory.
prompt 2
Explain how pyforge-memory's verbatim, keyword, and digest tiers each build part of the context.
prompt 3
How would I customize pyforge-memory's poison filtering with my own forbidden terms?
prompt 4
Walk me through wiring pyforge-memory into an existing OpenAI or Claude API call.

Frequently asked questions

what is pyforge-memory fr?

pyforge-memory gives AI agents three-tier memory, combining verbatim recency, keyword relevance, and a compressed digest, so context stays small and relevant instead of dumping the full chat history.

What language is pyforge-memory written in?

Mainly Python. The stack also includes Python.

What license does pyforge-memory use?

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

How hard is pyforge-memory to set up?

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

Who is pyforge-memory for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.