External Publication
Visit Post

How do you design memory systems for long-running AI agents?

Hugging Face Forums [Unofficial] May 6, 2026
Source

Hi Michael,

I’ve been working on an open source project called Context Compiler that takes a similar approach to what Pimpcat described — the runtime owns authoritative state, and the model only receives a controlled working view each turn.

It maintains a small explicit state (premise + policies) outside the model. The host injects this state into the prompt before each call, and updates are handled deterministically from user directives rather than inferred by the model.

The motivation was exactly the issues you mentioned: constraint drift, corrections not sticking, and conversations accumulating contradictions instead of resolving them.

It’s not a full memory system (no retrieval layer), but a deterministic state layer that can sit alongside external storage or retrieval.

There are runnable demos comparing baseline vs compiler-mediated behavior across several models and providers. Across 7 models tested, baseline passes 26/42 scored scenarios, while the compiler-mediated path passes 42/42.

github.com

GitHub - rlippmann/context-compiler: Deterministic state engine for managing...

Deterministic state engine for managing conversation state and constraints in LLM applications.

The demos are probably the most concrete way to see the pattern in practice.

Discussion in the ATmosphere

Loading comments...