How I build reliable AI agents — Moiz Ali, AI agent engineer
I'm Moiz Ali, an AI agent engineer. Here's how I build reliable AI agents: verification in code, fault tests, traces, cost per task, and a human in the loop.
I'm Moiz Ali, an AI agent engineer in Tetovo, North Macedonia. People often ask how to make an agent that does more than look good in a demo. This post is my answer: how I build reliable AI agents, and what I actually check before I trust one with real work.
A reliable agent is not a model with a longer prompt. It is a small program with a job, a short list of tools, and code that decides what is allowed to stand. The model proposes. Code decides. If you want the shorter tour of the projects themselves, start with Moiz Ali's AI agent portfolio. The longer version of the job is in what an AI agent engineer actually does.
What reliable AI agents need
When I talk about reliable AI agents, I mean five things I can point at in a running system. Evals and verification: can I show that a claim, a booking or a plan is actually allowed? Fault tolerance and retries: if a worker dies mid-task, does the run finish? Observability: can I follow one run from start to finish? Cost per task: do I know what a single job costs, and do I pay for the expensive steps only when they are worth it? And a human in the loop, wherever a mistake would actually matter. I'll go through each one with the numbers I have, and I'll say where I don't have numbers yet.
Evals and verification
The cleanest example is the cold outreach agent. You give it a company website and a person's role. It researches the company and drafts a short email. A fact stays in the draft only if its URL was fetched on that run and its quote appears in the page text. Code — not the model — maps every claim to a fact and decides pass or fail.
I didn't start there. An LLM judge once called a set of facts 92% faithful; reading the same facts myself put it at about 75%. Changing only the judge moved the same 24 facts from 0.92 to 0.67. A model scoring a model is not a verifier. I rebuilt it so the model has to name a quote for each detail, and code derives the verdict. On 10 real leads, 10 of 10 drafts passed that claim verifier.
You can try the live demo on this site. It runs the same pipeline and stops before send. The longer write-up is the case study. The sample is still small: how real sales people rate the emails, and reply rates, are not measured yet.
Verification is not only for emails. Company Autopsy treats website text as untrusted data, puts it in a fenced block, and rejects an answer that doesn't match a strict schema. The report is grounded only in what the company's own pages say. The Balkan AI Receptionist never lets the model write to the database: each of its seven tools has its arguments checked in code first, and double booking is blocked by a Postgres exclusion constraint, not just the prompt. A formal evaluation for the receptionist is still next. I won't pretend I have a finished score for it.
Fault tolerance and retries
Concord is a reliability layer for multi-agent runs: a planner splits a task into subgoals, workers run them from a shared blackboard in Redis, and a supervisor catches stalls, repeated work and off-task output. The failure I cared about most was simple. A worker dies, and the run hangs.
The supervisor requeues the work. In 80 fault-injection scenarios, runs with a dead worker recovered 8 of 8 times with the supervisor, and 0 of 8 without it. Across 10 kill-and-resume trials, no finished subgoal was re-run. All state lives in Redis, so a new process can resume a run without redoing recorded work. Plans are checked in code before they apply, and the supervisor halts a run that goes over its token budget. That is what I mean by retries you can live with: bounded, recorded, and measured under faults.
There isn't a live demo for Concord yet. The case study is the write-up, including the gaps: reworded duplicates are not caught yet, and how often the model reviewer is right is not measured yet.
Observability
If a run fails and I can't see why, I have a black box, not a reliable agent. In Concord, one run is one OpenTelemetry trace, so a lost attempt, the requeue and the retry all show up on the same picture.
The receptionist takes a different path to the same idea. Every turn stores the prompt version, the model, the knowledge-base hash and the tool input and output, so a conversation can be replayed later. The live text demo wraps the same engine in demo-only guardrails, with no real clinic, phone number or persistent data behind it. Company Autopsy streams progress live, so a cold start or a slow site doesn't look like a hang.
Cost per task
Reliable also means I can say what a job costs, and I don't pay for the expensive steps when a cheap check would have stopped the run.
On the outreach agent, a researched lead costs $0.08 to $0.14, and a run takes 34 to 78 seconds from lead to draft. A poor-fit lead is rejected for about $0.0013, before any research is paid for.
Company Autopsy is the other end of that question. On live runs it returns a finished report in 10 to 16 seconds, reads at most four pages, respects robots.txt, and runs at $0 a month on Gemini's free tier and free hosting. When the quota runs out, visitors see a clearly labelled sample report instead of an error. You can run it live or open a sample report.
Concord makes the cost tradeoff visible, and I want to be honest about it. On 19 real research questions, a model judge preferred the team's answer 12 times to 6, at about 2.9× the token cost. That judge is a model, not a person, and the supervisor did nothing on those healthy runs — its value shows under faults. On runs with a duplicate subgoal, it saved 11.2% of the tokens. I don't treat a 2.9× cost as a win by itself. I treat it as a number I have to know.
Keeping a human in the loop
Where a mistake would cost someone a client, a booking or a medical handoff, a person or a hard rule stays in the way.
The outreach agent does not send. A person has to approve a real email. An opt-out in a reply is caught by plain code, even if the model is down, and an email is claimed in one conditional update before sending, so it goes out at most once. The public demo, again, stops before send.
On the Balkan AI Receptionist, handoff triggers are code rules, not the model's self-confidence. A medical emergency, an angry caller, two failed tool validations in a row, or a knowledge-base miss asked twice all go straight to a human, and that check runs before the model is even asked. FAQ answers come only from the clinic's own knowledge base; a missing topic becomes a message for the owner, not a guess. Every conversation opens by stating it's an AI assistant and that the conversation may be recorded, in Macedonian, Albanian, Serbian or English.
This one is still being built. Phase 2 is shipped, against a fictional demo clinic. Voice, an admin UI and a formal evaluation are next.
GeoLumen is a smaller case of not trusting a raw URL: free tools that check a site's robots.txt against real AI crawlers under RFC 9309, and generate and validate an llms.txt file, behind a fetch that blocks private IPs on every redirect. You can try it live.
Moiz Ali, AI agent engineer: how I start
I'm Moiz Ali. As an AI agent engineer, I start with the job as it is done today, then a working pipeline on real inputs, measured: what it costs, how long it takes, and how often it is right. A person stays in the loop wherever a mistake would matter, and runs are logged so you can see what the agent did.
That is the whole method. Evals and verification so a fact, a plan or a booking has to pass code. Fault tolerance so a dead worker is a recovered run, not a hung one. Observability so I can point at a trace or a replay. Cost per task so I know what I'm paying. And a human in the loop when the cost of being wrong is not theoretical.
If you want this kind of system built around a repetitive job on your team, download my resume or use the contact form. Tell me what the job looks like today. I'm open to full-time remote roles in Europe. That's always where I start.