Skip to content

KB → Bot Upload Workflow (Single-Instruction Spec)

Workflow request. Implements the data-layer recommendations in ADR-0002 and the interface decisions in ADR-0004. Stage 1 (Q&A) scope; knowledge-set source-type semantics are documented in the data-layer research memo (working document, not in this repo).

The single instruction

Upload these [files] as [Bot]'s KB
  • [files] — one or more local files, or a folder.
  • [Bot] — a bot name from the roster (e.g. Technology Assistant).
  • Omitted [Bot] = ALL smart bots in the company — every bot in the roster gets the files in its knowledge feed.

Examples:

User says Effect
Upload these files as Technology Assistant's KB Files enter Technology Assistant's feed only
Upload this folder as all bots' KB Files enter every bot's feed
Upload spec.pdf as B2's KB Files enter B2's feed only

What the agent does on receiving the instruction

  1. Validate each file (hard limits, see table below). Reject with reason; never silently skip.
  2. Resolve targets: named bot → its mapped feed folder; omitted → every bot in ~/.workbuddy/wecom-bot-roster.md with status Live.
  3. Copy files into each target's feed folder in WeCom Drive (folder per bot, e.g. Bot-KB/<bot-name>/). Drive add/delete auto-syncs into the bot's knowledge set (~15 min).
  4. Verify: spot-check knowledge_base status or Drive listing; report per-bot success/failure counts.
  5. Report: files × bots matrix, rejected files with reasons, and the sync caveat ("learned within ~15 minutes").

Validation rules (stage 1 knowledge-set limits)

Rule Limit
File size ≤ 100 MB
Formats pdf / doc / docx / xlsx; no xls
Items per knowledge set 1000
Drive folder files learned Latest 1000
Local docx text ≤ 1M chars
Table cells per file ≤ 1M

Bot → feed mapping

Maintained in the bot roster (~/.workbuddy/wecom-bot-roster.md):

Bot Feed folder
HW-Bot-WB (B1) n/a — posting agent, no KB
B2 Product Expert Bot-KB/product-expert/
B3 Software Assistant Bot-KB/software-assistant/
B4 Africa Ops Assistant Bot-KB/africa-ops/
New bots Bot-KB// (create on first upload)

"All bots" includes every rostered Live bot except bots explicitly marked no-KB (B1).

Out of scope (stage 2)

  • Programmatic knowledge-set writes via the management API (requires a Data & Intelligence Zone program).
  • Per-bot differentiated feeds, dedup, and re-sync scheduling.
  • Inbound Q&A (bots still answer only from what their knowledge sets learned).