Delete Memory langbase.memories.delete()
Delete an AI memory on Langbase using the langbase.memories.delete()
function.
You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.
API reference
Function Signature
langbase.memories.delete(options);
// with types.
langbase.memories.delete(options: MemoryDeleteOptions);
- Name
options
- Type
- MemoryDeleteOptions
- Description
MemoryDeleteOptions Object
name: string;
Following are the properties of the options object.
- Name
name
- Type
- string
- Required
- Required
- Description
Name of the AI memory to delete.
Usage example
Install the SDK
npm i langbase
Environment variables
Environment variables
LANGBASE_API_KEY="<USER/ORG-API-KEY>"
Delete memory
Delete memory on Langbase
import {Langbase} from 'langbase';
const langbase = new Langbase({
apiKey: process.env.LANGBASE_API_KEY!,
});
async function main() {
const hasMemoryDeleted = await langbase.memories.delete({
name: 'knowledge-base'
});
console.log('Memory deleted:', hasMemoryDeleted);
}
main();
- Name
MemoryDeleteResponse
- Type
- object
- Description
The response object returned by the
langbase.memories.delete()
function.MemoryDeleteResponse
success: boolean;
- Name
success
- Type
- boolean
- Description
Indicates whether the deletion was successful.
Response of langbase.memories.delete()
{
"success": true
}