| from fastapi import HTTPException, status | |
| from workflow.memory_client import memory_client | |
| def get_mem0_client(): | |
| """ | |
| A dependency that provides the Mem0 client and checks for its availability. | |
| """ | |
| if not memory_client: | |
| raise HTTPException( | |
| status_code=status.HTTP_503_SERVICE_UNAVAILABLE, | |
| detail="Memory service client is not initialized. Please check server configuration." | |
| ) | |
| yield memory_client |