refactor(storage): 迁移记忆系统架构至现代化Vector DB方案

重构记忆存储层,采用ChromaDB作为核心向量数据库引擎,提升系统可扩展性和查询性能。通过引入VectorMemoryStorage替代原有的UnifiedMemoryStorage实现,实现了更高效的向量索引和检索机制。

主要变更包括:
- 架构层面:完全重构记忆存储抽象层,移除577行旧存储实现代码
- 配置系统:新增41项Vector DB专用配置参数,支持细粒度性能调优
- 查询优化:增强ChromaDB查询条件处理器,添加智能回退机制
- 系统集成:更新记忆系统初始化流程,适配新的存储接口
- 类型安全:修复异步调用类型不匹配问题

BREAKING CHANGE: 记忆存储API接口发生重大变更,UnifiedMemoryStorage相关类已废弃
This commit is contained in:
Windpicker-owo
2025-10-02 00:28:55 +08:00
parent 70c056b4fa
commit bce623a58b
7 changed files with 856 additions and 613 deletions

View File

@@ -795,7 +795,7 @@ class LLMRequest:
max_tokens=max_tokens,
)
self._record_usage(model_info, response.usage, time.time() - start_time, "/chat/completions")
await self._record_usage(model_info, response.usage, time.time() - start_time, "/chat/completions")
content, reasoning, _ = self._prompt_processor.process_response(response.content or "", False)
reasoning = response.reasoning_content or reasoning