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

# Create a memory

> Save a persistent memory for yourself across sessions. Memory names are unique per user.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public post /v1/memories
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/memories:
    post:
      tags:
        - Memories
      summary: Create a memory
      description: >-
        Save a persistent memory for yourself across sessions. Memory names are
        unique per user.
      operationId: createMemory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  minLength: 1
                  maxLength: 300
                  description: One-line summary used to decide relevance later.
                type:
                  type: string
                  enum:
                    - user
                    - feedback
                    - project
                    - reference
                  description: >-
                    user: who the user is; feedback: how they want you to work;
                    project: ongoing context; reference: external resources.
                content:
                  type: string
                  minLength: 1
                  maxLength: 10000
                name:
                  type: string
                  pattern: ^[a-z0-9][a-z0-9-]{0,99}$
              required:
                - description
                - type
                - content
                - name
              additionalProperties: false
      responses:
        '201':
          description: Create a memory
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    pattern: ^[a-z0-9][a-z0-9-]{0,99}$
                  description:
                    type: string
                  type:
                    type: string
                    enum:
                      - user
                      - feedback
                      - project
                      - reference
                  revision:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  updatedAt:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  content:
                    type: string
                required:
                  - name
                  - description
                  - type
                  - revision
                  - updatedAt
                  - content
                additionalProperties: false
        '400':
          description: >-
            Invalid request or missing required organization or user
            information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: memory not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Memory already exists or revision changed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: memory operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const memory = await client.memories.create({
              description: 'x',
              type: 'user',
              content: 'x',
              name: '',
            });
        - lang: rust
          label: Rust SDK
          source: |
            use tembo_rs::*;

            let client = Tembo::from_env()?;

            let response = client
                .memories()
                .create(MemoriesCreateBody::new(
                    "x".to_string(),
                    MemoriesCreateBodyType::User,
                    "x".to_string(),
                    "".to_string(),
                ))
                .send()
                .await?;
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.