1. Fix "all environment values must be bytes or str" error in hook execution
by ensuring all env values are converted to str (getattr may return None
when attribute exists but is None). Also sanitize shell_env values.
2. Increase MEM0_POOL_SIZE default from 20 to 50 to address "connection pool
exhausted" errors under high concurrency.
Fixes: sparticleinc/felo-mygpt#2519
Co-authored-by: zhuchao <zhuchaowe@163.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
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>
- Replace ShellMiddleware with LocalShellBackend
- Update AgentMemoryMiddleware to MemoryMiddleware with new signature
- Update CustomSkillsMiddleware to use new SkillsMiddleware signature
- Add LocalContextMiddleware for local context
- Update CompositeBackend to use routing
- Update dependencies: langgraph-checkpoint-postgres to 3.0.4
Breaking Changes:
- agent/deep_assistant.py: Major refactoring to adapt to new deepagents API
- pyproject.toml: Version bump
- deepagents: 0.2.8 -> 0.4.3
- deepagents-cli: 0.0.11 -> 0.0.25
- langgraph-checkpoint-postgres: 2.0.25 -> 3.0.4 (for compatibility with langgraph-checkpoint 3.x)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* 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>
Add db_url property to MemoriManager that falls back to
CHECKPOINT_DB_URL setting, and pass it explicitly from
fastapi_app.py to ensure Memori can create sync connections.
This fixes the error "Either db_pool or db_url must be provided"
when recalling memories.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move init_global_memori from deep_assistant.py to fastapi_app.py
lifespan function for proper application-level initialization.
This ensures Memori is initialized once at startup and closed at
shutdown, rather than checking and potentially initializing on every
agent creation.
Changes:
- fastapi_app.py: Add Memori init/close in lifespan
- deep_assistant.py: Simplify to only get memori_manager
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>