-
Notifications
You must be signed in to change notification settings - Fork 490
数据库调整为 postgres / 添加基于部门的 Agent Context 管理 #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+9,865
−3,242
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
强,期待,坐等合入,我再搞一版mcp配置。 |
Contributor
|
用的是什么大模型呢?还是自己写的。我让AI新增支持dify知识库,整了好几天没整明白,无语了 |
Contributor
|
在搞dify知识库,团队有人把上万个文件上传到dify上面了,领导让支持对接dify知识库 |
- 在save_agent_config中实现了基于用户角色的知识库访问控制。 - 添加了新端点以检索当前用户可访问的数据库。 - 在数据库创建和更新过程中引入了share_config以管理共享设置。 - 创建了ShareConfigForm组件用于在UI中管理共享设置。 - 更新了部门和知识API以支持新的访问控制功能。 - 增强了用户管理组件以显示用户角色和部门名称。 - 重构了数据库视图以包含共享配置设置。
- 新增知识库、知识文件、评估基准、评估结果等数据模型 - 实现知识库相关Repository类提供CRUD操作 - 修改知识库实现类使用PostgreSQL存储元数据 - 添加PostgreSQL数据库管理器和初始化逻辑 - 更新相关路由和工具类适配新的存储方式 - 添加数据库迁移脚本和测试工具 - 在docker-compose中配置PostgreSQL服务
将业务数据模型从SQLite迁移至PostgreSQL,统一使用models_business.py 删除旧的SQLite模型和ConversationManager,新增repository和服务层 优化时间处理工具函数,增加utc_now_naive和format_utc_datetime 重构前端组件代码格式,统一多行导入和长字符串的换行风格
将任务服务从server/services移动到src/services 添加TaskRepository实现数据库持久化 更新所有相关导入路径
统一移除文件末尾多余的空行 调整多个文件中的导入语句顺序以保持一致性 将时间处理函数提取到datetime_utils模块中复用
移除所有agent子类中graph的缓存逻辑,改为每次都重新构建 在BaseAgent中添加_async_conn缓存并优化checkpointer缓存逻辑
新增部门级智能体配置管理,支持创建、切换、编辑和删除配置 添加运行时配置中间件,支持动态加载模型、工具和知识库 重构智能体上下文处理,支持部门ID和配置切换 实现前端配置管理界面,支持配置的增删改查和设为默认 添加后端API和数据库模型支持多配置管理
将各agent的工具加载逻辑统一改为通过RuntimeConfigMiddleware动态配置 移除直接的工具参数传递,改为从MCP服务获取工具并合并到中间件 在chat_stream_service中添加知识库权限过滤功能 TODO:目前历史记录的加载导致会话混乱
TODO: 前端还未完成过滤
重构 AgentConfigSidebar 组件,将工具选择逻辑抽象为通用选择组件 - 支持显示选项名称和描述 - 根据选项数量自动切换显示模式(卡片列表或弹窗) - 统一处理工具、知识库等多选配置项 - 优化样式和交互体验
e5cae38 to
aa20d5c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
变更描述
1. 数据库迁移(SQLite/JSON → PostgreSQL)
2. 多部门智能体配置管理
3. 知识库权限控制
4. 前端优化
5. 服务层重构
6. 其他优化
变更类型
测试
相关日志或者截图
说明
(可选)有什么需要特别说明的吗?
WARNING:本次重构虽然创建了数据库迁移脚本,也测试通过了,但是不保证数据迁移过程中没有问题,因此慎重测试。
迁移内容
saves/database/server.db)saves/knowledge_base_data/)saves/tasks/tasks.json)重要: 迁移前必须备份数据!
docker compose up -d postgres # 等待健康检查通过执行迁移
💡 提示: 提交前可以运行
make lint和make format检查代码规范