Skip to main content

Memory Block

A memory block is a labeled, persistent chunk of agent memory directly editable by the agent via tool calls. The term originates with Letta (formerly MemGPT). Conventional blocks include `human` (what the agent knows about the user) and `persona` (the agent's own self-description), with custom blocks for project context, preferences, or domain-specific state.

Memory blocks live in main context — the agent sees them on every turn — and are edited via tools like `core_memory_append` and `core_memory_replace`. The structure makes semantic memory programmable in a way unstructured prompt-stuffing does not.

Example

A coding-assistant agent has memory blocks named `user_preferences` (preferred languages, code style) and `project_context` (current repo, recent files touched). When the user mentions "I'm switching to TypeScript for this project," the agent calls `core_memory_append` on `user_preferences` to record the change — and from the next turn onward, every prompt automatically includes that fact.

Frequently asked questions

What is Memory Block?

A memory block is a labeled, persistent chunk of agent memory directly editable by the agent via tool calls. The term originates with Letta (formerly MemGPT).

How does Memory Block work?

Memory blocks live in main context — the agent sees them on every turn — and are edited via tools like `core_memory_append` and `core_memory_replace`. The structure makes semantic memory programmable in a way unstructured prompt-stuffing does not.

Can you give an example of Memory Block?

A coding-assistant agent has memory blocks named `user_preferences` (preferred languages, code style) and `project_context` (current repo, recent files touched). When the user mentions "I'm switching to TypeScript for this project," the agent calls `core_memory_append` on `user_preferences` to record the change — and from the next turn onward, every prompt automatically includes that fact.