Memory and context
What the agent knows and remembers

How it remembers you and your work

What the model sees on every call, how memory is layered, when it's written, who shares it, and how the conversation stays small over weeks. The talk is the main source; the docs add the rules and the Team Bot details. Claims are tagged with their source.

13 sectionsTags: Talk xAI docs Cursor eng Inferred UnknownP to present
00Start here

Quick answers

The questions people ask first about memory and context.

QuestionShort answerEvidenceMore
What does it remember?Stable working preferences, important facts, and summaries of its work. In the talk: facts about you, a dated log, and short-lived notes.xAI docs Talk§06
What's always in the prompt?Core facts about you (up to 100 facts in 4,000 characters), the 30 most relevant log entries, and a snapshot of routines. Skills appear as one-line pointers.Talk§05
How does it find older things?With a memory search tool, and by searching its files with shell commands.Talk§07
When is memory updated?A pass after each turn adds new facts and replaces old ones. It can only remove facts it was shown. The review model doesn't check memory writes.Talk xAI docs§07
Where is it kept?Memory, conversations and Bot setup on the server (skills most likely too). Work files and logins on the computer. The model only holds what's in its context on a given call.Talk xAI docs Inferred§01
Can the agent search its memory?Yes: a memory search tool runs on the server, and shell and file tools search work files on the computer. Tool details and skill text are also looked up on demand.Talk Inferred§04
Do my Bots share memory?Facts about you are shared by all your Bots; each Bot writes to its own file. Each Bot's own log and notes most likely stay with that Bot.Talk Inferred§08
And Team Bots?Team memory is read by every teammate's conversation. Notes with each person stay private to that person.xAI docs§08
What happens when a conversation gets long?Older messages are summarized, ideally while the provider's cache is still warm. The last few messages to you are kept word for word.Talk§07
Can I see or edit what it remembers?No control for this is documented. You correct the Bot directly, and lasting rules go in the Bot's description.xAI docs Unknown§10
Copy or delete a Bot?Duplicating doesn't copy conversation history or learned memory. Deleting removes the Bot's profile, conversation and routines.xAI docs§08
Is memory treated as instructions?No. The model is told memories are information, not instructions.Talk§10
Is memory the source of truth?No. Changing facts belong in the source system; for consequential decisions the Bot should reopen current data.xAI docs§10
01Map

Where context and memory live

Three places: the model's context on a single call, the server, and the computer. Arrows are how things move between them.

In the model's contextrebuilt on every call, gone after
Tool definitionsFull details for a core set; other tools by name
Talk
System promptBot instructions, facts about you, top 30 log entries, routines snapshot, skill pointers
Talk Inferred
ConversationHistory from the latest summary, then the newest message
Talk
This turn's resultsTool outputs, search results, helper reports, file paths
Talk
loaded into the prompt
memory search, read skill, tool search
after-turn memory pass, memory writes
Serverdurable; survives a rebuilt computer
MemoryFacts about you, logs, notes, older memories. The talk describes them as files and lists them in the server's saved state; the physical store isn't stated
Talk Unknown
Team memoryTeam Bots only
xAI docs Inferred
Conversation logAppend-only; every app reads it
Talk Cursor eng
SummariesUsed to rebuild the prompt after compaction
Talk
Bot setupDescription, routines, enabled skills
xAI docs
Skill libraryShared by all your Bots; most likely here
xAI docs Inferred
Tool detailsLoaded on demand
Talk Inferred
shell, read file, grep (wakes the computer)
files sync to cloud storage before sleep
Computerthe user's VM, shared by their Bots
/workspace filesWork files shared by all your Bots; synced before sleep
xAI docs Talk
Browser state and loginsCookies, sessions, CLI credentials
xAI docs
Long outputsKept as files; shown here as the likely place, not documented
Talk Inferred Unknown

The model only "knows" what's in its context on a given call. Everything else it has to load, search or read with a tool. Talk

02Every layer

Every layer: where it lives, how it's used, how it's updated

Where each layer lives, how much of it the model sees, how it gets in, and what changes it. Dots show the evidence.

Layer
ServerComputerNot doc.
How much is in the prompt
How it gets into context
What updates it
About you and the Bot
Bot instructions
always
auto-loaded
you edit it
Facts about you
always · 100 facts
auto-loaded
after-turn pass
Log
top 30
auto + search
not documented
Notes
while relevant
auto-loaded
during work
Older memories
never
memory search
not documented
Team memory
every conversation
auto-loaded
not documented
The conversation
History
from last summary
auto-loaded
every step
Summary
replaces old history
auto-loaded
summarizer
Know-how
Skills
pointer only
read on demand
saved by you / Bot
Tool definitions
core set + names
auto + tool search
fixed until summary
Routines
snapshot
auto-loaded
you ask the Bot
Work
Work files
never
shell, files
tools
Long outputs
path only
read file
when too long
Sub-agent context
never
short report
discarded after
TalkxAI docsCursor engInferredUnknown
03Tools

The tools the agent uses to reach memory and context

What the agent can call when the answer isn't already in its context, grouped by where the tool runs.

The agentthe model, with only what's in its context right now
Server
Memory searcholder memories
Memory writememory
Tool searchtool details
Read skillskill library
Computer wakes it if asleep
Shell, grepsearch and run anything
Read / write file/workspace files
Elsewhere
Delegatesub-agent (own context)
Conversation searchpast messages
Not a tool: after each turn a separate memory pass adds and replaces facts on the server, without the model asking.
TalkxAI docsCursor engInferredUnknown
04Loop

Memory in the agent loop

One turn, step by step: how memory gets into the prompt, how the model searches it, and how it's written back. The flow is our reading of the talk; the tags show what's sourced. For simplicity, the diagram leaves out each activity's result going back to the workflow, which records it.

Youor a trigger
Agent workflowTemporal
Activityserver worker
Modelinference
Memory storeserver
Computerthe user's VM
1message starts a turn
2loadState activity
3read facts, top 30 log, routines, summary
4prompt with memory snapshot
5memory_search("Acme")
6search older memories and logs
7matching snippets
8snippets as the tool result
9shell: grep /workspace
10run grep (wakes the computer)
11matching lines
12matches as the tool result
13reply via SendToUser
After the turn
14memory pass activity
15"what should be added or changed?"
16new facts, replacements, a log entry
17write to the memory store
While you're away
18summarize the long history
19save summary for the next turn
  1. 1
    You → Agent workflowYour message (or a routine, Slack event, another Bot) starts a turn. Talk
  2. 2
    Agent workflow → ActivityThe workflow can't read storage itself, so it runs an activity on a server worker. Cursor eng Inferred
  3. 3
    Activity → Memory storeThe activity reads what goes into every prompt from the memory store. Talk Inferred
  4. 4
    Activity → ModelThe facts and log entries are now plain text in the prompt. That's all the model "knows" at this point. Talk
  5. 5
    Model → ActivityThe answer isn't in the prompt, so the model asks for a memory search. Talk Inferred
  6. 6
    Activity → Memory storeA tool-call activity runs the search against the memory store on the server. Talk Inferred
  7. 7
    Memory store → ActivityShort snippets come back, not whole files. Inferred
  8. 8
    Activity → ModelThe snippets are added to the conversation for this turn. Talk Inferred
  9. 9
    Model → ActivityFor work files, the model uses the shell like any Linux user. Talk
  10. 10
    Activity → ComputerThe call goes to the computer; if it's asleep, it's restored first. Talk Inferred
  11. 11
    Computer → ActivityThe computer returns the matching lines. Inferred
  12. 12
    Activity → ModelThey're added to the conversation as the tool result. Inferred
  13. 13
    Agent workflow → YouThe model answers; the workflow sends the reply. Talk
  14. After the turn
  15. 14
    Agent workflow → ActivityA separate step runs after the turn, without the model asking for it. Talk Inferred
  16. 15
    Activity → ModelA model call sees the turn and the current facts. Inferred
  17. 16
    Model → ActivityThe model returns what to add, what to replace, and a dated log entry for this turn. Talk Inferred
  18. 17
    Activity → Memory storeIt can only remove facts it was shown. The review model doesn't check memory writes. Talk xAI docs
  19. While you're away
  20. 18
    Activity → ModelAbout 10 minutes after a big turn, while the provider's cache is still warm. Talk
  21. 19
    Activity → Memory storeThe next turn starts from this summary. Talk Inferred
The calls the model makes (names and examples are ours) Inferred
CallExampleWhat comes back
memory_searchmemory_search("Acme renewal")A few dated snippets from older memories and logs
memory_writememory_write(kind="fact", "Prefers summaries in bullets")OK; the fact is saved
read_skillread_skill("weekly-report")The skill's full instructions
tool_searchtool_search("salesforce")Full details of the matching tools
shellshell("grep -ri acme /workspace")Matching lines from work files (wakes the computer)
read_fileread_file("<path of a saved long output>")A long output saved earlier, read back in parts (where it's saved isn't documented)

The talk names a memory search tool and shell search over files; the docs mention memory writes. The exact tool names and arguments aren't public.

Three different "logs"
Memory log

Dated events from past work. The model sees the 30 most relevant in its prompt and can search the rest. Talk

Conversation log

The transcript every app reads, append-only. Becomes the prompt's history, starting from the latest summary. Talk Cursor eng

Temporal history

The record of which steps ran and their results, used to resume after a crash. The model never sees it. Cursor eng Inferred

05Prompt

What the model sees at the start of a turn

Every call sends the whole prompt. It's ordered by how often each part changes, so most of it is a cache hit.

Tool definitionsA core set in full; other tools listed by name and loaded when needed
cached
System promptInstructions, plus a snapshot of memory (facts about you, the top 30 log entries) and routines. Skills as one-line pointers
cached
First messageEnvironment details and the list of tool names
cached
Conversation historyStarts from the latest summary; new messages are only added at the end
cached next call
Newest messageThe time, short notes on anything that changed, then your message
new each call
Fixed until the next summaryKept byte-for-byte identical, in a fixed order, so the provider can reuse its cached work. Each section is hashed so a change is easy to spot. Talk
Grows each callBecomes part of the reusable start of the next call. Talk
The only full-price partEverything above it is a cache hit. Talk

Notes

  • When you open the chat or start typing, the server prepares the prompt early to warm the cache. Talk
  • If a deploy changes a tool description, running conversations get a note instead of the new text, so the fixed start doesn't change. Talk
06Memory

The memory layers

From always in the prompt to only found by searching.

always presentfound on demand
ProfileCore facts about you
In the promptAlways in the prompt
SizeUp to 100 facts, 4,000 characters
LifetimeLong-lived; important facts rank higher, older ones slowly rank lower
ScopeShared by all your Bots; each Bot writes to its own file
Talk
LogDated events from past work
In the promptThe 30 most relevant recent entries
SizeNot documented
LifetimeLong-lived
ScopeMost likely per Bot
Talk Inferred
NotesShort-term details
In the promptWhile relevant
SizeNot documented
LifetimeShort-lived: relevant for maybe 30 minutes to an hour
ScopeMost likely per Bot
Talk Inferred
Everything elseOlder memories and files
In the promptOnly when searched
SizeNot documented
LifetimeNot documented
ScopePer Bot; facts about you shared
Talk Inferred

Team Bots add a fifth piece: team memory read by every conversation, plus private notes with each person. xAI docs The talk describes memory as files the agent searches, and lists memories in the state saved to the server's database and storage. Where the files physically live isn't stated. Talk Unknown

Notes

  • Some facts must be in every prompt (for example "always reply in lowercase"), otherwise one reply would suddenly break the rule. Talk
  • The talk compares it to how you keep today's details in mind and let the rest fade. Talk
07Lifecycle

How memory is read and written

One turn, from loading the prompt to summarizing while you're away.

1Before the first model call
Loads facts about you, the top 30 log entries and a routines snapshot into the system prompt. Talk
Adds conversation history from the latest summary. Talk
2While it works
Searches memory and files when it needs something older. Talk
Reads skill text and tool details only when needed. Talk
Long outputs go to files; helpers return short reports. Talk
3After each turn
A memory pass adds new facts and replaces old ones. It can only remove facts it was shown. Talk
Memory writes aren't checked by the review model. xAI docs
4While you're away
About 10 minutes after a big turn (over 100,000 tokens), it writes a summary while the provider's cache is still warm. Talk
Skipped if background work is about to wake it anyway; the last few messages to you stay word for word. Talk
A turn that gets too long can also be summarized in the middle. Talk

Notes

  • All compression is lossy. Deciding what to keep is the hard part; the talk jokes there are whole PhDs on it. Talk
08Scope

Who sees what

Your Bots, Team Bots, and what happens when you copy or delete one.

Your own Bots
Facts about youread by every Bot; each Bot writes to its own file Talk
Bot Aits log, notes, conversation summaries
Bot Bits log, notes, conversation summaries

Per-Bot log and notes are our reading. Inferred

A Team Bot
Team memoryread by every teammate's conversation xAI docs
Notes with youprivate to you
Notes with a teammateprivate to them

xAI docs

Copying and deleting
Duplicate a BotCopies profile, settings, enabled skills and routines. Not conversation history, learned memory or attachments. xAI docs
Delete a BotRemoves its profile, conversation and routines. Files and sign-ins on the shared computer may remain. Backend retention follows Cursor's terms. xAI docs
09Small context

Keeping the main conversation small

The main agent has the longest conversation and gets summarized many times, so anything bulky lives outside it.

Long outputs go to files

The context keeps only the file path

Screenshots go to a helper

The context gets what it found

Tool-heavy work goes to helpers

The context gets a short report

Main conversationStays small, so every call is fast and cheap, and the model keeps track of what matters
Old messages get summarized

The context keeps a short summary

Old memories stay searchable

Only the most important facts are in the prompt

Instructions become skills

The prompt keeps a one-line pointer

All from the talk. Talk The talk also calls a cache miss a bug: anything that changes the fixed start of the prompt makes every call full price.

10Rules

What memory is for, and what not to use it for

Guidance from the docs and the talk.

Memory is for

Stable working preferences, important facts, and summaries of past work, so the Bot keeps its role without replaying every message.

xAI docs
Not a source of truth

Keep changing facts in the source system, and have the Bot reopen current data before consequential decisions.

xAI docs
Correct it directly

If the Bot assumes something stale, tell it. No screen to view or edit memory is documented.

xAI docs Unknown
Lasting rules go in the description

Durable preferences, boundaries and responsibilities belong in the Bot's description, which is part of its setup.

xAI docs
Information, not instructions

The model is told to treat memories as information, not as orders to follow.

Talk
11Open

Open questions

Not documented anywhere we looked.

  • Storage formatThe talk describes memory as files and as saved server state. Whether it's database rows, files in storage, or copies on the computer for shell search isn't stated.
  • RankingHow the 30 "most relevant" log entries are chosen, and how fast importance decays.
  • Memory searchKeyword search over files, semantic search, or both?
  • Who writes the factsIs the after-turn pass a separate model call, and how are conflicts between Bots resolved?
  • Team memoryHow team memory gets written, and who can change it.
  • Viewing and editingWhether users will get a view, edit or export control.
  • RetentionHow long logs, notes and summaries are kept.
12Sources

Sources