> ## 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.

# Recall a profile's memories, ranked

> Ranked memories for a question. Matching runs over the profile's memories and returns them in rank order with a relevance `score`; the score is null where the deployment's reranker is a passthrough, in which case order is the only signal. No model runs in this path — recall returns facts, it does not compose an answer.



## OpenAPI

````yaml /openapi/source/external/agent-memory/agent-memory.json post /ai/memory/namespaces/{namespace}/profiles/{profile_id}/recall
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}/recall:
    post:
      tags:
        - Memory
      summary: Recall a profile's memories, ranked
      description: >-
        Ranked memories for a question. Matching runs over the profile's
        memories and returns them in rank order with a relevance `score`; the
        score is null where the deployment's reranker is a passthrough, in which
        case order is the only signal. No model runs in this path — recall
        returns facts, it does not compose an answer.
      operationId: RecallMemories
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecallRequest'
            example:
              query: where do invoices go?
              top_k: 5
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecallResponse'
              example:
                data:
                  - id: mem_01HZY4
                    text: Invoices go to 220 W Chicago Ave.
                    recorded_at: '2026-08-26T21:14:11Z'
                    score: 0.82
        '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: 'body.query: String should have at least 1 character'
        '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
            });


            const response = await
            client.ai.memory.namespaces.profiles.recall('namespace',
            'profile_id', {
              query: 'query',
            });


            console.log(response.data);
        - 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
            )
            response = client.ai.memory.namespaces.profiles.recall(
                namespace="namespace",
                profile_id="profile_id",
                query="query",
            )
            print(response.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\tresponse, err := client.AI.Memory.Namespaces.Profiles.Recall(\n\t\tcontext.TODO(),\n\t\t\"namespace\",\n\t\t\"profile_id\",\n\t\ttelnyx.AIMemoryNamespaceProfileRecallParams{\n\t\t\tQuery: \"query\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

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

            import
            com.telnyx.sdk.models.ai.memory.namespaces.profiles.ProfileRecallParams;


            public final class Main {
                private Main() {}

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

                    ProfileRecallParams params = ProfileRecallParams.builder()
                        .query("query")
                        .build();
                    var response = client.ai().memory().namespaces().profiles().recall("namespace", "profile_id", params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response = telnyx.ai.memory.namespaces.profiles.recall("namespace",
            "profile_id", query: "query")


            puts(response)
        - 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 {
              $response = $client->ai->memory->namespaces->profiles->recall(
                'namespace',
                'profile_id',
                query: 'query',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:memory:namespaces:profiles recall \
              --api-key 'My API Key' \
              --namespace namespace \
              --profile-id profile_id \
              --query query
components:
  schemas:
    RecallRequest:
      properties:
        query:
          type: string
          maxLength: 4096
          minLength: 1
          title: Query
        top_k:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 1
            - type: 'null'
          title: Top K
      type: object
      required:
        - query
      title: RecallRequest
    RecallResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/RecalledMemory'
          type: array
          title: Data
      type: object
      required:
        - data
      title: RecallResponse
    TelnyxErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TelnyxError'
    RecalledMemory:
      properties:
        id:
          type: string
          title: Id
        text:
          type: string
          title: Text
        recorded_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Recorded At
        score:
          anyOf:
            - type: number
              minimum: 0
              maximum: 1
            - type: 'null'
          title: Score
          description: >-
            Relevance, 0-1. Null where the deployment's reranker is a
            passthrough; results are in rank order either way.
      type: object
      required:
        - id
        - text
      title: RecalledMemory
    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

````