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

# Memory API

> Upload text memories to your memory stack

## Overview

The Memory API enables you to create text memories programmatically in your memory stack.

## Authorization

<ParamField header="x-api-key" type="string" required>
  Your Personal AI API key
</ParamField>

## Headers

<ParamField header="Content-Type" type="string" required>
  Must be set to application/json
</ParamField>

### Body

<ParamField body="Text" type="string" required>
  Plain text memories to upload to your stack

  ```json Example theme={null}
  "My first memory with Personal AI"
  ```
</ParamField>

<ParamField body="Createdtime" type="string">
  Time (including timezone) of the memory. Defaults to current time if not specified.

  ```json Example theme={null}
  "Wed, 28 Jul 2021 13:30:00 PDT"
  ```
</ParamField>

<ParamField body="SourceName" type="string" required>
  The source or application of memory to help you recall where it is from

  ```json Example theme={null}
  "Notes"
  ```
</ParamField>

<ParamField body="RawFeedText" type="string" optional>
  The formatted text that can be stored as it is

  ```json Example theme={null}
  "My <b>first</b> memory with Personal AI"
  ```
</ParamField>

<ParamField body="DomainName" type="string" required>
  The hyphenated text below the AI's name when clicked into a Persona.

  <img alt="DomainName" classname="block dark:hidden" src="https://mintcdn.com/personalai/kGsTZefXJjPC-_P1/images/domainname.png?fit=max&auto=format&n=kGsTZefXJjPC-_P1&q=85&s=36b7c320c44dba9f962cdb342de41f3a" width="1140" height="416" data-path="images/domainname.png" />

  ```json Example theme={null}
  "product-demo-jebzrhw"
  ```
</ParamField>

<ParamField body="Tags" type="string" optional>
  Comma delimited list of tags for the memory

  ```json Example theme={null}
  "pet,dog,woof woof"
  ```
</ParamField>

### Example Responses

<ResponseField name="type" type="string">
  Type of response (memory)
</ResponseField>

<ResponseField name="payload" type="array">
  Array containing the memory data
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.personal.ai/v1/memory' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: {{user_api_key}}' \
  --data '{
      "Text": "my cat is born in #2000",
      "DomainName": "product-demo-jebzrhw",
      "RawFeedText": "My <b>cat</b> is born in <b>2000</b>",
      "Createdtime": "Wed, 19 Sep 2023 13:31:00 PDT",
      "SourceName": "Twitter",
      "Tags": "pet,cat,meow two"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "type": "memory",
      "payload": [
          {
              "data": [
                  {
                      "type": "MEMORY",
                      "memlevel": "MEMBLOCK",
                      "memlabel": "my cat is born in #2000",
                      "start_time_utc": "2023-09-19T20:31:00.000+00:00",
                      "source": {
                          "type": "text",
                          "name": "Twitter"
                      },
                      "topics": [
                          {
                              "value": "pet"
                          },
                          {
                              "value": "cat"
                          },
                          {
                              "value": "meow two"
                          }
                      ]
                  }
              ]
          }
      ]
  }
  ```
</ResponseExample>
