KatInterview

Building an Automated Playbook Miner for Enterprise AI Agents

System DesignModel answer
MediumModel answerSystem Designllm-systemsagentsml-system-design

Last updated

Design an end-to-end system that mines reusable agent playbooks from a company's traces and documents, tests them offline, ships them safely to agents, and keeps them current.

You are designing a service for enterprise customers who run AI agents. Each customer already has a lot of raw material: logs of past agent runs, chat transcripts, written procedures and runbooks, and code or queries their staff use. Your service should turn that material into skills that the customer's agents can use.

For this problem, a skill is a reusable, named bundle containing instructions and, optionally, scripts, tool-call recipes or reference files. An agent loads it when a task calls for it, so it does not need to rediscover the procedure each time.

Design the pipeline end to end. Cover:

  1. Inputs, consumers and the success metric you optimize.
  2. The stages that turn raw material into a skill, and what each stage produces.
  3. How a candidate skill is validated before anyone depends on it.
  4. How an approved skill is delivered to agents.
  5. How skills stay correct over time.

Before designing, list the clarifying questions you would ask. Examples: what source material exists, who consumes the skills and in what format, whether skills must stay private per customer, whether release is automatic or needs administrator approval, how success is measured, and how much data arrives and how fast a recurring task should become a skill.

State your assumptions explicitly, and discuss tenant isolation, sensitive data in the sources, the permissions a skill may exercise, auditability, duplicate or conflicting skills, versioning, drift, retirement, and model-call cost.

Hints

Hint 1

Start by defining the unit you produce: what is in a skill package, what metadata it carries (trigger description, required tools, owner, version), and how an agent decides to load it.

Hint 2

Label outcomes before you mine. Traces without a success or failure signal (explicit result, user feedback, downstream check) will teach the pipeline to copy mistakes, so cluster tasks and favor successful, efficient runs.

Hint 3

Evaluate a candidate against a no-skill baseline on held-out tasks of the same cluster, and treat tenant isolation, redaction and permission scoping as design requirements at every stage, not a final check.