agentleFS
saizulsaizul/ai-agent-builder-skills/skills/conversation-log-analysis/SKILL.md

conversation-log-analysis

Skill0 starsChanged 7 days agoMITView on GitHub

Analyse production chatbot and agent conversation logs to find what to fix next - intent mix (from labels or keyword rules), handover rate overall and per intent, failure turns (assistant could not help, user repeats or asks for a human, frustration, tool errors), abandonment and conversation length - with a script that reads JSONL message or conversation logs, masks emails and phones in examples, and can fail when handover or failure rates exceed thresholds. Use when reviewing a live or pilot agent, preparing a weekly quality report, deciding which intents to add or fix, measuring KPIs from the agent spec, or turning real failures into eval cases.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Define intents: Use labels from the platform if present.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Conversation log analysis

Production logs show what users really ask and where the agent fails. Review them weekly: numbers first, then read the worst conversations, then turn findings into fixes and tests.

Paths below are relative to this skill's folder.

When to use

  • "How is our chatbot doing?", weekly or pilot quality reports
  • Handover rate too high, CSAT dropped, users complain about loops
  • Deciding which intents to automate next or which docs are missing
  • Measuring the KPIs in the agent spec (containment, handover, repeat contact)

When not to use

  • Pre-launch testing without real traffic: use eval-harness
  • Logs contain unredacted personal data you may not process: redact first with guardrails-and-safety (redact_pii.py --jsonl) and confirm you are allowed to analyse them
  • Business analytics on revenue or funnels: use your analytics tool

Workflow

  1. Export and convert the logs to JSONL: one message per line (conversation_id, role, content, optional timestamp, intent, event) or one conversation per line (id, messages, optional intent, handover). Field details and converters: references/log-format.md. Redact before analysis.
  2. Define intents. Use labels from the platform if present; otherwise write keyword rules ({"order_status": ["where is my order", "tracking"], ...}) from 50-100 sampled conversations. Rules are matched in order on user messages; first match wins.
  3. Run the summary.
    python3 scripts/analyze_logs.py logs.jsonl
    python3 scripts/analyze_logs.py logs/*.jsonl --intents intents.json --examples 10
    python3 scripts/analyze_logs.py logs.jsonl --json > week-47.json
    python3 scripts/analyze_logs.py logs.jsonl --max-handover-rate 0.3 --max-failure-rate 0.2
    Exit 1 when a rate exceeds its threshold (use it for alerts).
  4. Read the numbers. Compare with the KPI targets and last week. Per intent: high share + high handover = biggest opportunity; high failure turns = prompt, tool or knowledge gap; high abandonment = slow or confusing answers. "unclassified" above ~15% means the intent rules need work.
  5. Read conversations. Open 10-20 failure examples (the script lists IDs and masked snippets) and 5 random successful ones. Classify each failure cause: missing knowledge, wrong tool, policy gap, prompt rule, UX/channel, out of scope. Heuristics are in references/log-format.md.
  6. Act. For each top cause: the fix (docs, tool, prompt, scope), the owner, and an eval case in eval-harness that reproduces it. Re-run next week to confirm the trend.

Output

Week 47: 3,412 conversations, 9,870 user turns (mean 2.9, median 2, max 31)
handover 22.4% (target < 30%), failure turns in 18.1%, abandoned 9.7%, tool errors 41
Top intents: order_status 38% (handover 9%), returns 21% (handover 34%), unclassified 12%
Failure reasons: assistant_could_not_help 402, user_repeated 188, user_frustrated_or_asked_for_human 155
Top fixes: 1) returns for marketplace orders not supported -> scope + doc (ops)
           2) lookup_order times out at 09:00-10:00 -> 41 tool errors (backend)
           3) 'unclassified' contains invoice requests -> new intent rule + FAQ
New eval cases: 6 (tag: regression-w47)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.