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

# List a profile's memories, most recent first

> Everything stored under one profile, unranked -- ask `recall` for the memories that answer a question. A profile that holds nothing is an empty page rather than a 404: profiles exist by being written to. Each memory names the `source_id` it was extracted from, or null for a memory derived from other memories -- which can read almost the same as the fact it restates. A `source_id` narrows the listing to the memories extracted from that source, and a `session_id` to those extracted from the session, which is the same thing named another way; pass one or the other. Neither is everything the source led to: a memory derived from several sources belongs to no single one and appears only in the unfiltered listing. A memory written while the listing is paged shifts the pages after it, so an entry can be repeated or missed at a page boundary.



## OpenAPI

````yaml /openapi/source/external/agent-memory/agent-memory.json get /ai/memory/namespaces/{namespace}/profiles/{profile_id}/memories
openapi: 3.1.0
info:
  version: 1.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: >-
    Long-term memory for AI agents. A profile per user, caller, or agent: write
    memories in with `ingest` or `remember`, and recall them with `recall`.
    Facts are extracted, and contradictions resolve to the newest.
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: Memory
    description: Write memories into a profile and recall them.
  - name: Profiles
    description: What a namespace and a profile hold.
  - name: Sources
    description: What a profile stored, and what its memories came from.
  - name: Operations
    description: Whether a write has finished.
  - name: Settings
    description: How a namespace's summaries are written.
paths:
  /ai/memory/namespaces/{namespace}/profiles/{profile_id}/memories:
    get:
      tags:
        - Profiles
      summary: List a profile's memories, most recent first
      description: >-
        Everything stored under one profile, unranked -- ask `recall` for the
        memories that answer a question. A profile that holds nothing is an
        empty page rather than a 404: profiles exist by being written to. Each
        memory names the `source_id` it was extracted from, or null for a memory
        derived from other memories -- which can read almost the same as the
        fact it restates. A `source_id` narrows the listing to the memories
        extracted from that source, and a `session_id` to those extracted from
        the session, which is the same thing named another way; pass one or the
        other. Neither is everything the source led to: a memory derived from
        several sources belongs to no single one and appears only in the
        unfiltered listing. A memory written while the listing is paged shifts
        the pages after it, so an entry can be repeated or missed at a page
        boundary.
      operationId: ListMemories
      parameters:
        - name: profile_id
          in: path
          required: true
          schema:
            type: string
            title: Profile Id
        - name: namespace
          in: path
          required: true
          schema:
            type: string
            title: Namespace
        - name: session_id
          in: query
          required: false
          description: >-
            An ingested session, by the `session_id` it was ingested with.
            Narrows the request to the source that session was stored as.
          schema:
            anyOf:
              - type: string
                maxLength: 128
              - type: 'null'
            title: Session Id
        - name: source_id
          in: query
          required: false
          description: >-
            Narrows the listing to the memories extracted from one source, a
            remembered fact as well as a session. Pass this or `session_id`, not
            both.
          schema:
            anyOf:
              - type: string
                maxLength: 128
              - type: 'null'
            title: Source Id
        - name: page[number]
          in: query
          required: false
          description: >-
            The page to return, counting from 1. Bounded in depth: (page[number]
            - 1) * page[size] may be at most 10000.
          schema:
            type: integer
            maximum: 10001
            minimum: 1
            default: 1
            title: Number
        - name: page[size]
          in: query
          required: false
          description: How many results a page holds.
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryListResponse'
              example:
                data:
                  - id: mem_01HZY4
                    text: Invoices go to 220 W Chicago Ave.
                    recorded_at: '2026-08-26T21:14:11Z'
                    source_id: b1e6c0a2-4f3d-4a2e-9c7b-8e1f2a3b4c5d
                meta:
                  page_number: 1
                  page_size: 20
                  total_pages: 22
                  total_results: 431
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not find any usable credentials in the request.
                    source:
                      pointer: /
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
        '404':
          description: The namespace does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: namespace_not_found
                    detail: no such namespace
        '422':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: invalid_request
                    detail: pass source_id or session_id, not both
        '502':
          description: Upstream error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: upstream_error
                    detail: the memory dataplane is unavailable
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const response of
            client.ai.memory.namespaces.profiles.memories.list()) {
              console.log(response);
            }
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            page = client.ai.memory.namespaces.profiles.memories.list(
                "namespace",
                "profile_id",
            )
            print(page.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmemories, err := client.AI.Memory.Namespaces.Profiles.Memories.List(\n\t\tcontext.TODO(),\n\t\t\"namespace\",\n\t\t\"profile_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", memories.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var page = client.ai().memory().namespaces().profiles().memories().list("namespace", "profile_id");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            page =
            telnyx.ai.memory.namespaces.profiles.memories.list("namespace",
            "profile_id")


            puts(page)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $page = $client->ai->memory->namespaces->profiles->memories->list(
                'namespace',
                'profile_id',
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:memory:namespaces:profiles:memories list \
              --api-key 'My API Key' \
              --namespace namespace \
              --profile-id profile_id
components:
  schemas:
    MemoryListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ListedMemory'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/PageMeta'
      type: object
      required:
        - data
        - meta
      title: MemoryListResponse
    TelnyxErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TelnyxError'
    ListedMemory:
      properties:
        id:
          type: string
          title: Id
        text:
          type: string
          title: Text
        recorded_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Recorded At
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
          description: >-
            The source this memory was extracted from. Set for a fact, which
            comes from exactly one source; null for a memory derived from other
            memories. Read it with `GET .../sources/{source_id}`. A source
            deleted a moment ago can still be named here, and then answers 404.
      type: object
      required:
        - id
        - text
        - source_id
      title: ListedMemory
    PageMeta:
      properties:
        page_number:
          type: integer
          title: Page Number
          description: The page returned, counting from 1.
        page_size:
          type: integer
          title: Page Size
          description: How many results a page holds.
        total_pages:
          type: integer
          title: Total Pages
          description: >-
            Pages that can be requested; 0 when nothing matched. Page until
            `page_number` reaches it rather than until a page comes back short:
            a page can hold fewer than `page_size` results without being the
            last. Capped at the deepest page served, so on a very large listing
            it covers fewer results than `total_results`.
        total_results:
          type: integer
          title: Total Results
          description: Results the request matched, including any past the deepest page.
      type: object
      required:
        - page_number
        - page_size
        - total_pages
        - total_results
      title: PageMeta
      description: >-
        Where a listing's page sits in the whole.


        A page is a snapshot: the counts it reports and the order it is drawn in

        both move as writes land, so paging through a busy namespace can repeat
        or

        miss an entry at a page boundary.
    TelnyxError:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Telnyx API key

````