Skip to main content
Apragya AI
Docs · Best Practices

When agents are the right answer (and when they're not)

Good fits, bad fits, and the hybrid pattern that works best. The four questions to ask before reaching for an agent.

Apragya AI's principle P2 is "AI is the differentiator - every feature must include an agent". That doesn't mean every micro-decision in your business logic needs an LLM call. Agents shine on specific shapes of problem; on the wrong shape, a deterministic rule is faster, cheaper, and more reliable. This guide is the framework we use to decide.

Good fits for an agent

  • Ambiguous, partially-structured inputs - free-text email bodies, scanned documents, voice transcripts, attached PDFs
  • Multi-step reasoning - chains of decisions where each depends on the last, where you'd otherwise write deep nested IF/ELSEs
  • Language understanding + generation - drafting replies, summarising long content, translating, intent classification
  • Loosely-structured pattern matching - "does this contract clause look like our standard template?" - where the answer is similarity, not equality
  • Workflows where you'd otherwise need 10 different rules to cover 90% of cases - a well-prompted agent covers 95% with one definition

Bad fits for an agent

  • Deterministic logic with no judgement - tax calculation, GST application, ledger postings, currency conversion. Use a rule node
  • Exact-match operations - lookup-by-ID, eq-match-by-string, set-membership. Use db_query
  • Sub-second latency requirements - even the fastest agent run is 800ms+ on a warm path. If you need <100ms, it's not an agent's job
  • Highly regulated outputs that must be exactly verifiable - financial calculations posted to audit trail. The agent's reasoning is hard to audit; a rule's logic is in source code
  • High-volume / low-value calls - millions of decisions per day, each tiny in impact. Use rules; reserve agent capacity for the high-value ones

The hybrid pattern: rules first, agent for the hard cases

Most of our highest-performing tenant pipelines use a hybrid: a cheap rule node at the top handles the 80% of obvious cases instantly, escalating only the ambiguous 20% to an agent. Invoice matching is the canonical example - exact PO/qty/amount match goes through as a rule (cost: ~0 AI Credits); fuzzy or partial matches go to the agent (cost: ~3 AI Credits). Same outcome, 5-10x cheaper at scale.

Four questions to ask before reaching for an agent

  • 1. Could I write a rule that handles 80% of cases? If yes, do that AND use the agent only for the rest
  • 2. Is the decision auditable from the agent's output alone? If no, you'll need extra observability investment
  • 3. What's the cost ceiling? Multiply expected per-call cost by expected volume. If the result is uncomfortable, model selection is your first lever
  • 4. What happens when the agent is wrong? If "a human catches it before harm", great. If "the wrong invoice posts to the GL", reach for guardrails + HITL
The mistake to avoid is using agents because agents are exciting - the platform's principle P2 says every feature INCLUDES an agent, not every decision IS an agent. Build with the rules + agent hybrid in mind from the start; the agent-where-rules-suffice rewrite is a painful one.

Need help building this? Talk to a real engineer

← All docs
Ask Vippy anything