List Memories langbase.memory.list()

Retrieve a list of all AI memory present in an account on Langbase using the langbase.memory.list() function.


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.


API reference

langbase.memory.list()

Function Signature

langbase.memory.list();

The langbase.memory.list() method takes no parameters and returns an array of memories present in your account.

Usage example

Install the SDK

npm i langbase
pnpm i langbase
yarn add langbase

Environment variables

.env file

LANGBASE_API_KEY="<USER/ORG-API-KEY>"

List memories

List all memories

import {Langbase} from 'langbase';

const langbase = new Langbase({
	apiKey: process.env.LANGBASE_API_KEY!,
});

const memories = await langbase.memory.list();

Response

  • Name
    MemoryListResponse[]
    Type
    array
    Description

    The response array returned by the langbase.memory.list() function.

    MemoryListResponse

    interface MemoryListResponse {
    	name: string;
    	description: string;
    	owner_login: string;
    	url: string;
    	embedding_model:
    		| 'openai:text-embedding-3-large'
    		| 'cohere:embed-multilingual-v3.0'
    		| 'cohere:embed-multilingual-light-v3.0';
    }
    
    • Name
      name
      Type
      string
      Description

      Name of the memory.

    • Name
      description
      Type
      string
      Description

      Description of the memory.

    • Name
      owner_login
      Type
      string
      Description

      Login of the memory owner.

    • Name
      url
      Type
      string
      Description

      Memory access URL.

    • Name
      embedding_model
      Type
      string
      Description

      The embedding model used by the AI memory.

      • openai:text-embedding-3-large
      • cohere:embed-multilingual-v3.0
      • cohere:embed-multilingual-light-v3.0

Response of langbase.memory.list()

[
	{
		"name": "knowledge-base",
		"description": "An AI memory for storing company internal docs.",
		"owner_login": "user123",
		"url": "https://langbase.com/user123/document-memory",
		"embedding_model": "openai:text-embedding-3-large"
	},
	{
		"name": "multilingual-knowledge-base",
		"description": "Advanced memory with multilingual support",
		"owner_login": "user123",
		"url": "https://langbase.com/user123/multilingual-memory",
		"embedding_model": "cohere:embed-multilingual-v3.0"
	}
]