Memories give AnythingLLM a persistent sense of context that survives beyond any single conversation. Instead of starting from scratch every time you open a new chat, the model can recall facts it has learned about you — your preferred communication style, ongoing projects, key decisions made in previous sessions, and more. These stored facts are automatically woven into the system prompt at the start of each turn, so the model always has your history in view without you needing to re-explain it.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Mintplex-Labs/anything-llm/llms.txt
Use this file to discover all available pages before exploring further.
Memory Scopes
AnythingLLM stores two types of memories that operate at different levels:Global Memories
Attached to a user across all workspaces. These are general facts about the user — their name, preferred language, communication style, or cross-project context. Up to 5 global memories are stored per user.
Workspace Memories
Attached to a specific (user, workspace) pair. These capture workspace-specific context — project names, stakeholders, decisions, and terminology relevant to that workspace. Up to 20 workspace memories are stored per user per workspace.
Memory Injection
At the start of every chat turn, AnythingLLM fetches the user’s memories and appends them to the system prompt as a## Things I Remember About You section. The model receives both global memories and the most relevant workspace memories before it reads the user’s message.
Workspace Memory Reranking
A user can accumulate up to 20 workspace memories, but injecting all 20 on every turn would waste valuable context space. AnythingLLM only injects the top 5 most relevant workspace memories by reranking them against the current message and recent chat history. The reranking process:- Takes the current user message plus the last 3 chat messages as a combined query
- Uses the native embedding reranker to score each workspace memory against that query
- Selects the top 5 memories by relevance score
- Falls back to the 5 most recently created memories if the reranker fails
Automatic Memory Extraction
AnythingLLM includes a background job that reads recent chat history and extracts new memories automatically using a two-phase pipeline:Observer phase
The LLM reads a batch of recent chat messages and identifies candidate facts worth remembering. Each candidate is tagged as either
WORKSPACE scope (relevant to this project) or GLOBAL scope (relevant across all workspaces), and given an action of create (new fact) or update (revision of an existing memory).Reflector phase
A second LLM pass reviews the Observer’s candidates against the user’s existing memories to eliminate duplicates, resolve contradictions, and assess whether each candidate is genuinely worth storing.
Extraction Schedule
The memory extraction job runs on a background schedule controlled by two environment variables:| Variable | Default | Description |
|---|---|---|
MEMORY_EXTRACTION_INTERVAL | 3hr | How often the extraction job runs (e.g., 1hr, 30min, 6hr) |
MEMORY_IDLE_THRESHOLD_MS | 1200000 (20 min) | Minimum idle time (in ms) since the last chat before extraction runs. Set to 0 to disable the idle check. |
The extraction job requires at least 5 unprocessed chat messages for a given (user, workspace) pair before it processes them. This prevents wasting LLM calls on very short exchanges.
Enabling and Disabling Memories
Memory features are controlled by two system settings:memory_enabled— Master toggle. When off, no memories are injected and no extraction runs.memory_auto_extraction— Controls the automatic extraction background job independently. You can enable injection while disabling automatic extraction if you prefer to manage memories manually.
Memory Limits
| Scope | Storage Limit | Injected Per Turn |
|---|---|---|
| Global | 5 memories per user | Up to 5 (all injected) |
| Workspace | 20 memories per user per workspace | Top 5 (reranked) |
Viewing and Managing Your Memories
Users can see and delete their own memories from the profile panel:- Click your avatar or username in the bottom-left of the AnythingLLM UI.
- Open the Memories tab.
- Browse your global and workspace-scoped memories.
- Click the trash icon next to any memory to delete it permanently.