Files
iov_ana/core/__init__.py
Jeason b7a27b12bd SQLite 持久连接 — sandbox 不再每次查询开关连接,改为 __init__ 时建连、close() 时释放
Explorer 的 system prompt 明确告知 sandbox 规则 — "每条 SQL 必须包含聚合函数或 LIMIT",减少 LLM 生成违规 SQL 浪费轮次
LLM 客户端单例 — 所有组件共享一个 openai.OpenAI 实例,不再各建各的
sanitize 顺序修复 — 小样本抑制放在 float round 之前,避免被 round 干扰
quick_detect 从 O(n²) 改为 O(n) — 按列聚合一次,加去重,不再对每行重复算整列统计
历史上下文实际生效 — get_context_for 的结果现在会注入到 Explorer 的初始 prompt 里,多轮分析时 LLM 能看到之前的发现
2026-03-20 13:20:31 +08:00

23 lines
663 B
Python
Raw Permalink 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.
"""
iov_ana 核心包
项目结构:
core/
config.py - 配置
utils.py - 公共工具JSON 提取、LLM 客户端)
schema.py - Schema 提取
sandbox.py - SQL 沙箱执行器
layers/
planner.py - Layer 1: 意图规划
playbook.py - Layer 1.5: 预设剧本
explorer.py - Layer 2: 自适应探索
insights.py - Layer 3: 异常洞察
context.py - Layer 4: 上下文记忆
output/
reporter.py - 单次报告生成
consolidator.py - 多次报告整合
chart.py - 图表生成
agent.py - Agent 编排层
cli.py - 交互式 CLI
"""