> ## Documentation Index
> Fetch the complete documentation index at: https://ai-kb.automationanywhere.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Memory Overview

> Learn how your agent remembers user preferences, facts, and context across conversations.

## Overview

Agent Memory allows your agent to detect, store, and recall user-specific information across conversations. When enabled, the agent analyzes messages for useful context, stores it as memory records, and injects approved memories into future interactions — creating a personalized experience for each user.

Agent Memory is useful for remembering:

* **User preferences** — preferred tone, response format, or workflow style.
* **Stable user facts** — role, team, company, or recurring needs.
* **Important context** — information that helps personalize future interactions.

## How Agent Memory Works

<Steps>
  <Step title="Memory is enabled for the agent">
    Toggle **Enable Memory** on in the Memory Settings panel.
  </Step>

  <Step title="The agent analyzes conversations">
    User messages are automatically analyzed in the background for memorable preferences, facts, or context. The agent performs a duplicate check against existing memories and assigns a **confidence score** between 0.0 and 1.0.
  </Step>

  <Step title="Candidates are stored as pending">
    Detected memory candidates are saved with a `pending` status. Pending memories expire after **7 days** if not reviewed.
  </Step>

  <Step title="Memories are approved or rejected">
    Admins review pending memories and approve or reject them through the Memory Management panel or via the REST API.
  </Step>

  <Step title="Approved memories are injected into future conversations">
    When the same user interacts with the agent again, approved memories are retrieved, formatted by type, and added to the agent's context automatically.
  </Step>
</Steps>

## Memory Types

The agent can capture and store three types of memory:

| Type         | Description                                                     | Examples                                                                              |
| ------------ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `Preference` | User preferences such as tone, format, or workflow style.       | "User prefers bullet point summaries", "User likes concise technical answers"         |
| `Fact`       | Stable facts about the user such as role, team, or company.     | "User is CTO at StartupCorp", "User specializes in Python and machine learning"       |
| `Context`    | Situational context that helps personalize future interactions. | "User has a product launch deadline next month", "User's team uses Agile methodology" |

## Memory Statuses

| Status     | Description                                                       |
| ---------- | ----------------------------------------------------------------- |
| `pending`  | Memory has been detected and is awaiting review.                  |
| `approved` | Memory has been approved and is actively used in agent responses. |
| `rejected` | Memory was declined and will not be used.                         |

## Memory Lifecycle

### Creation

1. User sends a message.
2. Agent analyzes the message in the background.
3. AI detects memorable information and performs a duplicate check.
4. Memory is created with `pending` status and a confidence score assigned.
5. A 7-day expiration timer starts.

### Approval

1. Admin reviews the pending memory.
2. Memory is approved or rejected.
3. If approved, memory becomes active and is injected into future conversations.
4. If rejected, the memory is archived.

### Usage

1. User starts a conversation.
2. System loads approved memories for that user.
3. Memories are formatted by type and added to the agent's system prompt.
4. Agent uses memories to personalize responses.

### Expiration

* **Pending memories** expire after 7 days if not approved.
* **Approved memories** do not expire unless manually deleted.
* Expired pending memories are automatically rejected.

## Examples

<AccordionGroup>
  <Accordion title="Example 1: Preference Memory">
    **User message:**

    > "I prefer to receive code examples in Python rather than pseudocode."

    **Detected memory:**

    | Field      | Value                                                |
    | ---------- | ---------------------------------------------------- |
    | Type       | `preference`                                         |
    | Content    | "User prefers Python code examples over pseudocode." |
    | Confidence | 0.90                                                 |

    **Future impact:** The agent will default to Python code examples whenever the user asks for code.
  </Accordion>

  <Accordion title="Example 2: Fact Memory">
    **User message:**

    > "I'm the CTO at StartupCorp and we're building a SaaS platform."

    **Detected memory:**

    | Field      | Value                                                  |
    | ---------- | ------------------------------------------------------ |
    | Type       | `fact`                                                 |
    | Content    | "User is CTO at StartupCorp building a SaaS platform." |
    | Confidence | 0.95                                                   |

    **Future impact:** The agent will understand the user's role and company context in all future conversations.
  </Accordion>

  <Accordion title="Example 3: Context Memory">
    **User message:**

    > "We're launching our product next month, so I need everything ready quickly."

    **Detected memory:**

    | Field      | Value                                                                       |
    | ---------- | --------------------------------------------------------------------------- |
    | Type       | `context`                                                                   |
    | Content    | "User has a product launch deadline next month requiring quick turnaround." |
    | Confidence | 0.85                                                                        |

    **Future impact:** The agent will prioritize speed and urgency in its responses.
  </Accordion>
</AccordionGroup>
