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

# Memory

> Enable agents to maintain state and context across conversations using checkpointing and session services.

Memory enables agents to maintain state and context across conversations. With memory configured, agents remember previous interactions and can resume conversations after failures or restarts.

Idun Engine supports multiple memory and checkpointing strategies depending on your agent framework.

## Framework support

<Cards>
  <Card title="LangGraph memory" icon="diagram-project" href="/memory/langgraph">
    Checkpointing for conversation state persistence. Supports in-memory, SQLite, and PostgreSQL backends.
  </Card>

  <Card title="ADK memory" icon="brain" href="/memory/adk">
    Session services for conversation state and memory services for long-term knowledge storage.
  </Card>
</Cards>

## How checkpointing works

Checkpointing saves your agent's state during execution. Each interaction is associated with a unique session or thread identifier, and the platform saves state snapshots at each step of the agent graph. This enables:

* **Conversation continuity**: Maintain context between interactions
* **Fault tolerance**: Resume from the last successful step after a failure
* **Thread isolation**: Each `session_id` maps to a unique thread, keeping conversations separate
* **Concurrent conversations**: Multiple users can interact with the same agent simultaneously

## Backend comparison

| Backend            | Persistence            | Concurrency    | Best for                                       |
| ------------------ | ---------------------- | -------------- | ---------------------------------------------- |
| **In-memory**      | None (lost on restart) | Single process | Development and testing                        |
| **SQLite**         | File-based             | Single writer  | Local development, single-instance deployments |
| **PostgreSQL**     | Database               | Multi-process  | Production, multi-instance deployments         |
| **Vertex AI**      | Cloud-native           | Distributed    | Production on Google Cloud (ADK only)          |
| **Database (SQL)** | SQL-based              | Multi-process  | Production with SQL persistence (ADK only)     |

## Quick configuration examples

<Tabs>
  <Tab title="Admin UI">
    <Steps>
      <Step title="Open the memory admin page">
        Navigate to `/admin/memory/` in the running standalone. The catalog shows the supported backends: SQLite, PostgreSQL, In Memory, Vertex AI, and Database (ADK-only).

        <Frame>
          <img alt="Memory admin page" src="https://mintcdn.com/idunlabs/SjVPzIbyPaldjUKK/images/ui/admin-memory.png?fit=max&auto=format&n=SjVPzIbyPaldjUKK&q=85&s=0a6f5fa49f62c18330f343912b175830" width="1911" height="1040" data-path="images/ui/admin-memory.png" />
        </Frame>
      </Step>

      <Step title="Configure the backend">
        Click the backend you want and fill in the connection details. Save; the reload pipeline re-instantiates the engine with the new checkpointer or session service.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Config file">
    <Tabs>
      <Tab title="LangGraph">
        ```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
        agent:
          type: "LANGGRAPH"
          config:
            checkpointer:
              type: "postgres"
              db_url: "postgresql://user:pass@localhost:5432/dbname"
        ```
      </Tab>

      <Tab title="ADK">
        ```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
        agent:
          type: "ADK"
          config:
            session_service:
              type: "in_memory"
            memory_service:
              type: "in_memory"
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

## Best practices

* **Use in-memory for development**: No setup required, fastest iteration
* **Use PostgreSQL or Database for production**: Multi-process support, reliability, and crash recovery
* **Configure thread isolation**: Each conversation should have a unique `session_id` to prevent state leakage
* **Monitor storage usage**: Long-running conversations can accumulate significant state over time

## Next steps

<Card title="LangGraph memory" icon="layers" horizontal href="/memory/langgraph">
  Checkpointing for conversation state persistence. Supports in-memory, SQLite, and PostgreSQL backends.
</Card>

<Card title="ADK memory" icon="database" horizontal href="/memory/adk">
  Session services for conversation state and memory services for long-term knowledge storage.
</Card>
