The AsyncMemoryClient is an asynchronous client for interacting with the Mem0 API. It provides similar functionality to the synchronous MemoryClient but allows for non-blocking operations, which can be beneficial in applications that require high concurrency.

Initialization

To use the async client, you first need to initialize it:

Methods

The AsyncMemoryClient provides the following methods:

Add

Add a new memory asynchronously.

Search for memories based on a query asynchronously.

Get All

Retrieve all memories for a user asynchronously.

Delete

Delete a specific memory asynchronously.

Delete All

Delete all memories for a user asynchronously.

History

Get the history of a specific memory asynchronously.

Users

Get all users, agents, and runs which have memories associated with them asynchronously.

Reset

Reset the client, deleting all users and memories asynchronously.

Conclusion

The AsyncMemoryClient provides a powerful way to interact with the Mem0 API asynchronously, allowing for more efficient and responsive applications. By using this client, you can perform memory operations without blocking your application’s execution.

If you have any questions or need further assistance, please don’t hesitate to reach out: