How we built an AI agent that runs an entire helpdesk
Engineering Blogs

How we built an AI agent that runs an entire helpdesk

Engineering Team, Facilio Engineering Team, Facilio
7 min read
Kamal
Written by Kamal
Solutions Engineer, Facilio engineering team · LinkedIn
Engineering series

It was another Tuesday at work when a fairly straightforward request landed on our desks: build an AI agent that could handle tenant helpdesk requests over phone and WhatsApp, in English and Arabic, for a leading facilities management company in the UAE.

On every conversation, the agent needed to identify the tenant's property, understand the issue, check for existing requests, assign the right priority, and create or update the request in the system, all on the client's existing phone infrastructure. None of these tasks was particularly difficult to demonstrate on its own. Getting them to work together reliably, on a live phone call, was a different ballgame.

From the start, we had two competing requirements. The agent had to:

  • Respond fast enough for a natural phone conversation.
  • Follow the rules of the FM operation accurately.

When we tried handling every rule through one prompt, we watched the model miss instructions. A more capable model would have cost us the response times we were fighting for.

So we had to approach it differently. Every great AI product is built in the details, and this one came down to obsessing over every second of every conversation. Here's how we built it, what we had to change along the way, and what we've learned from running it in production.

In short
  1. The hard part wasn't understanding requests. It was getting the priority, the property and the action right, every time, on a live call.
  2. We kept tenants on the numbers they already knew by plugging the agent straight into the client's phone system.
  3. We tuned every layer for speed, because on a call, silence sounds like a dropped line.
  4. One prompt couldn't hold every rule, so we gave each job its own specialist agent and taught the agent to match names by sound.
  5. A scored evaluation suite and production tracing now guide every change we ship.

What the agent actually had to get right

Our client manages a large portfolio, with thousands of individual spaces across its sites, buildings and floors. Tenants contact the helpdesk at all hours: sometimes to report a new issue, sometimes to follow up on an existing request, and occasionally about something urgent.

Understanding what a tenant wanted turned out to be the easy part. The hard part was everything that came after:

  • Recognizing the request and its urgency. A leak might need immediate priority.
  • Tying it to the correct property. A request logged against the wrong property sends the facilities team looking in the wrong place.
  • Carrying out the right action. A tenant chasing an unresolved issue shouldn't end up with a duplicate ticket.

Accuracy here isn't a nice-to-have; it's the difference between resolving an issue and creating a new one.

Kamal

Those became the operational requirements we kept coming back to as we designed and tested the agent.

A new helpdesk experience, through the same familiar channels

Keeping the numbers tenants already knew

The client already ran its phones on 3CX, and thousands of tenants were familiar with the existing helpdesk numbers. We didn't want to change that, or add any friction to the tenant experience.

So we built a SIP softphone server, hosted in the UAE, and connected it directly to the client's 3CX setup. To the phone system, the agent simply became another endpoint that calls could be routed to. WhatsApp messages reach the same agent through a separate channel.

TenantEnglish · ArabicCALLExisting numbersClient's 3CXVoice serverHosted in the UAEWHATSAPPWhatsApp messagesAGENTIC FLOWEmergenciesLeaks · fire · gasExisting requestsFollow-upsNew ticketsFresh requestsRequest loggedTenant kept postedTenantEnglish · ArabicCALLExisting numbersClient's 3CXWHATSAPPMessagesVoice serverIn the UAEAGENTIC FLOWEmergenciesLeaks · fire · gasExisting requestsFollow-upsNew ticketsFresh requestsRequest loggedTenant kept posted
The path of a call or message. Calls come in through the client's existing 3CX and our voice server in the UAE. WhatsApp reaches the same agent. A specialist takes it from there.

No awkward silences on the line

With the connections in place, we turned to what tenants would experience when they actually talked to the agent. I've sat through enough annoying IVR calls, grunting and mumbling under my breath until the bot finally told me which button would get me a human. We weren't going to let that be the experience with our agent. No awkward silences, no wondering whether the call had dropped, and definitely no "Hello? Hello? Hellooooo?" just to get a response.

We found several places in the voice pipeline where we could save time:

  • Hosting: Running the voice server in the UAE, close to the tenants calling in, cut network latency.
  • End-of-speech detection: Tuning it let the agent recognize when someone had finished speaking and respond without an unnecessary pause.
  • The model itself: Larger models could handle more complex instructions, but they were too slow for a live conversation, so we chose a faster model that could respond within the window we were targeting.

That gave us the response times we wanted. Now we needed the agent to get the work right.

Specialized agents for each job

Our original design asked a single model to keep track of the rules for emergencies, follow-ups and new requests, even though each tenant only ever needed one of those workflows. It started skipping rules and mixing up steps.

We didn't need a dog that could bark, meow and lay eggs. We needed a dog, a cat and a chicken. In other words, we needed agents that each knew exactly what they were doing. So we used Agentic Flow, our agent orchestration framework, to give each job its own specialist:

  • Emergency requests: Recognizes urgent situations such as leaks, fires and gas-related issues, and applies the right priority rules.
  • Existing requests: Handles tenants following up on issues they have already reported.
  • New requests: Collects the information needed to create a new ticket.
First design · one long prompt
Emergencies
Existing requests
New tickets
Every rule, every step
Skipped rules, mixed-up steps
What we shipped · Agentic Flow
EmergenciesOwn instructions only
Existing requestsOwn instructions only
New ticketsOwn instructions only
Fast, and follows its rules
Same fast model, smaller jobs. The single agent holding every rule kept slipping. Specialists holding only what they need did not.

This mattered most for emergencies. A tenant reporting a gas leak shouldn't have to answer the same questions as someone reporting a faulty light. With emergencies in their own agent, those requests skip the routine questions and go straight to same-day priority, as any plan for emergency maintenance demands.

agentic_flowIllustration, not production code
# every conversation goes to exactly one specialist
if conversation.is_emergency:        # leak, fire, gas
    route(emergency_agent)           # skips every question → same-day priority
elif conversation.is_existing_request:
    route(existing_request_agent)
else:
    route(new_ticket_agent)

# each agent loads only the instructions it needs

Splitting the responsibilities also made testing and troubleshooting far easier. When something went wrong, we could isolate the relevant workflow, examine its behavior, and fix it without untangling one enormous prompt.

Matching property names, no matter how they're pronounced

The next headache was property identification. Speech-to-text had a particular talent for getting building names wrong. Many of the names were Arabic, and the same name could be pronounced or transliterated in several ways. A straightforward text match against the property database couldn't keep up: a misheard name could return no match at all or, worse, match a different building.

So we built a Phonetic Property Resolver. Instead of depending on the exact spelling in the transcript, it matches property names by how they sound, accounting for variations in Arabic pronunciation and transliteration. That let the agent work with what tenants actually said over the phone, rather than expecting everyone to pronounce a property name exactly the way it was stored in the database.

Putting the agent through its paces

We didn't want tenants to be the ones finding our mistakes. Before going live, we built a scored evaluation suite from real helpdesk scenarios to test how accurately the agent:

  • Classified requests
  • Followed operational rules
  • Completed the expected actions

Every time a test failed, we traced the issue to its root, adjusted the relevant prompts or workflows, and ran the full suite again. Running the entire suite mattered, because a change that fixed one scenario could just as easily break another. It gave us a repeatable way to judge every improvement before deploying it, rather than relying on a few good conversations to tell us the agent was ready.

The real-world test

We launched the agent on the client's existing helpdesk numbers and WhatsApp channel. Today, calls and WhatsApp messages arrive in roughly equal measure, and a substantial share of requests comes in outside regular working hours, exactly when a helpdesk is hardest to staff. The agent now handles almost every conversation end to end, and only a small share still needs a callback from the helpdesk team.

Going live didn't end the testing. It changed how we do it:

  • Production tracing shows us exactly how the agent handled each conversation, where requests weren't completed, and why.
  • The evaluation suite tests every improvement before it ships, and new scenarios join it as we come across them.

The suite catches regressions before release; live conversations show us what we haven't accounted for yet. Both are now part of how we build the agent.

Next up: Fewer callbacks and more complex helpdesk requests

Two things are on our list now:

  • Fewer callbacks. We're going after the conversations that still need a human callback. Some requests are harder to complete than others, and now that the agent is live, we have real conversations to study instead of relying only on the scenarios we anticipated during development.
  • More portfolios. The bigger challenge is taking what we've built into other FM portfolios, each with its own property structure, helpdesk procedures and escalation rules. We want configuring those differences to be easy, without rebuilding the workflows every time.

One last thing

Looking back, choosing the model was probably one of the simpler decisions we made. Most of our time went into the less glamorous work around it:

  • Getting the agent onto existing phone lines
  • Shaving off response delays
  • Untangling helpdesk rules
  • Dealing with property names that speech-to-text couldn't reliably recognize
  • Testing what happened every time we changed something

None of that is visible to the tenants on the other end. They simply get the help they asked for. And if I had to tell another engineer starting a similar project one thing, it would be this: don't spend all your time obsessing over which model to use.

You'll have plenty of other problems to solve once it starts answering the phone.

Written by Kamal, with the Facilio engineering team.

More from Facilio