Memory Overview
Memory enables agents to learn from past experiences and improve over time. Instead of treating each task as isolated, agents remember what worked, what didn't, and apply those lessons to future tasks.
What is Memory?
Memory stores execution results, insights, and experiences from tasks:
- Task patterns — approaches that worked for similar tasks.
- User preferences — communication style and format preferences.
- Execution insights — successes, failures, and lessons learned.
- Best practices — effective tool combinations and strategies.
How Memory Works
Storage — after a task completes, Xagent analyses the result, extracts insights, stores structured notes, and indexes them for search.
Retrieval — when a new task starts, Xagent searches memory, selects relevant matches by similarity, enhances its understanding of the goal, and avoids past mistakes while reusing what worked.
Managing Memory
POST /api/memory # create a memory
GET /api/memory # list memories
GET /api/memory/{id} # get a memory
PUT /api/memory/{id} # update a memory
DELETE /api/memory/{id} # delete a memory
GET /api/memory/stats # memory statisticsYou stay in control of what is remembered: list and inspect stored memories at any time, correct one with an update, or delete memories you don't want kept. Memory is scoped per user — one user's memories are never retrieved for another.
Continuous learning
Memory turns isolated runs into a learning loop: pattern recognition across similar tasks, richer context for new goals, and fewer repeated mistakes.