An AI agent shouldn’t blindly repeat an action just because it failed.
Imagine an agent submitting a payment.
The request times out, but the payment may have already gone through.
If the agent immediately retries, it could charge the user twice.
Before retrying, it needs to understand what happened:
→ Did the action actually fail?
→ Was the result delayed?
→ Did the system complete the action but fail to return confirmation?
→ Is it safe to try again?
This is why error handling needs more than a retry loop.
Verify the outcome first. Retry only when it’s safe.
One thing every AI agent needs is a clear stopping condition.
Imagine an agent trying to fix a software error.
It makes a change, runs the test, and the test still fails.
Should it keep changing code indefinitely?
Not without limits.
A well-designed agent needs three clear boundaries:
→ Success: What result means the task is complete?
→ Failure: When should it stop retrying?
→ Human takeover: When does the task need human judgment or approval?
Also define limits on retries, time, and tool usage.
A capable agent doesn’t just know what to do next. It knows when to stop.
An AI agent can look impressive in a 2-minute demo and still struggle with everyday tasks.
What happens when:
• The API stops responding?
• The input is incomplete?
• A tool returns an unexpected result?
• The same task is repeated 100 times?
A demo shows what an AI system can do once.
A reliable product has to prove it can do it consistently, handle failures, and recover when things go wrong.
The real engineering challenge starts when the demo ends.
@shzhv13 Great addition. If the system can alter the test, it might pass by rewriting the objective. Do you keep tests read-only or store them in a separate repository?
Before splitting a task across multiple AI agents, try something simpler.
Give one agent the task first.
Can it complete the work accurately?
Can it handle errors?
Can you verify its output?
If it can, adding more agents may only introduce extra coordination and cost.
If the task genuinely needs parallel research, independent verification, or specialized expertise, then consider multiple agents.
Start with the simplest architecture that works. Add complexity only when the results justify it.
Two AI agents agreeing with each other doesn’t automatically make an answer reliable.
Imagine asking two agents to explain the same technical claim.
They both give the same answer, but both rely on the same outdated documentation.
You now have agreement, not independent verification.
This is why multi-agent systems need more than multiple opinions.
They need:
• Independent sources of evidence
• Checks against original documentation
• External validation where possible
Agreement can increase confidence, but evidence is what helps establish correctness.