The ID of the session to add the memory to.
The memory object to add to the session.
A promise that resolves to the added memory.
If the request fails.
Adds a session.
The session to add.
The added session.
Will throw an error if the session is not provided.
Will throw an error if the session.session_id is not provided.
Will throw an error if the fetch request fails.
Asynchronously classifies a session with the specified ID.
The ID of the session to classify.
The name of the classifier. Used to store the classification in session metadata if persist is true.
The classes to use for classification.
Optional
lastN: number(Optional) The number of session messages to consider for classification. Defaults to 4.
(Optional) Whether to persist the classification to session metadata. Defaults to true.
(Optional) Custom instruction for classification.
A promise that resolves to the classification response object.
Error if session ID, name, or classes are not provided or are invalid.
Deletes the memory of a specific session.
The ID of the session for which the memory should be deleted.
Retrieves memory for a specific session.
The ID of the session to retrieve memory for.
Optional
type: MemoryTypeOptional. The type of memory to retrieve. Defaults to perpetual.
Optional
lastn: numberOptional. The number of most recent memories to retrieve.
Retrieves a session with the specified ID.
The ID of the session to retrieve.
A promise that resolves to the Session object.
Will throw an error if the sessionId is not provided.
Will throw an error if the fetch request fails.
Will throw an error if the session is not found.
Asynchronously retrieve a list of paginated sessions.
Optional
limit: numberLimit the number of results returned.
Optional
cursor: numberCursor for pagination.
A list of all sessions paginated.
If the API response format is unexpected.
Retrieve all sessions, handling pagination automatically. Yields a generator of lists of sessions.
Optional
chunkSize: number = 100The number of sessions to retrieve at a time.
The next chunk of sessions from the server.
If the API response format is unexpected.
If the connection to the server fails.
Searches memory of a specific session based on search payload provided.
ID of the session for which the memory should be searched.
The search payload containing the search criteria.
Optional
limit: numberOptional limit on the number of search results returned.
Updates the specified session.
The session data to update.
The updated session.
Will throw an error if the session is not provided.
Will throw an error if the session.session_id is not provided.
Will throw an error if the fetch request fails.
Will throw an error if the session is not found.
Adds a new memory to a specific session.