PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agents
The paper introduces PROJECTMEM, an open-source, local-first memory and judgment layer for AI coding agents that uses an event-sourced log to provide compact context summaries and deterministic pre-action gates, thereby preventing redundant debugging and enabling auditable, stateful development.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are hiring a brilliant, hyper-fast software engineer to help you build an app. This engineer is incredibly smart, but they have a very strange quirk: they have total amnesia every time you close the chat window.
Every time you start a new conversation, this engineer:
- Forgets everything you told them yesterday.
- Re-reads your entire codebase from scratch.
- Re-discovers problems you already solved.
- Most frustratingly: Tries to fix a bug using the exact same method that failed three times yesterday, wasting hours of your time.
This is the current state of AI coding assistants. They are powerful, but they are "stateless"—they don't remember the project's history once the session ends.
ProjectMem is a new tool designed to fix this. Think of it as a permanent, super-organized notebook that sits right next to your code, which the AI is forced to read before it takes any action.
Here is how it works, using simple analogies:
1. The "Black Box" Log (Event Sourcing)
Instead of the AI trying to guess what happened, ProjectMem keeps a strict, unchangeable diary of every step taken in the project.
- The Analogy: Imagine a construction site where every worker must write down exactly what they did in a logbook before they leave for the day.
- "I tried to fix the leaky pipe, but it burst." (Attempt: Failed)
- "I tried a different wrench, and it worked." (Attempt: Success)
- "We decided to use copper pipes, not PVC." (Decision)
- Why it matters: This log is written in plain text (like a simple text file), not a complex database. It's like a grocery list that anyone can read, search, and understand. It never gets deleted or edited; new entries are just added to the bottom. This creates a perfect, unalterable history of the project.
2. The "Smart Summarizer" (Projection)
The AI doesn't need to read the entire 500-page diary every time it starts work. ProjectMem automatically condenses that log into a short, easy-to-read "Cheat Sheet."
- The Analogy: It's like a teacher who reads your entire semester's homework log and hands you a one-page summary of "What we learned this week" before the final exam. The AI gets the highlights (the summary) instead of the raw data dump, saving time and money.
3. The "Bouncer" (Judgment Layer)
This is the most unique part. ProjectMem doesn't just tell the AI what happened; it stops the AI from making the same mistake again.
- The Analogy: Imagine a bouncer at a club who checks a guest list.
- If the AI tries to edit a file that caused a crash yesterday, the Bouncer steps in and says: "Hold on! You tried to fix this file two days ago, and it broke. Don't do that again."
- This happens before the AI makes the change. It acts as a safety gate based on the project's own history, not on a guess.
4. The "Local-First" Rule
ProjectMem runs entirely on your own computer.
- The Analogy: It's like keeping your family photo album in your living room, not uploading it to a stranger's cloud server.
- Privacy: No data leaves your machine. Your code and secrets stay safe.
- Speed: Because it's local, it's instant.
- No "Black Magic": It doesn't use complex AI to "guess" what to remember; it uses simple, deterministic rules (if X happened, then warn about X).
The Results (What the Paper Claims)
The authors tested this system on 10 different real-world projects over two months. They found:
- Less Wasted Time: The AI didn't have to re-read thousands of lines of code to remember context.
- Fewer Repeated Mistakes: The "Bouncer" successfully warned the AI about previously failed fixes.
- Cost Savings: By avoiding the need to re-send the entire project context to the AI every time, they estimated saving a massive amount of "tokens" (the currency used to pay AI models), potentially cutting costs by more than half per session.
- Audit Trail: Because every action is logged in plain text, you can look back and see exactly why a decision was made, making the AI's work transparent and trustworthy.
In short: ProjectMem turns an AI coding assistant from a forgetful genius who repeats mistakes into a seasoned team member who remembers the project's history, learns from past failures, and warns you before you make the same error twice.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.