I built an AI sales coach that lives in a Telegram group
Three Claude Code agents, one Switch template and offline Whisper turn a team's Telegram group into conversation intelligence for sales meetings that never happen on Zoom. They transcribe, score the deal, coach the rep and draft the follow-up, with a human approval gate.
TL;DR: FieldNotes lets a sales rep record an in-person meeting on their phone and drop it into the team's Telegram group. Three AI agents then pick it up inside the chat: one transcribes it offline, one scores the deal and coaches the rep, and one updates the CRM and drafts the follow-up email, which waits until a human types "approve". It's built on Switch , which turns a Telegram group into a room where people and agents work together.
- 🎬 Demo (2 min): https://youtu.be/x07z0l2V8cU
The problem: the best sales conversations are invisible
Conversation-intelligence tools like Gong, Otter and Fireflies are great, as long as the conversation happens on Zoom. But sales in India mostly works differently: a rep visits a grocery chain's head office, walks a pharmacy owner through a demo at the counter, or meets a distributor over chai. None of that gets recorded. So the CRM gets filled in from memory, if at all, the manager never hears what the customer actually said, and nobody gets coached.
I wanted the reps to need nothing new. No app and no new login. They already have a phone and a team group chat. The question was how to get AI agents into that group as real teammates, not as a bot that answers one question at a time. That's what Switch does.
What Switch is, in one paragraph
Switch is open-source infrastructure for putting AI agents into team chat. You connect Slack, Teams, Discord, Telegram or Mattermost, and every channel becomes a room. Agents join rooms like any teammate, with their own name. The agents themselves (Claude Code, Codex, OpenCode or anything that speaks the protocol) run on your own machine. Switch is where they meet, not what runs them. A desktop app, Switch Console, runs a local server, connects your chat apps and starts your agents.
Three Switch behaviours shaped everything I built:
- An agent only hears messages addressed to it (an @-mention, a reply, or a room where it's the assigned agent). Everything else is context it can read, not something pushed to it.
- Attachments arrive already downloaded. When someone posts a file, the agent gets a local path to it. A Telegram voice note becomes
brightmart.oggon disk. This is the feature that made an offline-conversation product possible.
- Agents hand work to each other by @-mentioning each other in the room. There's no hidden orchestration. The hand-off is a chat message, so the whole team sees the trail.
The design: three agents, one room
Agent | Job |
|---|---|
fn-scribe | Transcribe the recording offline, work out who said what, write meeting notes |
fn-analyst | Measure the conversation, score the deal, coach the rep, answer team questions |
fn-dealdesk | Update the CRM, draft the follow-up, and only mark it sent when a human approves |
One principle I'm glad I set early: keep "measured" separate from "judged".
- Measured numbers come from timestamps, computed by a plain Python script. They include the rep's talk ratio, the number of questions asked and the longest monologue. An LLM never guesses these.
- Judged fields (deal score, BANT, objections, risks) come from the agent reading the transcript, against a fixed JSON schema, and every judgement has to quote the customer. A validator rejects anything that doesn't fit the schema, so the team dashboard can compare calls.
"You talked 85% of the time and asked one question" is a measurement, not an opinion. That's what makes the coaching trustworthy.
Building it, step by step
1. The deterministic tools
The agents are Claude Code, so they can run scripts. I wrote small, boring Python tools and let the agents orchestrate them:
tools/transcribe.py faster-whisper on CPU, ffmpeg decodes any phone formattools/speakers.py compact speaker labels: "0:A,3:B,9:A" (only where the speaker changes)tools/metrics.py talk ratio, questions, monologues -> metrics.json + scorecard.pngtools/analysis.py schema + validator for the judged analysis, and a chat-ready scorecardtools/crm.py a file-backed CRM (the one seam to swap for HubSpot/Salesforcetools/dashboard.py team report across every call + chartWhisper doesn't tell speakers apart, so the scribe does it. It reads the numbered transcript and records only the segments where the speaker changes. For two- or three-person meetings an LLM does this surprisingly well, and it costs a few tokens instead of a diarization model.
Practical tip: decode audio with ffmpeg yourself instead of relying on faster-whisper's built-in decoder. A recent PyAV release broke it (
open() got an unexpected keyword argument 'metadata_errors' ), and ffmpeg handles every format a phone produces anyway.2. Playbooks instead of prompts
Each agent's behaviour lives in a plain-English Markdown playbook in the repo, plus a sh Switch instructions are short: who you are, then "read your playbook before your first
task". A sales manager can change how the agents behave by editing a Markdown file, withing the agents.
3. One template creates the team
Switch templates are YAML. This is the heart of the setup (trimmed):
params: room: { type: room, label: Sales room } workspace: { type: directory, label: FieldNotes folder } machine: { type: machine, label: Runs on, default: [$first] }
agents: - name: fn-scribe addressing: anyone provider: claude machine: "{machine}" directory: "{workspace}" join: ["{room}"] instructions: | You are fn-scribe ... Your full playbook is playbooks/scribe.md - name: fn-analyst # same shape - name: fn-dealdesk # same shape
Import it in Switch Console → Templates, pick your room and folder, and all three agents are created and added to the room in one click.
Why
join: instead of a room: block? Telegram bots can't create chats, so the group has to exist first. Switch adopts it as a room when you add the bot, and the template joins the agents to it.4. Connecting Telegram
- In @BotFather, send
/newbotand save the token.
- Turn Group Privacy off (
/mybots→ Bot Settings → Group Privacy) before addinge the bot only sees messages that mention it.
- In Switch Console go to Messaging apps → Connect → Telegram, and paste the token.
- Create the group, add the bot, make it an admin, and say hi. It's now a Switch room.
Two commands in the group finish the setup:
!assign-agent @fn-scribe # every recording goes to the scribe, no tagging needed!list-agents5. The flow in the room
A rep sends a voice note captioned "BrightMart, met Priya". This is what happened in my test run:
- 18:29 Scribe: "Got it: transcribing offline now". The 3m52s recording took 53 seconds on CPU.
- 18:31 Notes posted, with customer quotes and timestamps, then
@fn-analyst please analyse…
- 18:32 Analyst: deal score 68/100, BANT, talk ratio 53%, 11 questions, and the catcever handled* ("I'm not sure the CFO will see it that way").
- 18:33 Deal Desk: the CRM moves to "proposal", and "Monday" and "next Thursday" become 9 Nov and 12 Nov. A follow-up email in the rep's voice waits for approval.
Recording to follow-up draft took about four minutes, with no laptop opened.
Two details made me trust it. When I ran the same recording twice, the deal score came out at 68 both times. And the scribe wrote the customer as "Priya (role not stated)", because her title is never said in the recording. It didn't invent one.
Then the manager view: "@fn-analyst how is the team doing?" The analyst compared two repme with a 46-second opening pitch, so "we already have a billing system" went unanswered.It recommended a 20-minute session where the stronger rep walks her through his opening questions. That's a coaching conversation nobody would have known to have.
What tripped me up (so it doesn't trip you up)
I built this on Windows, and hit a few things worth knowing:
- "Not supported here" for every provider. A template param of
type: locationsen's local-session path, which doesn't support Windows. Switching totype: machinerunsthem as managed agents on the PC's controller, which works fine.
- Remote SSH hosts on Windows. Console expands
~inIdentityFileusing$HOME,ou get a misleading "SSH agent socket not found". Use the full path, likeIdentityFileC:/Users/you/.ssh/id_ed25519.
- Remote hosts need Node 22.13+, even though the docs say 18+. Ubuntu 24.04 ships 18.
- The Telegram supergroup trap. Promoting the bot to admin made Telegram upgrade my new chat id. Switch created a fresh room for it, but my agents were in the old room,pointing at a dead chat. The fix was
/invite_agent @fn-scribein the group. The server log tells you exactly this.
- Agent permissions. Commit a
.claude/settings.jsonthat allows your tool scripts. Otherwise your agents stop and ask for approval in a chat where nobody can click "allow".
Switch's server log was the MVP of debugging. Every problem above showed up as a clear,
Tips for your first Switch project
- Design the room, not the bot. Ask what the people in the channel should see and approve, and make agent hand-offs visible messages.
- Mention agents by name. If an agent "ignored" something, it probably never heard it. Use
!assign-agentfor a room with one obvious default agent.
- Lean on attachments. Files in and files out are the cleanest interface between chat and real work.
- Keep instructions in the repo. Short Switch instructions plus a playbook file lets you iterate without touching the agents.
- Put a human gate on anything that leaves the team, and make the gate a chat reply.
- Switch has no scheduler. For a weekly digest, trigger it from outside with any automation that posts a message addressing the agent.
What's next
Acoustic diarization for group meetings, real CRM connectors, a weekly coaching digest, and better Hindi and Hinglish transcription. It's all open source at https://github.com/Dupahar/FieldNotes . Clone it, connect your own group, and record your next meeting.


Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article