Update nexus wiki content
This commit is contained in:
@@ -1,47 +1,47 @@
|
||||
---
|
||||
title: "Sales Data Extraction Agent"
|
||||
type: source
|
||||
tags: []
|
||||
date: 2026-04-25
|
||||
---
|
||||
|
||||
## Source File
|
||||
- [[raw/Agent/agency-agents/specialized/sales-data-extraction-agent.md]]
|
||||
|
||||
## Summary(用中文描述)
|
||||
- 核心主题:销售数据提取 AI Agent,专门监控 Excel 文件并提取关键销售指标
|
||||
- 问题域:销售报告自动化处理、销售指标实时监控
|
||||
- 方法/机制:文件系统监控 + 灵活列映射 + PostgreSQL 持久化
|
||||
- 结论/价值:实现销售数据的自动化提取与下游分发,减少人工干预
|
||||
|
||||
## Key Claims(用中文描述)
|
||||
- Agent 实时监控指定目录中的 Excel 文件(新文件或更新版本)
|
||||
- Agent 从 Excel 工作簿中提取 MTD(月度至今)、YTD(年度至今)和 Year End(年终预测)指标
|
||||
- Agent 支持灵活列名映射(revenue/sales/total_sales 等)
|
||||
- Agent 自动计算配额达成率
|
||||
- Agent 使用事务将提取的指标批量插入 PostgreSQL,保证原子性
|
||||
- Agent 保留完整的审计跟踪记录
|
||||
|
||||
## Key Quotes
|
||||
> "You are the Sales Data Extraction Agent — an intelligent data pipeline specialist who monitors, parses, and extracts sales metrics from Excel files in real time. You are meticulous, accurate, and never drop a data point." — Agent 身份定义
|
||||
|
||||
> "Never overwrite existing metrics without a clear update signal (new file version)" — 关键规则:数据覆盖保护
|
||||
|
||||
## Key Concepts
|
||||
- [[FilesystemWatcher]]:文件系统监控,检测目录中的 .xlsx 和 .xls 文件变化
|
||||
- [[FuzzyColumnMapping]]:模糊列名匹配,处理 revenue/sales/total_sales、units/qty/quantity 等变体
|
||||
- [[MetricExtraction]]:指标提取,从工作簿中识别 MTD、YTD、Year End 等指标类型
|
||||
- [[TransactionalDatabase]]:事务性数据库操作,使用 PostgreSQL 事务保证原子性
|
||||
- [[AuditTrail]]:审计跟踪,记录每次导入的文件名、处理行数、失败行数、时间戳
|
||||
|
||||
## Key Entities
|
||||
- [[PostgreSQL]]:目标数据库,用于存储提取的销售指标
|
||||
- [[SalesRepresentative]]:销售代表,Agent 通过邮箱或全名匹配
|
||||
- [[ExcelWorkbook]]:Excel 工作簿,包含多个 sheet 的销售数据
|
||||
|
||||
## Connections
|
||||
- [[AgentsOrchestrator]] ← orchestrates ← [[SalesDataExtractionAgent]]
|
||||
- [[SalesDataExtractionAgent]] ← provides_data ← [[ReportDistributionAgent]]
|
||||
|
||||
## Contradictions
|
||||
- 与 [[DataConsolidationAgent]]:DataConsolidationAgent 整合来自多个来源的数据,而 SalesData Extraction Agent 专注于从 Excel 文件提取数据;两者可以互补使用
|
||||
---
|
||||
title: "Sales Data Extraction Agent"
|
||||
type: source
|
||||
tags: [Agent, Sales, Data-Extraction]
|
||||
date: 2026-04-30
|
||||
---
|
||||
|
||||
## Source File
|
||||
- [[raw/Agent/agency-agents/specialized/sales-data-extraction-agent.md]]
|
||||
|
||||
## Summary(用中文描述)
|
||||
- 核心主题:Sales Data Extraction Agent — 一个专注于监控 Excel 文件并提取销售指标(MTD、YTD、Year End)的 AI Agent
|
||||
- 问题域:企业销售数据的实时采集与下游报表分发,需处理多种格式的 Excel 文件并保证数据完整性
|
||||
- 方法/机制:文件系统监控 → 灵活列名映射 → 指标类型自动识别 → PostgreSQL 事务持久化 → 下游事件通知
|
||||
- 结论/价值:实现销售数据的全自动化采集,100% 无人工干预,完整审计追踪
|
||||
|
||||
## Key Claims(用中文描述)
|
||||
- Agent 通过文件系统监控(filesystem watcher)实时检测指定目录中的 .xlsx/.xls 文件(忽略 `~$` 临时锁文件),等待写入完成后触发处理流程
|
||||
- Agent 使用模糊列名匹配(fuzzy matching)处理灵活多变的 Excel schema,支持 `revenue/sales/total_sales`、`units/qty/quantity` 等多种列名变体
|
||||
- Agent 从工作表名称自动推断指标类型(MTD / YTD / Year End),并在 quota 和 revenue 同时存在时自动计算配额达成率
|
||||
- Agent 以事务方式批量插入提取的指标到 PostgreSQL,每条记录附有源文件信息以支持完整审计追踪
|
||||
- Agent 从不覆盖已有指标数据,仅在新文件版本出现时才更新;所有导入操作均记录文件名、处理行数、失败行数和时间戳
|
||||
|
||||
## Key Quotes
|
||||
> "Never overwrite existing metrics without a clear update signal (new file version)" — 核心数据保护规则
|
||||
> "Match representatives by email or full name; skip unmatched rows with a warning" — 数据匹配策略
|
||||
> "Detect metric type from sheet names (MTD, YTD, Year End) with sensible defaults" — 指标类型推断逻辑
|
||||
|
||||
## Key Concepts
|
||||
- [[FileSystemWatcher]]:通过文件系统监控检测新 Excel 文件,忽略 `~$` 临时锁文件,等待写入完成后触发处理
|
||||
- [[FuzzyColumnMatching]]:使用模糊列名匹配处理 Excel schema 变化,支持 `revenue/sales/total_sales`、`units/qty/quantity` 等变体
|
||||
- [[MetricTypeDetection]]:根据工作表名称(MTD / YTD / Year End)自动推断指标类型并设置默认值
|
||||
- [[QuotaAttainment]]:当 quota 和 revenue 同时存在时自动计算配额达成率 = revenue / quota
|
||||
- [[AtomicDataPersistence]]:使用 PostgreSQL 事务进行批量插入,保证数据原子性;每条记录附源文件审计字段
|
||||
- [[AuditTrail]]:每次导入记录文件名、处理行数、失败行数和时间戳,支持下游追溯
|
||||
|
||||
## Key Entities
|
||||
- [[PostgreSQL]]:目标持久化数据库,Agent 将提取的指标批量写入其中
|
||||
- [[ReportDistributionAgent]]:下游消费 Agent,接收 Agent 发送的完成事件并分发报告
|
||||
|
||||
## Connections
|
||||
- [[SalesDataExtractionAgent]] ← feeds ← Excel Files (source input)
|
||||
- [[ReportDistributionAgent]] ← depends_on ← [[SalesDataExtractionAgent]]
|
||||
- [[DataConsolidationAgent]] ← aggregates ← [[SalesDataExtractionAgent]] (推测:多个提取 Agent 向上游聚合)
|
||||
|
||||
## Contradictions
|
||||
- 当前页面无冲突内容
|
||||
|
||||
Reference in New Issue
Block a user