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

# Infer Agent Memory Schema

> Generate a suggested memory schema by reading the agent.

### Overview

Reads the agent and proposes what it should remember about each contact. The proposal is returned and nothing is saved: to keep it, put it on `settings.memorySchema` and save a version with [Create Agent Version](https://docs.bland.ai/api-v2/post/agents-id-versions.md).

By default it reads the agent's newest dev version. Send a `snapshot` to have it read an unsaved configuration instead, which is what the builder does while you are still editing.

This runs a language model over the compiled agent, so it is limited to 6 requests per minute per agent and it is not instant. The agent must have a saved version, or a `snapshot` in the body, and that configuration must compile.

Requires an admin, owner, operator, or prompter role.

### Headers

**authorization** `string` *required*

Your API key for authentication.

### Path Parameters

**agent\_id** `string` *required*

The agent's unique identifier.

### Body Parameters

**snapshot** `object`

A full agent configuration to read instead of the saved dev version, in the same shape [Create Agent Version](https://docs.bland.ai/api-v2/post/agents-id-versions.md) accepts. Validated before use: structural problems return `400 INVALID_SNAPSHOT` with one entry per problem. Omit the field entirely to use the newest dev version.

### Response

**data.entity\_schemas** `array`

The proposed entity types, in the same shape as [Get Agent Memory Schema](https://docs.bland.ai/api-v2/get/agents-id-memory-schema.md). Nothing is persisted.

**errors** `null | array`

`null` on success, or a list of error objects if the request failed. An agent with no saved version returns `404 AGENT_VERSION_NOT_FOUND`, and a configuration that cannot be compiled returns `400 AGENT_SNAPSHOT_INVALID`.

```json Response theme={null}
{
  "data": {
    "entity_schemas": [
      {
        "entity_type": "appointment",
        "description": "A dental appointment the caller books, moves, or cancels.",
        "identifier_field": "confirmation_number",
        "fields": [
          {
            "name": "confirmation_number",
            "description": "The booking reference given to the caller.",
            "type": "string",
            "required": true
          }
        ],
        "outcomes": ["booked", "cancelled"]
      }
    ]
  },
  "errors": null
}
```

```json No Saved Version theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "AGENT_VERSION_NOT_FOUND",
      "message": "Agent has no saved versions yet (agent_version: \"dev\")"
    }
  ]
}
```

```json Will Not Compile theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "AGENT_SNAPSHOT_INVALID",
      "message": "Agent version snapshot failed to compile"
    }
  ]
}
```

```json Not Found theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "NOT_FOUND",
      "message": "Agent not found"
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.