The Vision
We started from a simple question: what if an AI agent’s memory worked like a game world?
In a game engine, thousands of entities live in an ECS (Entity-Component- System) world. Each entity is a bag of typed components. Systems iterate over them. Entities are born, age, interact, and die. The world evolves.
Agent memory today is none of this. It’s either:
- Vector embeddings — opaque floats, queried by fuzzy similarity. You can’t read what the agent “knows.” You can’t debug why it recalled something. You can’t hand-edit a wrong fact.
- Flat key-value stores — no structure, no relationships, no lifecycle.
- Conversation logs — grow forever, no forgetting, no prioritization.
MemEcsy takes a different path: memory is structured code, not data blobs.
- Each memory is an Entity with typed Components (
Fact,UserPreference,Relationship). - Memories decay over time (exponential forgetting, derived on read — no background tick).
- Memories reinforce when accessed (access_count slows decay).
- Memories archive and sweep (logical → physical lifecycle).
- The LLM doesn’t just emit JSON args — it writes Tcl programs that compose recall + reasoning + storage in a single call.
- The persistent artifact is Odin source code (readable, diffable, git-versionable).
The agent grows like a game character: useful memories get stronger, irrelevant ones fade, the world becomes richer with every conversation.