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

# Save Info

> Configure a SAVE_INFO function to store reusable contact information.

# Save Info

`SAVE_INFO` stores useful contact information for reuse in the current conversation or future conversations. Examples include name, company, product of interest, city, and preferences.

<Warning>
  Do not use this function to store passwords, tokens, card numbers, banking information, or other sensitive data.
</Warning>

## How it works

Received fields are saved in `Contacts.custom_infos`. Storage is cumulative: new fields are added, existing fields are updated, and all other fields remain unchanged.

Values can be used in instructions through variables:

```text theme={null}
{{ $contact.nome }}
{{ $contact.empresa }}
```

Information is only included in the prompt when its corresponding variable is used. The function must be available in the agent tools or declared as a `SAVE_INFO` configuration.

## Configuration

```json theme={null}
{
  "function_type": "SAVE_INFO",
  "tool": {
    "description": "Stores useful information provided by the contact",
    "fields": [
      {
        "name": "nome",
        "type": "string",
        "description": "Contact name"
      },
      {
        "name": "empresa",
        "type": "string",
        "description": "Company where the contact works"
      }
    ]
  }
}
```

| Field         | Description                                         |
| ------------- | --------------------------------------------------- |
| `name`        | Name of the stored information                      |
| `type`        | `string`, `number`, `integer`, `boolean`, or `enum` |
| `description` | Guidance for the AI about the field content         |
| `required`    | Whether the field is required                       |
| `values`      | Allowed values when the type is `enum`              |

If `fields` is omitted, the optional `name` and `identifier` fields are used.

## Tool payload

The payload should contain only declared fields:

```json theme={null}
{
  "nome": "Felipe",
  "empresa": "Acme"
}
```

Undeclared fields are ignored. Numbers and booleans accepted by the schema are converted to text before storage.

## Rules and limits

* Up to 20 fields declared in the configuration.
* Up to 50 accumulated keys in `custom_infos`.
* Up to 1,000 characters per value.
* Maximum payload size of approximately 10 KB.
* Maximum total `custom_infos` size of approximately 50 KB.
* Field names may contain letters, numbers, and `_`.
* Reserved fields such as `password`, `token`, `api_key`, and `secret` are not accepted.
* Leading and trailing whitespace and control characters are removed from values.

These validations do not automatically identify every kind of sensitive data. The person configuring the function must select appropriate fields and instruct the AI not to collect confidential information.

## Responses

Successful response:

```json theme={null}
{
  "success": true,
  "saved_fields": ["nome", "empresa"],
  "total_fields": 2
}
```

Response for invalid fields:

```json theme={null}
{
  "success": false,
  "errors": [
    {
      "field": "empresa",
      "message": "Value must be a string"
    }
  ]
}
```

General errors are returned in `error`:

```json theme={null}
{
  "success": false,
  "error": "Invalid JSON in parameters"
}
```
