Atris

Find themes in customer satisfaction comments.
Done by an agent. Checked twice.

Survey comments are grouped into themes with a count, a share, an average score and a real quote for each.

Have Atris do this for you›

1

Real files in

  • survey_comments.csv
    Sixty five answers to a support satisfaction survey over twelve days, with six empty comments, one answer sent twice and four comments about two things at once. 66 lines, 5 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the survey answers
  2. 2.Find the themes
  3. 3.Write the tags and theme table

Claude Sonnet 5.5, 35 seconds. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 65 of 65 survey answers appear once in tagged.csv
  • ✓Passed: 65 of 65 answers have the right status: 58 counted, 6 with no comment and 1 duplicate
  • ✓Passed: 7 of 7 theme counts equal the counts recomputed from tagged.csv and they add up to 58 of 58 counted comments
  • ✓Passed: 7 of 7 themes have a share and an average score equal to the figures recomputed from the survey file
  • ✓Passed: 7 of 7 example quotes appear word for word in a comment filed under that theme
  • ✓Passed: 6 of 6 subjects found by keyword have at least 8 in 10 of their comments in one theme, across 6 different themes
  • ✓Passed: 4 of 4 second themes are another theme in the table whose subject the comment mentions by keyword and 0 answers that are not counted carry one
  • ✓Passed: There are 7 themes, 0 of them with fewer than 3 comments, listed largest first

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 7 ways on purpose. The check caught 7.

What it wrote. Lines 1 to 8 of themes.csv, copied from the file.
theme,count,share_percent,average_score,example_response_id,example_quote
response speed,15,25.9,3.00,S-4053,"The speed was great, reply in minutes."
agent manner,10,17.2,3.80,S-4014,"Friendly and human, not a script."
fix not holding,9,15.5,1.89,S-4017,Closed as resolved. It was not.
help articles,8,13.8,3.00,S-4002,The help article you sent was out of date. The buttons it describes are not there any more.
repeating yourself,8,13.8,2.25,S-4003,"The second agent had clearly read everything the first one wrote, so I did not have to repeat anything. Rare and appreciated."
phone support,5,8.6,2.80,S-4010,No way to speak to a person by phone. Chat kept dropping.
other,3,5.2,3.33,S-4046,Please add a dark mode to the app.

How this was run

An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.

Run 1 of 1 on 1 December 2026. The agent took 35 seconds.

What the second review verified

  • Statuses match the input: 6 answers with no comment (S-4013, S-4020, S-4023, S-4052, S-4056, S-4061), 1 duplicate (S-4036 repeats S-4035 from C-1244), and 58 counted. C-1279's two different comments (S-4011, S-4041) are both counted, which is correct.
  • I recomputed every theme row in python from the two files and they all match. For example, response speed is 15 comments, 25.9% (15/58) with an average score of 3.00, and fix not holding is 9 comments, 15.5% with an average of 1.89. The counts add up to 58.
  • All 7 example quotes appear word for word in the comment they name, and each of those comments is filed under that theme (for example S-4017 'Closed as resolved. It was not.' is under fix not holding).
  • The 4 comments about two subjects have a second_theme, and the main theme is the subject with more words. For example, S-4048 has response speed as its theme and agent manner as second_theme. There are 7 themes, each with at least 3 comments, in largest-first order.

What this run does not show

  • The grouping is tested by keyword. The check cannot tell a good theme name from a poor one.
  • A second theme left off a comment is not caught, because whether a comment has two subjects is a judgement.
  • On this run the second review worked in a folder where it could see the check file. It was not fully independent of the check.

Would the check catch a wrong answer?

A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 7 of 7. The check was made stricter after the first try at this, and the same untouched output was graded again.

Open every file

flow.md · the three steps the agent followed
# Find themes in customer satisfaction comments

function: support
for: the support lead who reads the survey results each fortnight
goal: Every survey comment is filed under one theme and each theme has a count, a share and an average score that can be checked.

## 1. Read the survey answers
Read input/survey_comments.csv. Each row is one answer: a score from 1 to 5 and a comment that may be
empty. Sort the rows into three kinds and record the kind in `status`:
- `no_comment` when the comment is empty or only says there is nothing to say, such as a dash or n/a.
- `duplicate` when the same customer_id sent the very same comment text earlier. The earliest one counts. A customer who sends two different comments has two answers that count.
- `counted` for everything else.

## 2. Find the themes
Read every counted comment before naming anything. A theme is what the comment is about, not how
the customer feels about it. Praise and complaints about the same subject share one theme. Name
each theme with two to four plain lowercase words.
- Use between 5 and 9 themes.
- A theme needs at least 3 comments. Comments that fit no such theme go under the theme `other`.
- Give each counted comment exactly one theme. When a comment has two subjects, the theme is the one the customer spends more words on and the other goes in `second_theme`.

## 3. Write the tags and theme table
Write output/tagged.csv with columns response_id,status,theme,second_theme. One row per answer, in
the order of the input file. theme and second_theme are empty unless status is `counted`.

Write output/themes.csv with columns theme,count,share_percent,average_score,example_response_id,example_quote.
One row per theme, largest count first.
- count is the number of counted comments with that theme.
- share_percent is count divided by all counted comments, times 100, to one decimal.
- average_score is the mean score of those comments, to two decimals.
- example_quote is copied word for word from the comment of example_response_id, which must be a comment filed under that theme.

Work out the counts, shares and averages with python3 from tagged.csv and the input file, not by eye.

## Done looks like
- Every answer appears once in tagged.csv and every counted comment has one theme.
- The counts in themes.csv add up to the number of counted comments.
- Every example quote can be found in the comment it names.
input/survey_comments.csv · 66 lines, 5 KB
response_id,submitted_at,customer_id,score,comment
S-4001,2026-11-16 08:17,C-1200,5,Ravi was so patient with me.
S-4002,2026-11-16 12:47,C-1207,2,The help article you sent was out of date. The buttons it describes are not there any more.
S-4003,2026-11-16 17:30,C-1214,5,"The second agent had clearly read everything the first one wrote, so I did not have to repeat anything. Rare and appreciated."
S-4004,2026-11-16 21:55,C-1221,2,Why is there no phone number? Some things are easier to say than to type.
S-4005,2026-11-17 02:33,C-1228,1,"Took far too long to get a first response, nearly a week."
S-4006,2026-11-17 06:53,C-1235,2,I wanted to call someone. Email only is not enough when payments are down.
S-4007,2026-11-17 11:26,C-1242,1,Had to reopen twice. It is still not fixed.
S-4008,2026-11-17 16:12,C-1249,3,"Quick reply, but it just linked an article that did not cover my question."
S-4009,2026-11-17 20:40,C-1256,2,Felt talked down to. The tone was condescending.
S-4010,2026-11-18 01:21,C-1263,2,No way to speak to a person by phone. Chat kept dropping.
S-4011,2026-11-18 05:44,C-1279,4,"Quick turnaround, thank you."
S-4012,2026-11-18 10:20,C-1277,2,Please read the ticket before replying. I repeated my account details in every message.
S-4013,2026-11-18 14:38,C-1284,4,
S-4014,2026-11-18 19:09,C-1291,5,"Friendly and human, not a script."
S-4015,2026-11-18 23:53,C-1201,3,"Polite enough, though the ticket was closed before I confirmed it worked."
S-4016,2026-11-19 04:19,C-1208,2,Every new agent asked me the same questions from scratch.
S-4017,2026-11-19 08:58,C-1215,1,Closed as resolved. It was not.
S-4018,2026-11-19 13:19,C-1222,4,Polite throughout even though I was grumpy.
S-4019,2026-11-19 17:53,C-1229,1,Passed between four agents and none of them had read the history.
S-4020,2026-11-19 22:40,C-1236,3,-
S-4021,2026-11-20 03:09,C-1243,2,"Handed from billing to tech and back, retyping my story each time."
S-4022,2026-11-20 07:51,C-1250,1,The agent was rude when I asked for a manager.
S-4023,2026-11-20 12:15,C-1257,3,
S-4024,2026-11-20 16:52,C-1264,2,I had to explain the problem three times to three different people.
S-4025,2026-11-20 21:11,C-1271,5,"Lovely person on the chat, made me laugh."
S-4026,2026-11-21 01:43,C-1278,3,Please offer a phone line for premier customers.
S-4027,2026-11-21 06:28,C-1285,5,Fixed properly the first time and it has not come back.
S-4028,2026-11-21 10:55,C-1292,4,Answer arrived in under an hour.
S-4029,2026-11-21 15:35,C-1202,2,Search in the help centre returns nothing useful. I typed invoice and got an article about staff.
S-4030,2026-11-21 19:57,C-1209,2,My issue remains unresolved and nobody has told me what happens next.
S-4031,2026-11-22 00:32,C-1216,5,Reply came within ten minutes. Impressive.
S-4032,2026-11-22 04:49,C-1223,5,"Fast answer, sorted before lunch."
S-4033,2026-11-22 09:19,C-1230,2,I waited 26 hours for someone to answer a simple question.
S-4034,2026-11-22 14:02,C-1237,5,"Great article on class passes, it answered everything."
S-4035,2026-11-22 18:27,C-1244,1,Waited four days for a first reply. By then I had fixed it myself.
S-4036,2026-11-22 18:29,C-1244,1,Waited four days for a first reply. By then I had fixed it myself.
S-4037,2026-11-22 23:05,C-1251,1,Had to wait all weekend with my booking page down.
S-4038,2026-11-23 03:25,C-1258,1,Still broken after two so-called fixes.
S-4039,2026-11-23 07:58,C-1265,5,Kind and clear. Thank you Meera.
S-4040,2026-11-23 12:44,C-1272,1,Ticket was marked solved but the problem is still happening.
S-4041,2026-11-23 17:12,C-1279,2,Too slow. Two days to hear back about a payment problem is not good enough.
S-4042,2026-11-23 21:53,C-1286,3,Your guides need screenshots. I got lost at step three.
S-4043,2026-11-24 02:16,C-1293,5,"Quick reply on a Sunday, did not expect that."
S-4044,2026-11-24 06:52,C-1203,5,Very prompt.
S-4045,2026-11-24 11:10,C-1210,2,Why do I need to repeat myself whenever the ticket changes hands?
S-4046,2026-11-24 15:41,C-1217,4,Please add a dark mode to the app.
S-4047,2026-11-24 20:25,C-1224,1,Slow. Three days of silence.
S-4048,2026-11-25 00:51,C-1231,2,"Agent was friendly but it took five days to get an answer, which cost me bookings."
S-4049,2026-11-25 05:30,C-1238,1,You closed my ticket without fixing anything.
S-4050,2026-11-25 09:51,C-1245,2,The fix lasted a day and then the same problem came back.
S-4051,2026-11-25 14:25,C-1252,1,Dismissive. I was told it was probably my fault before anyone looked.
S-4052,2026-11-25 19:12,C-1259,4,n/a
S-4053,2026-11-25 23:41,C-1266,5,"The speed was great, reply in minutes."
S-4054,2026-11-26 04:23,C-1273,2,Everything takes days with you lately.
S-4055,2026-11-26 08:47,C-1280,4,The step by step guide for calendar sync was spot on.
S-4056,2026-11-26 13:24,C-1287,2,
S-4057,2026-11-26 17:43,C-1294,3,"I could not find anything in the help centre about deposits, so I had to write in."
S-4058,2026-11-26 22:15,C-1204,5,Jonah was courteous and never made me feel stupid.
S-4059,2026-11-27 03:00,C-1211,5,"Warm, friendly service."
S-4060,2026-11-27 07:27,C-1218,5,The call back you arranged was exactly what I needed.
S-4061,2026-11-27 12:07,C-1225,5,
S-4062,2026-11-27 16:29,C-1232,2,I had to repeat everything on the phone after already writing it all down.
S-4063,2026-11-27 21:04,C-1239,2,The article contradicted what the agent told me about refunds.
S-4064,2026-11-28 01:21,C-1246,3,Support was fine. The price rise is what I am unhappy about.
S-4065,2026-11-28 05:51,C-1253,3,This survey has too many questions.
output/tagged.csv · written by the agent, 66 lines
response_id,status,theme,second_theme
S-4001,counted,agent manner,
S-4002,counted,help articles,
S-4003,counted,repeating yourself,
S-4004,counted,phone support,
S-4005,counted,response speed,
S-4006,counted,phone support,
S-4007,counted,fix not holding,
S-4008,counted,help articles,response speed
S-4009,counted,agent manner,
S-4010,counted,phone support,
S-4011,counted,response speed,
S-4012,counted,repeating yourself,
S-4013,no_comment,,
S-4014,counted,agent manner,
S-4015,counted,fix not holding,agent manner
S-4016,counted,repeating yourself,
S-4017,counted,fix not holding,
S-4018,counted,agent manner,
S-4019,counted,repeating yourself,
S-4020,no_comment,,
S-4021,counted,repeating yourself,
S-4022,counted,agent manner,
S-4023,no_comment,,
S-4024,counted,repeating yourself,
S-4025,counted,agent manner,
S-4026,counted,phone support,
S-4027,counted,fix not holding,
S-4028,counted,response speed,
S-4029,counted,help articles,
S-4030,counted,fix not holding,
S-4031,counted,response speed,
S-4032,counted,response speed,
S-4033,counted,response speed,
S-4034,counted,help articles,
S-4035,counted,response speed,
S-4036,duplicate,,
S-4037,counted,response speed,
S-4038,counted,fix not holding,
S-4039,counted,agent manner,
S-4040,counted,fix not holding,
S-4041,counted,response speed,
S-4042,counted,help articles,
S-4043,counted,response speed,
S-4044,counted,response speed,
S-4045,counted,repeating yourself,
S-4046,counted,other,
S-4047,counted,response speed,
S-4048,counted,response speed,agent manner
S-4049,counted,fix not holding,
S-4050,counted,fix not holding,
S-4051,counted,agent manner,
S-4052,no_comment,,
S-4053,counted,response speed,
S-4054,counted,response speed,
S-4055,counted,help articles,
S-4056,no_comment,,
S-4057,counted,help articles,
S-4058,counted,agent manner,
S-4059,counted,agent manner,
S-4060,counted,phone support,
S-4061,no_comment,,
S-4062,counted,repeating yourself,phone support
S-4063,counted,help articles,
S-4064,counted,other,
S-4065,counted,other,
output/themes.csv · written by the agent, 8 lines
theme,count,share_percent,average_score,example_response_id,example_quote
response speed,15,25.9,3.00,S-4053,"The speed was great, reply in minutes."
agent manner,10,17.2,3.80,S-4014,"Friendly and human, not a script."
fix not holding,9,15.5,1.89,S-4017,Closed as resolved. It was not.
help articles,8,13.8,3.00,S-4002,The help article you sent was out of date. The buttons it describes are not there any more.
repeating yourself,8,13.8,2.25,S-4003,"The second agent had clearly read everything the first one wrote, so I did not have to repeat anything. Rare and appreciated."
phone support,5,8.6,2.80,S-4010,No way to speak to a person by phone. Chat kept dropping.
other,3,5.2,3.33,S-4046,Please add a dark mode to the app.
check.py · the check, written before the run
"""Checks the theme table against the survey file.

Counts, shares and averages are recomputed from input/survey_comments.csv and the agent's own tags.
To test the grouping itself, the check finds six subjects in the comments by keyword (for example
every comment that mentions waiting, days or a quick reply). Comments that hit exactly one subject
should mostly land in one theme, and each subject should get a theme of its own.
"""
import csv, re, sys
from collections import Counter
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
    global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def squash(s):
    for a, b in (("’", "'"), ("‘", "'"), ("“", '"'), ("”", '"')):
        s = s.replace(a, b)
    return re.sub(r"\s+", " ", s).strip()

SUBJECTS = {
    "how fast support replied": r"\bwait(ed)?\b|\bslow\b|\bdays\b|\bhours?\b|\bquick\b|\bfast\b|\bminutes\b|\bprompt\b|too long|\bspeed\b",
    "having to repeat things": r"\brepeat(ed)?\b|\bexplain\b|from scratch|\bpassed\b|\bhanded\b",
    "how the agent treated them": r"\bfriendly\b|\bpatient\b|\bkind\b|\brude\b|\bpolite\b|condescending|\blovely\b|courteous|dismissive",
    "help articles": r"\barticle\b|help centre|\bguides?\b",
    "problem not fixed": r"\bclosed\b|still happening|still broken|not fixed|came back|come back|\breopen\b|unresolved",
    "phone support": r"\bphone\b|\bcall\b",
}
rows = list(csv.DictReader((root/"input/survey_comments.csv").open()))
kind, seen = {}, set()
for r in sorted(rows, key=lambda r: (r["submitted_at"], r["response_id"])):
    text = squash(r["comment"]).lower()
    if text in ("", "-", "n/a", "na", "none", "no comment", "."):
        kind[r["response_id"]] = "no_comment"
    elif (r["customer_id"], text) in seen:
        kind[r["response_id"]] = "duplicate"
    else:
        kind[r["response_id"]] = "counted"; seen.add((r["customer_id"], text))
by_id = {r["response_id"]: r for r in rows}
counted = [k for k, v in kind.items() if v == "counted"]

if not (root/"output/tagged.csv").exists() or not (root/"output/themes.csv").exists():
    say(False, "output/tagged.csv and output/themes.csv were not both written"); sys.exit(1)
tagged = list(csv.DictReader((root/"output/tagged.csv").open()))
got = {(r.get("response_id") or "").strip(): r for r in tagged}
def cell(k, col):
    return (got.get(k, {}).get(col) or "").strip().lower()
n = len(rows)
once = sum(1 for k in kind if sum(1 for r in tagged if (r.get("response_id") or "").strip() == k) == 1)
say(once == n and len(tagged) == n, f"{once} of {n} survey answers appear once in tagged.csv")
right = sum(1 for k, v in kind.items() if cell(k, "status") == v and (bool(cell(k, "theme")) == (v == "counted")))
empties = sum(1 for v in kind.values() if v == "no_comment"); dups = sum(1 for v in kind.values() if v == "duplicate")
say(right == n, f"{right} of {n} answers have the right status: {len(counted)} counted, {empties} with no comment and {dups} duplicate")

theme_of = {k: cell(k, "theme") for k in counted if cell(k, "theme")}
mine = Counter(theme_of.values())
table = list(csv.DictReader((root/"output/themes.csv").open()))
names = [(t.get("theme") or "").strip().lower() for t in table]
def num(t, col):
    try: return float((t.get(col) or "").replace("%", "").strip())
    except ValueError: return None
good = sum(1 for t, name in zip(table, names) if num(t, "count") == mine.get(name))
total = sum(int(num(t, "count") or 0) for t in table)
say(good == len(table) == len(mine) and total == len(counted), f"{good} of {len(table)} theme counts equal the counts recomputed from tagged.csv and they add up to {total} of {len(counted)} counted comments")
good = 0
for t, name in zip(table, names):
    ids = [k for k, v in theme_of.items() if v == name]
    if not ids: continue
    share = 100 * len(ids) / len(counted); mean = sum(int(by_id[k]["score"]) for k in ids) / len(ids)
    s, a = num(t, "share_percent"), num(t, "average_score")
    good += s is not None and a is not None and abs(s - share) < 0.051 and abs(a - mean) < 0.0051
say(good == len(table), f"{good} of {len(table)} themes have a share and an average score equal to the figures recomputed from the survey file")
good = 0
for t, name in zip(table, names):
    rid = (t.get("example_response_id") or "").strip()
    quote = squash(t.get("example_quote") or "").strip('"')
    good += rid in by_id and theme_of.get(rid) == name and len(quote.split()) >= 2 and quote in squash(by_id[rid]["comment"])
say(good == len(table), f"{good} of {len(table)} example quotes appear word for word in a comment filed under that theme")

homes, kept = {}, 0
for subject, words in SUBJECTS.items():
    ids = [k for k in counted if re.search(words, by_id[k]["comment"].lower())
           and sum(1 for w in SUBJECTS.values() if re.search(w, by_id[k]["comment"].lower())) == 1]
    top, size = Counter(theme_of.get(k, "") for k in ids).most_common(1)[0]
    if size >= 0.8 * len(ids) and top not in ("", "other"):
        kept += 1; homes[subject] = top
own = len(set(homes.values()))
say(kept == len(SUBJECTS) and own == len(SUBJECTS), f"{kept} of {len(SUBJECTS)} subjects found by keyword have at least 8 in 10 of their comments in one theme, across {own} different themes")
subject_at = {theme: subject for subject, theme in homes.items()}
seconds = {k: cell(k, "second_theme") for k in kind if cell(k, "second_theme")}
stray = sum(1 for k in seconds if kind[k] != "counted")
sound = sum(1 for k, second in seconds.items() if kind[k] == "counted" and second in mine and second != theme_of.get(k)
            and (second not in subject_at or re.search(SUBJECTS[subject_at[second]], by_id[k]["comment"].lower())))
found = f"{sound} of {len(seconds)} second themes are another theme in the table whose subject the comment mentions by keyword" if seconds else "No answer carries a second theme"
say(sound == len(seconds), f"{found} and {stray} answers that are not counted carry one")
small = [name for name, c in mine.items() if c < 3 and name != "other"]
order = [num(t, "count") or 0 for t in table]
say(5 <= len(mine) <= 9 and not small and order == sorted(order, reverse=True), f"There are {len(mine)} themes, {len(small)} of them with fewer than 3 comments, listed largest first")
sys.exit(0 if ok else 1)

survey_comments.csv: sample data written by Atris. Fingerprint 14a6df824e58.

tagged.csv: written by the agent. Fingerprint 45115f04444f.

themes.csv: written by the agent. Fingerprint 44f30de46e62.


More customer support work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms