ai-rule-engine/memory/2026-05-11.md
root cd0ec8397f feat(ai-rule-engine): 添加 AI 规则引擎设计方案
- 确定技术选型:Python + SQLite + RestrictedPython
- 规划核心模块:RuleCompiler、RuleExecutor、RuleStore、ConflictDetector
- 设计 REST API 接口
- 定义 MVP 范围

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 21:19:55 +08:00

41 lines
943 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2026-05-11
## 纪要
- AI 规则引擎项目启动
## 决策
### AI 规则引擎技术选型
- **技术栈**: Python 3.10+ / SQLite / REST API / 本地运行
- **AI 编译器**: GPT-4o / Claude Sonnet
- **安全隔离**: RestrictedPython
- **规则形式**: Python 函数 + 安全隔离执行
**为什么方案 A轻量级自研而非方案 B规则引擎库**
- AI 生成 Python 函数链路最短,灵活度最高
- MVP 阶段快速验证核心价值
- 后续可按需替换执行层
### 核心功能优先级
1. SQLite 存储层
2. 基础 REST API
3. LLM 编译器
4. RestrictedPython 执行器
5. 基础规则校验
6. 冲突检测(简化版)
### 冗余处理范围
- 规则去重embedding 相似度)
- 规则冲突检测(真值表分析)
- LLM Callback 兜底(无匹配时自动补充规则)
## 问题与修复
(暂无)
## 待办
- [ ] Phase 2: 编写实现计划
- [ ] Phase 3: TDD 实现