context-constitution: Letta's Constitution Treats Memory Like Law

A Markdown-first spec for agents that keep identity, tools, and memory under version control.

11 min read · letta-ai/context-constitution

An open constitution book sits beside a filing cabinet and a balance scale made from tokens. The scene shows that Letta is not just documenting agents, it is governing how they remember, act, and persist across sessions.
Letta frames context as something to govern, not something to hope survives the next prompt.

The agent is brand new - it doesn't know anything about you, and has [no] real history of prior interactions. In contrast, Letta Code is fully stateful. The idea is that you work with a small handful of agents that get better and better over time as they learn more about you and your codebase.

Charles Packer, Co-founder and CEO of Letta · Tessl interview
Key Takeaways

Most AI repos add another wrapper. This one adds a constitution. That sounds grandiose until you notice the move underneath it: Letta is treating context as a governed resource, not a disposable prompt buffer. If an agent is going to remember, forget, and improve, those actions need rules.

Why a constitution at all?

The repository belongs to Letta, the company behind MemGPT, and it reads like the formal layer on top of that work. Letta's own blog says the Context Constitution is "a set of principles governing how AI agents manage context to learn from experience." That matters because the repo is not a library you import. It is a document the agent is meant to live under.

Today we are releasing the Context Constitution: a set of principles governing how AI agents manage context to learn from experience. We use the Constitution internally as the foundation of our prompting and for training memory-native models.

Letta, Blog post · Context Constitution | Letta

That is a different kind of software artifact. Instead of shipping more code paths, the project ships operating principles for identity, continuity, and memory management. The documentation is written in the second person because the audience is the agent itself. In other words, the docs are part of runtime behavior.

Hedcut portrait of Charles Packer, co-founder and CEO of Letta.

The two markdown files that do the real work

The repo is small on purpose. constitution/CONSTITUTION.md defines the identity layer. constitution/AFFORDANCES.md defines the interface layer. Together they say what the agent is, then what it can touch. The GitHub Actions check for whitespace sounds trivial, but in a prompt-heavy system, clean markdown is part of the runtime surface.

constitution/
  CONSTITUTION.md      identity, continuity, learning
  AFFORDANCES.md       tools, filesystem, memory access
.github/workflows/
  check-whitespace.yml
A close-up of filing drawers, folders, and a commit stamp arranged like a filesystem. The image explains MemFS, where an agent's memory is presented as files it can read, write, and version.
MemFS turns memory into a familiar interface: files, folders, and commits.

The Constitution treats memory as a pipeline, not a black box, with Git and sleep-time compute keeping the pipeline legible.

Read that flow as an argument. Letta is saying that an agent does not need to cram everything into a single prompt. It needs a memory system with tiers, a place for procedural knowledge, a place for durable facts, and a way to revise the whole thing over time. The payoff is continuity without pretending the model weights are changing live.

Why git belongs in memory

This is the sharpest part of the design. Rather than inventing a proprietary memory API, Letta leans on a filesystem and Git, two abstractions developers already trust. That makes agent state inspectable, diffable, and rollback-friendly. If an agent becomes confused, you are not forced to throw away the whole system. You can inspect what changed and restore a known good state.

DimensionStateless coding CLILetta Context Constitution
Memory ownershipThe session owns the context, and it disappears when the chat ends.The harness owns the context, and the agent keeps a durable memory filesystem.
LearningMostly prompt repetition and manual recontextualization.Context is edited, versioned, and reorganized over time.
Operational modelFast resets, low maintenance, little continuity.Git-backed persistence, auditing, and rollback.
Best forSingle-shot assistance and short tasks.Long-lived agents that should accumulate familiarity.

The Context Constitution defines how agents should use these affordances to learn, build identity, and improve over time.

Context Constitution repository, GitHub repository · GitHub repository

The competitive implication is clear. Stateless tools optimize for immediate throughput. Letta is optimizing for memory as a product surface. That is a different bet, and it pushes the engineering conversation away from prompt crafting and toward context governance, audit trails, and long-horizon behavior.

What this changes for builders

If you are building agents, the repo is a reminder that the hard part is no longer just making the model answer well. It is deciding what the agent should remember, where that memory should live, and how it should evolve without becoming chaotic. That is why this project feels bigger than its size. It is not a codebase first. It is a constitution for software that has to live with its own history.