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

# List Memories

> This endpoint lists all memories

### Body

<ParamField body="user_id" type="string">
  This is the unique identifier for the user associated with the memory.
</ParamField>

<ParamField body="agent_id" type="string">
  This is the unique identifier for the agent that created the memory.
</ParamField>

### Response

<ResponseField name="id" type="string">
  The unique identifier for the memory.
</ResponseField>

<ResponseField name="memory" type="string">
  The content of the memory that was stored.
</ResponseField>

<ResponseField name="memory_type" type="string">
  The type of memory (e.g., short-term, long-term).
</ResponseField>

<ResponseField name="user_id" type="string">
  The unique identifier for the user associated with the memory.
</ResponseField>

<ResponseField name="agent_id" type="string">
  The unique identifier for the agent that created the memory.
</ResponseField>

<ResponseField name="created_at" type="string">
  The timestamp when the memory was created.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.stateset.com/v1/memory' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "user_id": "user_1234abcd",
      "agent_id": "agent_5678efgh"
  }'
  ```

  ```graphQL GraphQL theme={null}
      query ListMemories(
      $user_id: String!
      $agent_id: String!
      ) {
        memories(
        where: {
          user_id: {_eq: $user_id}
          agent_id: {_eq: $agent_id}
        }
      ) {    
        returning {
          id
          memory
          memory_type
          user_id
          agent_id
          created_at
        }
      }
    }`;
  ```

  ```js Node.js theme={null}
  const memory = await stateset.memory.list({
    "user_id": "user_1234abcd",
    "agent_id": "agent_5678efgh"
  })
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "memory": {
          "id": "1234abcd-5678-efgh-9101-ijklmnopqrst",
          "memory": "User prefers to receive notifications via email.",
          "memory_type": "long-term",
          "user_id": "user_1234abcd",
          "agent_id": "agent_5678efgh",
          "created_at": "2024-08-25T10:00:00Z"
      }
  }
  ```
</ResponseExample>
