Skip to main content
AI Agent Tutorial: Concepts to Architecture

Vertical Use Cases: Where Agents Are Used Today

Real-world applications of agents across industries. Concrete examples from customer support, software engineering, research, and finance showing how agents solve specific problems.

Beginner18 minBy ToolDix Editorial

Learning objectives

  • Understand how agents are deployed in real-world scenarios across different industries
  • Map your own problem to successful patterns: recognizing when an agent is the right choice

ToolDix original visual

AI Agent Tutorial practice loop
1

Frame

Name the outcome and constraints.

2

Build

Try one bounded workflow.

3

Review

Keep evidence, revise, and share.

Customer Support and Triage

ToolDix original diagram
The same loop, four different jobs
IndustryExample agentPrimary tools
Customer support
Triage & resolve agentHelpdesk API, knowledge base search
Sales / RevOps
Lead research & outreach agentCRM, email, web search
Engineering
Coding agentRepo access, test runner, CI logs
Finance / ops
Reconciliation agentERP export, spreadsheet tools, approval queue
Different industries, but the same perceive -> plan -> act -> observe loop underneath -- what changes is which tools it calls and how much autonomy it is given.

The problem: Support teams receive thousands of tickets daily. Manual triage wastes time; many issues are repetitive.

How agents help:

A support agent reads incoming tickets and automatically categorizes them:

  • Urgent bugs → escalate to engineering.
  • Billing questions → route to billing team.
  • Feature requests → add to product feedback queue.
  • Common questions → respond with template answer.

Example workflow:

class SupportTriageAgent:
    """Automatically route support tickets."""

    def __init__(self):
        self.tools = {
            "get_ticket": self.fetch_ticket,
            "search_knowledge_base": self.search_kb,
            "create_response": self.draft_response,
            "escalate": self.escalate_to_human,
        }

    def process_ticket(self, ticket_id: str) -> dict:
        """Triage one ticket."""
        ticket = self.get_ticket(ticket_id)

        # Ask the model to analyze and decide
        decision = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=512,
            system="""You are a support triage agent. Analyze the ticket and decide:
1. Is this a known issue? Search the knowledge base.
2. Can you resolve it with a template response?
3. Does it need human attention?

Respond with JSON: {"category": "resolve|escalate", "reason": "...", "action": "..."}""",
            messages=[{"role": "user", "content": f"Ticket {ticket_id}: {ticket['content']}"}]
        )

        decision = json.loads(decision.content[0].text)

        if decision["category"] == "resolve":
            # Send automated response
            response = self.search_kb(ticket['content'])
            self.create_response(ticket_id, response)
            return {"status": "resolved_automatically"}
        else:
            # Mark for human review
            self.escalate_to_human(ticket_id, decision["reason"])
            return {"status": "escalated", "reason": decision["reason"]}

Real-world impact (illustrative estimate):

  • Manual triage: 5–10 minutes per ticket.
  • Agent triage: 30 seconds per ticket, with ~40% resolved automatically.
  • Time saved: ~2–3 hours per 100 tickets.

Software Engineering: Code Review and Debugging

The problem: Code reviews are bottlenecks. Senior engineers spend hours reviewing junior developers' code. Debugging is time-consuming, especially in unfamiliar codebases.

How agents help:

An agent reads pull requests and provides feedback: style issues, potential bugs, performance problems, test gaps. Or an agent reads error logs and suggests fixes.

Example workflow:

class CodeReviewAgent:
    """Automated code review with suggestions."""

    def review_pull_request(self, pr_content: str, repo_context: str) -> dict:
        """Review code changes and provide feedback."""

        review_prompt = f"""
You are a code reviewer. Analyze this pull request:

Repository context (recent changes):
{repo_context}

Pull request changes:
{pr_content}

Provide feedback on:
1. Code style and consistency
2. Potential bugs or edge cases
3. Performance concerns
4. Test coverage

Format as JSON with fields: ["issues": [{"severity": "critical|warning|info", "line": number, "suggestion": string}], "overall": "approve|request_changes|comment"]
"""
        review = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=1024,
            messages=[{"role": "user", "content": review_prompt}]
        )

        return json.loads(review.content[0].text)

    def debug_error_log(self, error_log: str, source_code: str) -> str:
        """Suggest fixes for an error in logs."""

        debug_prompt = f"""
Error encountered:
{error_log}

Relevant source code:
{source_code}

What caused this error? Suggest a fix."""

        response = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=512,
            messages=[{"role": "user", "content": debug_prompt}]
        )

        return response.content[0].text

Real-world impact:

  • Code review time reduced by 30–50%.
  • Catches common issues (null checks, off-by-one errors, missing tests).
  • Frees senior engineers for architecture and design discussions.

Research and Data Analysis

The problem: Researchers need to analyze large datasets, but manual exploration is tedious. Literature reviews require reading hundreds of papers.

How agents help:

An agent reads data, runs analyses, and writes summaries. Or it searches a paper database, extracts key findings, and synthesizes results.

Example workflow:

class ResearchAgent:
    """Analyze datasets and papers."""

    def analyze_dataset(self, file_path: str, research_question: str) -> str:
        """Load data, run analyses, return findings."""

        # Load data
        df = pd.read_csv(file_path)

        # Ask agent what analyses to run
        analysis_prompt = f"""
I have a dataset with {len(df)} rows and columns: {list(df.columns)}.
Research question: {research_question}

What statistical tests or visualizations should I run?
List 3–5 analyses."""

        suggestions = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=256,
            messages=[{"role": "user", "content": analysis_prompt}]
        )

        # Execute suggested analyses (simplified)
        analyses = []
        for analysis_type in ["correlation", "summary_stats", "hypothesis_test"]:
            if analysis_type == "correlation":
                corr = df.corr().to_string()
                analyses.append(f"Correlations:\n{corr}")
            elif analysis_type == "summary_stats":
                stats = df.describe().to_string()
                analyses.append(f"Summary statistics:\n{stats}")

        # Synthesize findings
        synthesis_prompt = f"""
Analyses:
{chr(10).join(analyses)}

Research question: {research_question}

Write a 2–3 sentence summary of key findings."""

        summary = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=256,
            messages=[{"role": "user", "content": synthesis_prompt}]
        )

        return summary.content[0].text

    def literature_review(self, topic: str, num_papers: int = 10) -> dict:
        """Search papers, extract key findings."""

        # Search for papers (calls a real API)
        papers = search_arxiv(topic, limit=num_papers)

        findings = {}
        for paper in papers:
            # Extract key findings from abstract
            extract_prompt = f"""
Paper: {paper['title']}
Abstract: {paper['abstract']}

Summarize in 1–2 sentences: What is the main contribution?"""

            summary = model.messages.create(
                model="claude-3-5-sonnet-20241022",
                max_tokens=100,
                messages=[{"role": "user", "content": extract_prompt}]
            )

            findings[paper['title']] = summary.content[0].text

        return findings

Real-world impact:

  • Literature review time: from weeks to hours.
  • Data exploration: from days to minutes.
  • Researchers can focus on interpretation and novel hypotheses instead of manual grunt work.

Finance and Operations

The problem: Financial teams spend hours reconciling accounts, tracking invoices, and answering status questions. Operational teams manually check inventory, orders, and compliance.

How agents help:

An agent reads financial records and reconciles discrepancies. Or it checks inventory levels, flags low stock, and triggers reorders. Or it verifies that operations meet compliance rules.

Example workflow:

class FinanceAgent:
    """Automate financial operations."""

    def reconcile_accounts(self, account_a: dict, account_b: dict) -> dict:
        """Compare two sets of records and flag discrepancies."""

        reconciliation_prompt = f"""
Account A transactions:
{json.dumps(account_a, indent=2)}

Account B transactions:
{json.dumps(account_b, indent=2)}

Find transactions that appear in one but not the other.
For each discrepancy, suggest whether it's an error or timing difference."""

        analysis = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=512,
            messages=[{"role": "user", "content": reconciliation_prompt}]
        )

        return json.loads(analysis.content[0].text)

    def check_compliance(self, transactions: list[dict], rules: list[str]) -> dict:
        """Check if transactions violate compliance rules."""

        compliance_prompt = f"""
Compliance rules:
{chr(10).join(rules)}

Transactions:
{json.dumps(transactions, indent=2)}

Which transactions (if any) violate these rules? Flag each violation with severity."""

        violations = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=256,
            messages=[{"role": "user", "content": compliance_prompt}]
        )

        return json.loads(violations.content[0].text)

    def manage_inventory(self, inventory: dict, thresholds: dict) -> list[str]:
        """Check stock levels and recommend reorders."""

        reorder_prompt = f"""
Current inventory:
{json.dumps(inventory, indent=2)}

Reorder thresholds (min stock):
{json.dumps(thresholds, indent=2)}

Which items should be reordered? Recommend quantities."""

        recommendations = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=256,
            messages=[{"role": "user", "content": reorder_prompt}]
        )

        return recommendations.content[0].text.split('\n')

Real-world impact:

  • Invoice processing: from days to minutes.
  • Compliance checks: automated, reducing audit risk.
  • Inventory management: proactive reorders, fewer stockouts.

The problem: Healthcare providers and law firms need to process structured but complex documents — patient records, legal contracts, medical coding, compliance reports. Manual review is slow and error-prone.

How agents help:

A healthcare agent reads patient intake forms and medical histories, then suggests diagnoses (for physician review) or flags drug interactions. A legal agent reads contracts and identifies missing clauses, unfavorable terms, or compliance gaps.

Example workflow:

class HealthcareDocumentAgent:
    """Process medical documents and flag concerns."""

    def analyze_patient_intake(self, intake_form: dict, medical_history: list[str]) -> dict:
        """Analyze intake and suggest next steps."""

        analysis_prompt = f"""
You are a medical assistant reviewing patient intake.

Patient information:
{json.dumps(intake_form, indent=2)}

Medical history:
{chr(10).join(medical_history)}

Task:
1. Summarize chief complaint and key symptoms
2. Identify potential drug interactions (check current medications)
3. Flag any red flags (e.g., signs of serious illness that need urgent care)
4. Suggest what specialists or tests might be needed

Format as JSON with fields: ["summary", "interactions", "red_flags", "recommendations"]
"""

        analysis = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=1024,
            messages=[{"role": "user", "content": analysis_prompt}]
        )

        return json.loads(analysis.content[0].text)

    def extract_icd_codes(self, clinical_note: str) -> list[dict]:
        """Extract ICD-10 codes from clinical notes (for billing)."""

        coding_prompt = f"""
Clinical note:
{clinical_note}

Extract all medical conditions, procedures, and diagnoses mentioned.
For each, suggest an ICD-10 code (or list of codes if multiple are plausible).

Format as JSON: ["codes": [{"description": string, "icd10": string, "confidence": "high|medium|low"}]]

Note: This is a suggestion for human review; do not rely solely on this for billing.
"""

        response = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=512,
            messages=[{"role": "user", "content": coding_prompt}]
        )

        return json.loads(response.content[0].text)

Real-world impact (illustrative estimates):

  • Document review time: from 30 minutes to 5 minutes per document.
  • Medical coding accuracy: 85–90% (improves with human review).
  • Reduces liability: Flag-based alerts prevent missed drug interactions.

Critical caveat: Healthcare agents are never autonomous. They are decision support — a physician or nurse reviews every recommendation. Over-relying on agent output creates liability. Always require human sign-off on clinical decisions.


HR and Recruitment: Workflow automation

The problem: HR teams receive hundreds of job applications and spend hours on initial screening. Employee onboarding involves dozens of administrative steps.

How agents help:

A recruitment agent reads resumes and application materials, scores candidates against job criteria, and flags top prospects. An onboarding agent generates offer letters, prepares equipment requests, schedules training, and sends new-hire checklists.

Example workflow:

class RecruitmentAgent:
    """Screen resumes and rank candidates."""

    def score_candidate(self, resume: str, job_description: str, evaluation_rubric: dict) -> dict:
        """Score candidate against job criteria."""

        scoring_prompt = f"""
Job description:
{job_description}

Evaluation rubric (score 1-10 for each):
{json.dumps(evaluation_rubric, indent=2)}

Candidate resume:
{resume}

For each criterion in the rubric, score the candidate 1-10 and explain briefly.
Provide an overall recommendation: "strong_match" | "possible_match" | "not_a_fit"

Format as JSON with fields: ["criterion_scores", "notes_per_criterion", "overall_score", "recommendation"]
"""

        scoring = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=1024,
            messages=[{"role": "user", "content": scoring_prompt}]
        )

        return json.loads(scoring.content[0].text)

    def generate_offer_letter(self, candidate: dict, role_details: dict) -> str:
        """Generate personalized offer letter."""

        letter_prompt = f"""
Generate a professional offer letter for:

Candidate:
{json.dumps(candidate, indent=2)}

Role and terms:
{json.dumps(role_details, indent=2)}

Include:
1. Position title and start date
2. Compensation (salary, equity, bonus)
3. Benefits summary
4. Reporting line
5. At-will employment clause
6. Signature line for HR

Make it warm and professional, not boilerplate."""

        letter = model.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=1024,
            messages=[{"role": "user", "content": letter_prompt}]
        )

        return letter.content[0].text

Real-world impact (illustrative):

  • Resume screening: from 10–20 hours/week to 1–2 hours/week (agent prequalifies, human makes final calls).
  • Onboarding time: from 3 days of admin work to <4 hours.
  • Consistency: All candidates evaluated against same rubric; reduces bias.

Edge case: Bias in resume screening. An HR agent trained on historical hiring data may replicate or amplify existing biases (e.g., favoring candidates from certain schools or genders). Mitigation:

  • Regularly audit agent scores against protected characteristics (age, gender, race).
  • Use blind resume screening: remove names and schools; let agent score on skills only.
  • Have human HR review all agent recommendations before decisions are final.

Comparison table: Agent readiness by industry

Here's a quick reference for whether your industry is ready for agent automation:

| Industry | Data Availability | Tolerance for Error | Tool Integration Complexity | Agent Readiness | |----------|-------------------|----------------------|---------------------------|-----------------| | Customer Support | High (ticketing systems) | Medium (can escalate) | Low (KB search, email) | Ready now | | Code Review | High (GitHub, repos) | Low (bugs costly) | Medium (API, integrations) | Ready now (recommend features) | | Research/Data Analysis | High (datasets, papers) | Medium (exploratory) | Medium (analysis tools) | Ready now (with human review) | | Finance | High (structured records) | Very low (errors = liability) | High (banking APIs, compliance) | Ready (under strict controls) | | Healthcare | High (EHR systems) | Very low (patient safety) | High (medical systems, FDA compliance) | Limited (decision support only) | | HR/Recruitment | Medium (resumes, job specs) | Medium (hire wrong person) | Low (email, document gen) | Ready now (human review required) | | Legal | High (contracts, case law) | Very low (liability) | High (legal databases, case systems) | Limited (research assistance, not advice) |

Key takeaway: Agents excel in "suggest and review" workflows. Avoid autonomous agents in high-stakes domains (healthcare, finance, legal) without human review loops.


When agents are NOT the right choice

Agents are powerful but not always necessary. Recognize when simpler approaches are better:

Classification without reasoning

Problem: "Classify this email as spam or not spam." Better approach: Trained classifier (faster, cheaper). Agent only if: Classification depends on context the model needs to understand (e.g., "is this a scam targeting this specific company?").

Simple lookups

Problem: "What's the balance in account 12345?" Better approach: Direct database query (faster, deterministic). Agent only if: The lookup requires multi-step reasoning ("what's the balance after pending transactions?").

Deterministic transformations

Problem: "Convert this CSV to JSON." Better approach: Script or ETL tool (faster, error-free). Agent only if: The schema varies and needs interpretation.

Use agents when:

  • Reasoning is needed: The task requires comparing options, making decisions, or adapting based on outcomes.
  • Multi-step tools: The task involves multiple API calls or tools that interact.
  • Ambiguity exists: The task requires judgment or handling edge cases.
  • Learning is valuable: Observing agent behavior teaches you about your domain.

Edge case: The "agent hammer looking for nails" fallacy

Once you've built an agent system, there's a temptation to apply it everywhere. A large tech company built a general-purpose agent for customer support and saw great ROI (50% of tickets auto-resolved). They then tried to apply agents to:

  1. Password reset requests — A simple database query would be faster and deterministic. But they routed it through the agent anyway, adding 3-second latency.
  2. Billing inquiries requiring payment — Agent generated correct invoice info but couldn't process payments (still needed manual intervention). 0% time saved; 100% added latency.
  3. Complex technical troubleshooting — Agent lacked domain expertise; escalation rate was 80%. Better to invest in better documentation or expert escalation paths.

Lesson: Just because you have an agent doesn't mean every task should go through it. Measure the true impact (time saved - added latency × number of tasks). Only deploy agents where ROI is demonstrably positive.


Common mistake

Treating every automation opportunity as an agent opportunity. Agents add latency and cost. For simple, deterministic tasks, traditional software is better. Reserve agents for high-value, reasoning-intensive tasks where the flexibility justifies the cost. Start by automating with agents only 20% of your workflows (the hardest 20%); for the remaining 80%, simpler automation often works fine.

Sources and license context

These references informed the lesson. ToolDix adds its own explanation, workflow, and practice rather than reproducing source material. Every link below leaves ToolDix and opens the publisher's own site in a new tab.

Keep going

Read these next on ToolDix.

Original lessons that build on what you just read.