Files
nexus/wiki/sources/sales-data-extraction-agent.md
2026-04-21 00:02:55 +08:00

44 lines
2.5 KiB
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.
---
title: "Sales Data Extraction Agent"
type: source
tags: [agent, sales, data-extraction, the-agency]
date: 2026-04-20
---
## Source File
- [[raw/Agent/agency-agents/specialized/sales-data-extraction-agent.md]]
## Summary
Sales Data Extraction Agent 是 The Agency 项目中的专业化 AI 智能体,专注于监控 Excel 文件目录并提取关键销售指标MTD、YTD、Year End。通过文件系统监视器实时检测新文件或更新文件解析 Excel 工作簿灵活映射列名revenue/sales/total_sales、units/qty/quantity并自动计算配额完成率。数据通过 PostgreSQL 事务原子性持久化,确保完整审计追踪。
## Key Claims
- 文件监视器通过忽略临时 Excel 锁文件(`~$`)避免处理不完整文件
- 灵活列名匹配机制fuzzy column mapping处理不同 Excel 格式的变体
- 通过 email 或全名匹配销售代表,未匹配行记录 warning 并跳过
- 从 sheet 名称自动检测指标类型MTD、YTD、Year End并带有 sensible defaults
- 所有导入操作记录:文件名、处理行数、失败行数、时间戳
- 处理时间目标:每文件 < 5 秒
## 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."
## Key Concepts
- [[Filesystem Watcher]]:监视目录中 `.xlsx``.xls` 文件的机制,忽略 `~$` 临时锁文件
- [[Fuzzy Column Mapping]]:通过模糊匹配列名处理不同 Excel 格式revenue/sales/total_sales、units/qty/quantity
- [[Metric Type Detection]]:从 sheet 名称自动识别 MTD、YTD、Year End 指标类型
- [[Quota Attainment]]:当 quota 和 revenue 同时存在时自动计算配额完成率
- [[Audit Trail]]:每条 metric 记录源文件,实现完整数据溯源
## Key Entities
- [[PostgreSQL]]:数据持久化目标数据库,支持事务原子性
- [[The Agency]]:开源 AI 智能体集合项目,本智能体为其 specialized 部门成员
## Connections
- [[Pipeline Analyst]] ← shares_domain ← [[Sales Data Extraction Agent]](均属 The Agency 销售相关 Agent
- [[PostgreSQL]] ← stores ← [[Sales Data Extraction Agent]](数据持久化目标)
- [[Filesystem Watcher]] ← implements ← [[Sales Data Extraction Agent]](文件监控机制)
- [[Data Pipeline]] ← is_type ← [[Sales Data Extraction Agent]](核心职责是数据管道)
## Contradictions
- 未发现与现有 wiki 内容的冲突