Support async client (#1980)

This commit is contained in:
Dev Khant
2024-10-22 12:42:55 +05:30
committed by GitHub
parent c5d298eec8
commit fbf1d8c372
11 changed files with 213 additions and 58 deletions

View File

@@ -38,6 +38,23 @@ const client = new MemoryClient('your-api-key');
</CodeGroup>
### 3.1 Instantiate Async Client (Python only)
For asynchronous operations in Python, you can use the AsyncMemoryClient:
```python Python
from mem0 import AsyncMemoryClient
client = AsyncMemoryClient(api_key="your-api-key")
async def main():
response = await client.add("I'm travelling to SF", user_id="john")
print(response)
await main()
```
## 4. Memory Operations
Mem0 provides a simple and customizable interface for performing CRUD operations on memory.