Skip to content

Latest commit

 

History

History
124 lines (93 loc) · 4.25 KB

File metadata and controls

124 lines (93 loc) · 4.25 KB

Business Tool Catalog

Language: English · 中文

Tools are the only controlled entry for Agents to invoke ERP capabilities — think “buttons the AI may press”, not “SQL the AI may write”.

Implementations live in:

  • src/AiNativeERP.WebApi/ToolHandlers/BusinessToolHandlers.cs
  • src/AiNativeERP.Agent/ToolHandlers/RagToolHandlers.cs

Design intuition

User says… Likely tool family
“list / how many / show” query_* / analyze_*
“how does it work / policy / process” query_knowledge
“create / place an order” create_* (draft)
“approve / reject” approve_* / workflow_approval

Every tool must:

  1. Pass through ToolGateway / permissions / business rules
  2. Mark writes with approval (RequiresHumanApproval)
  3. Emit audit logs
  4. Never expose universal SQL or arbitrary table access

Scenarios: user-scenarios.md.


Sales

Tool Description Typical risk
query_sales_report Sales report Low
analyze_sales_trend Sales trend analysis Low
query_sales_order Sales order query Low
query_customer Customer query Low
query_quotation Quotation query Low
create_quotation Create quotation draft Medium (confirm)
create_sales_order Create sales order draft High (confirm/approve)
approve_sales_order Approve sales order High
approve_quotation Approve quotation High

Purchase

Tool Description Typical risk
query_supplier Supplier query Low
query_purchase_order Purchase order query Low
create_purchase_order Create PO draft High
approve_purchase_order Approve PO High

Inventory

Tool Description Typical risk
query_inventory Inventory query Low
query_stock_alert Stock alerts Low

Finance

Tool Description Typical risk
query_invoice Invoice query Low
query_expense Expense query Low
query_payment Payment / collection query Low
expense_audit Expense audit helper Medium / High

HR

Tool Description Typical risk
query_employee Employee query Low
query_attendance Attendance query Low
attendance_statistics Attendance statistics Low
query_salary Salary query High
query_leave Leave request query Low

Production

Tool Description Typical risk
query_bom BOM query Low
query_production_order Production order query Low
create_production_order Create production order draft High
manage_production_order Manage production order state High

Workflow / General / Knowledge

Tool Description Typical risk
query_pending_approvals Pending approval list Low
workflow_approval Approval workflow actions (sales/purchase) High
generate_report Report generation Low / Medium
query_data Controlled business data query (not universal SQL) Low / Medium
llm_answer Pure LLM answer (no business writes) Low
query_knowledge RAG retrieval (knowledge_article only) Low
add_knowledge Add knowledge article Medium

Risk levels

Level Requirements
Low Permission + audit
Medium Permission + audit + draft confirmation
High Permission + business rules + approval/confirm + audit
Critical Multi-level approval + full audit (payments, deletes, etc.)

Adding a new tool

  1. Implement the business method in the Application layer (only write path)
  2. Add a Tool Handler with ToolName, permissions, risk, approval flag
  3. Add a matching Schema in IntentSchemaRegistry if direct routing is needed
  4. Register in DI / Tool Registry
  5. Add unit tests and domain-classification negatives when applicable
  6. Update both ZH and EN versions of this doc

Related: AI governance · Intent rules