Memory: Delete v1
The delete
memory API endpoint allows you to delete an existing memory on Langbase dynamically with the API. This endpoint requires an Org or User 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.
DELETE/v1/memory/{memoryName}
Delete a memory
Delete a memory by sending a DELETE request to this endpoint.
Headers
- Name
Content-Type
- Type
- string
- Required
- Required
- Description
Request content type. Needs to be
application/json
.
- Name
Authorization
- Type
- string
- Required
- Required
- Description
Replace
<YOUR_API_KEY>
with your user/org API key.
Path Parameters
- Name
memoryName
- Type
- string
- Required
- Required
- Description
The name of the memory to delete.
Replace
{memoryName}
with the name of the memory.
Usage example
Install the SDK
npm i langbase
Environment variables
.env file
LANGBASE_API_KEY="<USER/ORG-API-KEY>"
Delete Memory
Delete Memory
DELETE
/v1/memory/{memoryName}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();
Response
- Name
Response
- Type
- object
- Description
The response object returned by the API endpoint.
Response
interface Response { success: boolean; }
- Name
success
- Type
- boolean
- Description
Indicates whether the deletion was successful.
API Response
{
"success": true
}