Letta Memory Files API

Memory-mapped file resources attached to agents.

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-agent-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-block-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-tool-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-source-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-run-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-identity-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-message-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-passage-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-archive-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-job-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-llm-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-embedding-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-provider-schema.json

Other Resources

OpenAPI Specification

letta-memory-files-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Letta Admin Memory Files API
  version: 1.0.0
  description: REST API for Letta, the stateful agents platform. Manage agents, memory blocks, archival passages, sources, custom tools, MCP servers, multi-agent groups, runs, and streaming responses. Available as Letta Cloud (managed) at https://api.letta.com/v1 and as the self-hosted open-source server (Apache-2.0) typically run at http://localhost:8283.
  contact:
    name: Letta
    url: https://www.letta.com/
    email: support@letta.com
  license:
    name: Apache-2.0
    url: https://github.com/letta-ai/letta/blob/main/LICENSE
  x-logo:
    url: https://www.letta.com/favicon.ico
servers:
- url: https://api.letta.com
  description: Letta Cloud (managed)
- url: https://app.letta.com
  description: Letta Cloud (app)
- url: http://localhost:8283
  description: Self-hosted Letta server
security:
- bearerAuth: []
tags:
- name: Memory Files
  description: Memory-mapped file resources attached to agents.
paths:
  /v1/agents/{agent_id}/memory-files/directory:
    get:
      description: List immediate children of a directory in the agent memory repo (single level).
      summary: List Directory
      tags:
      - Memory Files
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: string
      - name: path
        in: query
        description: Directory path to list. Empty for root.
        schema:
          type: string
      - name: depth
        in: query
        description: 'Depth of directory listing (default: 1).'
        schema:
          type: number
          nullable: true
      - name: ref
        in: query
        description: 'Git ref (default: HEAD).'
        schema:
          type: string
      operationId: memoryFiles.listDirectory
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                  entries:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        type:
                          type: string
                          enum:
                          - file
                          - directory
                      required:
                      - name
                      - type
                  depth:
                    type: number
                required:
                - path
                - entries
                - depth
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
        '501':
          description: '501'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
  /v1/agents/{agent_id}/memory-files/history:
    get:
      description: Get commit history for a specific file in the agent memory repo.
      summary: Get File History
      tags:
      - Memory Files
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: string
      - name: file_path
        in: query
        description: Path to the file (e.g. "blocks/persona.md").
        required: true
        schema:
          type: string
      - name: limit
        in: query
        description: 'Max commits to return (default: 50).'
        schema:
          type: number
          nullable: true
      operationId: memoryFiles.getFileHistory
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                  commits:
                    type: array
                    items:
                      type: object
                      properties:
                        sha:
                          type: string
                        message:
                          type: string
                        timestamp:
                          type: string
                        author_name:
                          type: string
                          nullable: true
                      required:
                      - sha
                      - message
                      - timestamp
                      - author_name
                required:
                - path
                - commits
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
        '501':
          description: '501'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
  /v1/agents/{agent_id}/memory-files/content:
    get:
      description: Read a single file content at a specific git ref from the agent memory repo.
      summary: Read File Content
      tags:
      - Memory Files
      parameters:
      - name: agent_id
        in: path
        required: true
        schema:
          type: string
      - name: file_path
        in: query
        description: Path to the file (e.g. "blocks/persona.md").
        required: true
        schema:
          type: string
      - name: ref
        in: query
        description: 'Git ref (default: HEAD).'
        schema:
          type: string
      operationId: memoryFiles.readFileContent
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                  content:
                    type: string
                  ref:
                    type: string
                required:
                - path
                - content
                - ref
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
        '501':
          description: '501'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer