Commit Graph

23 Commits

Author SHA1 Message Date
朱潮
c9d00a1b04 admin share 2026-02-01 19:39:26 +08: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
朱潮
99755ceab5 remove settingsetting 2026-01-21 10:38:29 +08:00
朱潮
b53174ae9f 需要 openai_api_key的环境变量 2026-01-21 08:38:06 +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
朱潮
4d6ee6ae0c fix: pass db_url to init_global_memori
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>
2026-01-20 08:27:34 +08:00
朱潮
455a48409d feat: integrate Memori long-term memory system
Add Memori (https://github.com/MemoriLabs/Memori) integration for
persistent cross-session memory capabilities in both create_agent
and create_deep_agent.

## New Files

- agent/memori_config.py: MemoriConfig dataclass for configuration
- agent/memori_manager.py: MemoriManager for connection and instance management
- agent/memori_middleware.py: MemoriMiddleware for memory recall/storage
- tests/: Unit tests for Memori components

## Modified Files

- agent/agent_config.py: Added enable_memori, memori_semantic_search_top_k, etc.
- agent/deep_assistant.py: Integrated MemoriMiddleware into init_agent()
- utils/settings.py: Added MEMORI_* environment variables
- pyproject.toml: Added memori>=3.1.0 dependency

## Features

- Semantic memory search with configurable top-k and threshold
- Multi-tenant isolation (entity_id=user, process_id=bot, session_id)
- Memory injection into system prompt
- Background asynchronous memory augmentation
- Graceful degradation when Memori is unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-20 00:12:43 +08:00
朱潮
20d5e96986 feat: 添加 PostgreSQL 支持用于 checkpoint 存储
- 添加 postgres:16-alpine 服务配置
- 配置 CHECKPOINT_DB_URL 环境变量
- 添加服务依赖和健康检查

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 00:32:23 +08:00
朱潮
342932030f feat(skills): add skill management API module
- Create new skill_manager.py with list and upload endpoints
- Add GET /api/v1/skill/list to retrieve official and user skills
- Add POST /api/v1/skill/upload for skill file upload
- Parse SKILL.md frontmatter to extract name and description
- Move skill upload endpoint from files.py to skill_manager.py
- Add SKILLS_DIR configuration to settings.py
- Register skill_manager router in fastapi_app.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 19:45:04 +08:00
朱潮
0e6b2f1511 add CHECKPOINT_DB_URL 2025-12-24 20:43:10 +08:00
朱潮
b86a8364e9 db 2025-12-24 11:05:10 +08:00
朱潮
e117f1ee07 新增checkpoint清理机制 2025-12-24 00:12:01 +08:00
朱潮
bf11975183 修改balance资源配置 2025-12-23 23:11:24 +08:00
朱潮
06102559ef add SUMMARIZATION_MESSAGES_TO_KEEP 2025-12-23 22:31:26 +08:00
朱潮
d8dc973b95 sqlite pool and change agent cache to tools cache 2025-12-23 22:18:18 +08:00
朱潮
09a9c8be93 add MCP_HTTP_TIMEOUT and try catch 2025-12-23 20:13:46 +08:00
朱潮
a92bea5b58 删除一些环境变量 2025-12-18 09:41:43 +08:00
朱潮
c9a91f8f4d add DEFAULT_THINKING_ENABLE 2025-12-17 12:33:58 +08:00
朱潮
402e2ea5c3 增加默认上下文长度 2025-12-16 10:19:48 +08:00
朱潮
12cdb7679a TOOL_OUTPUT_MAX_LENGTH 2025-12-15 23:56:38 +08:00
朱潮
60f311e8b7 TOOL_OUTPUT_MAX_LENGTH 2025-12-15 23:55:30 +08:00
朱潮
b6975e1762 TOOL_OUTPUT_MAX_LENGTH 2025-12-15 23:54:32 +08:00
朱潮
77c8f5e501 settings 2025-12-15 21:58:54 +08:00