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

# Query memories

> Memory retrieval endpoint enables querying of the agent's memory to obtain the top-k most relevant results.



## OpenAPI

````yaml get /v1/memory
openapi: 3.0.0
info:
  title: Agent API
  version: 1.0.0
  description: >-
    OpenRouter/OpenAI API-compatible completions endpoint enables developers to
    build their own applications on sovereign agents. The completions request
    object is augmented with appropriate details from the agent's memory.
    Following the standard API format ensures compatibility with all SDKs that
    support OpenRouter or OpenAI API
servers: []
security: []
paths:
  /v1/memory:
    get:
      summary: Query memories
      description: >-
        Memory retrieval endpoint enables querying of the agent's memory to
        obtain the top-k most relevant results.
      parameters:
        - in: query
          name: query
          required: true
          schema:
            type: string
          description: Search query
        - in: query
          name: top_k
          schema:
            type: integer
          description: Number of results to return
        - in: query
          name: tenant_id
          required: true
          schema:
            type: string
          description: Unique identifier for the agent
      responses:
        '200':
          description: Successful response

````