Asynchronous memory for Zentry
AsyncMemory
class is a direct asynchronous interface to Zentry’s in-process memory operations. Unlike the memory, which interacts with an API, AsyncMemory
works directly with the underlying storage systems. This makes it ideal for applications where you want to embed Zentry directly into your codebase.
AsyncMemory
, import it from the zentry.memory
module:
asyncio
to avoid blocking the event loopAsyncMemory
have the same parameters as the synchronous Memory
class but are designed to be used with async/await
.
user_id
, agent_id
, or run_id
:
AsyncMemory
can be effectively combined with other async operations. Here’s an example showing how to use it alongside OpenAI API calls in separate threads: