qwen_agent/embedding
朱潮 45f3a61a16 🐛 fix(mem0): fix connection pool exhausted error
修复 Mem0 连接池耗尽错误,问题根因是 CustomMem0Embedding.embed()
方法中使用 asyncio.run() 导致事件循环泄漏。

主要修改:
- 使用线程池替代 asyncio.run() 避免事件循环泄漏
- 添加线程安全的模型缓存机制
- 为 Mem0 实例缓存添加 LRU 机制,最多保留 50 个实例
- 在 GlobalModelManager 中添加 get_model_sync() 同步方法

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-21 18:17:45 +08:00
..
__init__.py 删除model_client 2025-11-20 20:54:38 +08:00
embedding.py settings 2025-12-15 21:58:54 +08:00
manager.py 🐛 fix(mem0): fix connection pool exhausted error 2026-01-21 18:17:45 +08:00