Memory API: Create

The create memory API endpoint allows you to create a new memory on Langbase dynamically with API. This endpoint requires a User or Org API key.


Generate a User/Org API key

You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.


POST/beta/org/{org}/memorysets

Create a new org memory

Create a new organization memory by sending the memory data inside the request body.

Required headers

  • Name
    Content-Type
    Type
    string
    Description

    Request content type. Needs to be application/json.

  • Name
    Authorization
    Type
    string
    Description

    Replace <ORG_API_KEY> with your organization API key.

Required path parameters

  • Name
    org
    Type
    string
    Description

    The organization name.

    Replace {org} with your organization username.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of the memory.

Optional attributes

    • Name
      description
      Type
      array
      Description

      Short description of the memory.

      Default: ''

POST
/beta/org/{org}/memorysets
curl https://api.langbase.com/beta/org/{org}/memorysets \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer <ORG_API_KEY>" \
-d '{
  "name": "rag-memory",
  "description": "RAG memory",
}'

Response

{
  "name": "rag-memory",
  "description": "RAG memory",
  "owner_login": "langbase",
  "url": "https://langbase.com/memorysets/langbase/rag-memory"
}

POST/beta/user/memorysets

Create a new user memory

Create a new user memory by sending the memory data inside the request body.

Required headers

  • Name
    Content-Type
    Type
    string
    Description

    Request content type. Needs to be application/json.

  • Name
    Authorization
    Type
    string
    Description

    Replace <USER_API_KEY> with your User API key.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of the memory.

Optional attributes

    • Name
      description
      Type
      array
      Description

      Short description of the memory.

      Default: ''

POST
/beta/user/memorysets
curl https://api.langbase.com/beta/user/memorysets \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer <USER_API_KEY>" \
-d '{
  "name": "rag-memory",
  "description": "RAG memory",
}'

Response

{
  "name": "rag-memory",
  "description": "RAG memory",
  "owner_login": "langbase",
  "url": "https://langbase.com/memorysets/langbase/rag-memory"
}