Inspiration

Scam messages, fake KYC requests, lottery scams, fake refunds, OTP phishing, and fraudulent UPI requests are increasingly common. When people receive a suspicious message, they often have only a few moments to decide whether to click a link, share information, or send money.

The problem is that existing approaches are often either too generic or require users to manually search for information. We wanted to build a system that could act as a second opinion in the moment, investigate suspicious messages step by step, and explain its conclusion in language that an ordinary user can understand.

This led us to build Scam Triage Agent.

What is Scam Triage Agent?

Scam Triage Agent is an AI-powered agent designed to investigate suspicious SMS messages, call transcripts, and UPI-related requests.

Instead of making a decision from a fixed list of keywords, the agent dynamically decides what evidence it needs, uses the appropriate investigation tool, evaluates the result, and can request additional information when the evidence is inconclusive.

The final result is presented as a clear, actionable verdict:

  • Block & Report
  • Caution
  • Likely Safe

The agent also provides plain-language reasoning so that users can understand why a message was considered suspicious or potentially safe.

How It Works

The system follows an agentic investigation loop:

Suspicious Message / Call Transcript / UPI Request
                       ↓
                  Observe
                       ↓
             Decide which tool to use
                       ↓
        ┌──────────────┼──────────────┐
        ↓              ↓              ↓
  Pattern Match    Check UPI ID   Check Phone Number
        └──────────────┼──────────────┘
                       ↓
              Evaluate Evidence
                       ↓
             Is evidence sufficient?
                  ↙          ↘
                No            Yes
                ↓              ↓
       Ask for more info     Conclude
                ↓              ↓
          Re-evaluate       Risk Verdict
                               ↓
                 Block & Report / Caution /
                       Likely Safe

The important part is that the tool sequence is not hardcoded. The model decides which tool to call next based on the situation.

Agentic Architecture

The system consists of several components:

1. Agent / Controller

The main reasoning loop is powered by an LLM through Groq's API. It maintains conversation memory and decides how the investigation should proceed.

2. Investigation Tools

The agent has access to:

  • pattern_match
  • check_upi_id
  • check_phone_number
  • request_more_info

The model chooses these tools according to the evidence available.

3. Knowledge Bases

The investigation tools query two JSON-based knowledge bases containing the information required for the checks.

4. Human-in-the-Loop

When the available evidence is insufficient, the agent does not simply guess. It can ask the user a specific clarifying question and use the response for further evaluation.

5. Failure Handling

The system also includes a rule-based fallback agent. If the LLM call fails, for example because of a temporary API or rate-limit issue, the system can fall back to the rule-based approach instead of crashing.

Why an Agentic Approach?

Scam language constantly changes. A static keyword list can become outdated, while scammers can deliberately rephrase familiar patterns.

Different situations also require different investigation paths. One message may contain enough evidence in its text, while another may require checking a phone number or UPI ID.

When the first investigation is inconclusive, the system needs to determine what additional evidence should be gathered rather than simply making a guess.

This is why we designed the system around an observe → decide → act → evaluate → adapt loop.

Technologies Used

  • Python
  • Groq API
  • Large Language Model (LLM)
  • Natural Language Processing
  • Agentic AI / Function Calling
  • JSON-based knowledge bases
  • Rule-based fallback system
  • Web application

Challenges

One of our main challenges was designing the system so that it could handle different types of scam situations without depending entirely on fixed rules.

We also needed to handle uncertainty. A suspicious message may not contain enough information to reach a reliable conclusion. Instead of forcing a decision, we implemented a mechanism where the agent can request additional information and re-evaluate the situation.

Another challenge was reliability. Since the system depends on an LLM API, temporary failures could otherwise make the application unusable. We therefore added a rule-based fallback mechanism so the system can continue operating when the LLM call is unavailable.

What We Learned

Through this project, we learned how to move beyond a simple LLM chatbot and build a system where an AI model can reason about a task, select tools, evaluate tool results, interact with the user, and adapt its investigation.

We also learned that AI systems dealing with potentially harmful situations should communicate uncertainty rather than confidently guessing.

The project helped us explore:

  • LLM-based reasoning
  • Function/tool calling
  • Agentic workflows
  • Retrieval from structured knowledge bases
  • Human-in-the-loop interaction
  • Fallback mechanisms
  • AI application deployment

Impact

Scam Triage Agent is designed to give ordinary users a fast and accessible second opinion before they click a suspicious link, share an OTP, or send money.

It is particularly relevant for people who may be less familiar with digital scam tactics, including elderly users, first-time UPI users, and rural or semi-urban populations.

The broader idea is to demonstrate a reusable investigate → evaluate → adapt pattern that can potentially be extended to other fraud and safety-triage scenarios.

Future Scope

We would like to extend the project with additional investigation capabilities, broader scam databases, and support for more types of digital fraud.

Future versions could also expand the system to handle richer inputs and additional verification sources while maintaining the human-in-the-loop approach.

Try It

Live Demo: https://scam-triage-agent-2.onrender.com/

GitHub: https://github.com/yuvasrirajendiran2006-max/scam-triage-agent

Demo Video: https://youtu.be/qiHqkyxhFh0

Built With

Share this project:

Updates

Submission history