Commit Graph

11 Commits

Author SHA1 Message Date
朱潮
9215f8236d 🐛 fix: 修复 Mem0 连接池耗尽和 LLM 参数透传问题
- mem0_manager: 添加 _cleanup_mem0_instance 方法,在缓存移除实例时显式释放数据库连接,避免等待 GC 导致连接池耗尽
- deep_assistant: 根据 model_provider 过滤不支持的参数,Anthropic 不支持 OpenAI 特有参数如 n、presence_penalty 等

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 10:11:44 +08:00
86b38262fa fix(memory): handle Mem0 get_all response format with results key
Mem0's get_all() returns data in format {"results": [...]}, not a direct list.
Also, agent_id is at the top level of each memory, not in metadata.

Changes:
- Add _extract_memories_from_response() to handle both new and old response formats
- Add _check_agent_id_match() to check agent_id at both top-level and in metadata
- Update get_all_memories, delete_memory, delete_all_memories to use new helpers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 13:28:39 +00:00
autobee-sparticle
572374b297
fix(memory): handle Mem0 get_all returning string or dict items (#11)
Mem0's get_all() method may return a list containing either strings
(older version format) or dictionaries (newer version format). This
fix adds proper type checking to handle both cases gracefully.

- get_all_memories: Skip string items, only process dict items
- delete_memory: Add type checking before accessing dict methods
- delete_all_memories: Add type checking before accessing dict methods

Fixes: 'str' object has no attribute 'get' error

Co-authored-by: zhuchao <zhuchaowe@163.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:02:59 +09:00
a1f60a7024 fix: 修复 get_all_memories 调用时 config 为 None 导致的错误
问题:当调用 get_all_memories API 时,没有传递 config 参数,
导致 _create_mem0_instance 中的 config 为 None,
调用 config.get_custom_fact_extraction_prompt() 时抛出 AttributeError。

修复:添加 config 的空值检查,只在 config 存在时才添加 custom_fact_extraction_prompt。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 12:39:45 +00:00
autobee-sparticle
108c675c3d
feat(memory): add memory management API endpoints (#10)
* chore: add .worktrees/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(memory): add memory management API endpoints

Add new /api/v1/memory endpoints for viewing and managing user memories:
- GET /api/v1/memory - list all memories for a bot
- DELETE /api/v1/memory/{memory_id} - delete single memory
- DELETE /api/v1/memory - delete all memories for a bot

Also add delete_memory and delete_all_memories methods to Mem0Manager.

Issue: #1844

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: zhuchao <zhuchaowe@163.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:01:12 +09:00
朱潮
3dc119bca8 refactor(mem0): optimize connection pool and async memory handling
- Fix mem0 connection pool exhausted error with proper pooling
- Convert memory operations to async tasks
- Optimize docker-compose configuration
- Add skill upload functionality
- Reduce cache size for better performance
- Update dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:39:12 +08:00
朱潮
0922ad084a patch 2026-01-21 13:23:11 +08:00
朱潮
99755ceab5 remove settingsetting 2026-01-21 10:38:29 +08:00
朱潮
223c63047d fix(mem0): use asyncio.run() for async call in sync embed method
在 CustomMem0Embedding.embed() 同步方法中使用 asyncio.run()
调用异步的 manager.get_model(),解决同步/异步混合调用问题。

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

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-20 23:03:21 +08:00
朱潮
366a64283e Added memory log 2026-01-20 21:30:32 +08:00
朱潮
f694101747 refactor: migrate from Memori to Mem0 for long-term memory
Replace Memori with Mem0 for memory management:
- Delete memori_config.py, memori_manager.py, memori_middleware.py
- Add mem0_config.py, mem0_manager.py, mem0_middleware.py
- Update environment variables (MEMORI_* -> MEM0_*)
- Integrate Mem0 with LangGraph middleware
- Add sync connection pool for Mem0 in DBPoolManager
- Move checkpoint message prep to config creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:15:30 +08:00