forgedlogicdev/pyforge-memory — explained in plain English
Analysis updated 2026-05-18
Build a compact, relevant context window for an LLM agent instead of sending the full conversation history.
Filter out generic AI-assistant boilerplate before it gets saved into an agent's memory.
Search a folder of plain text knowledge files by keyword alongside conversation memory.
| forgedlogicdev/pyforge-memory | 0-bingwu-0/live-interpreter | 0cm-labs/tokenizer-benchmark | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | Python | Python | Python |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | general | researcher |
Figures from each repo's GitHub metadata at analysis time.
Installs via pip with no database or API keys required, but you still need your own LLM API call to wire it to.
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.
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.
Mainly Python. The stack also includes Python.
MIT license: use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.