Expense Tracker Agent

Agent Description:

The Expense Tracker Agent is built to automate personal and organizational expense management workflows by extracting, classifying, and analyzing financial data from uploaded PDFs. It ensures high-fidelity structuring of expense records while generating actionable financial insights such as spending habits, recurring patterns, and cost-saving opportunities. This agent supports both technical data processing and end-user financial awareness through layered sub-agent analysis.

Purpose and Components
  • Purpose: To help users track, classify, and analyze their expenses using structured data extraction from financial documents, enabling personalized insights and behavior recommendations.
  • Components:
    • A data extractor sub-agent to parse expense PDFs into structured, labeled formats.
    • An expense classification sub-agent to generate insights and trend analyses.
    • Visualization-ready data output to support dashboards and summaries.
Supported Capabilities
  • Extraction of raw expense data from unstructured PDFs into structured JSON.
  • Automatic tagging of expense records based on frequency, value, and merchant recurrence.
  • Classification and grouping of expenses by category, payment method, and frequency.
  • Behavioral trend detection (e.g., frequent dining out, heavy subscriptions).
  • Generation of bullet-style actionable insights and data summaries.
  • Visual-ready formatting: category breakdowns, merchant rankings, spending summaries.
LLM Used
  • Google Vertex
    Note: To learn more about the LLM and to modify its behavior, refer to the Configuring LLM settings section.

Sub-Agents

1. Expense Data Extractor

  • Role:Data Extractor.
  • Scope:Extracts the entire content of the uploaded expense PDF and organizes all data tables into clean, labeled formats without performing analytics.
  • Description: This sub-agent parses uploaded PDFs to extract tables and transactional data, then tags each transaction using logic like:
    • High-frequency (3+ times/week)

    • High-value (> ₹2000)

    • Frequent merchants (e.g., > 5 transactions)

    • Annotates each entry with relevant tags like [frequent, high-value, recurring]

    • Ensures full data integrity, preserving fields such as UserID, CategoryID, Amount, Date, and payment details.

    • Outputs annotated data in structured JSON or tabular format, suitable for further analysis.

  • LLM Used: Google Vertex (inherits from parent).
  • Tools used: MCP Client Tool

2. Expense Classifier

  • Role:Expense Classifier.
  • Scope:Analyzes structured JSON from the Expense Data Extractor to identify trends, suggest spending habits, and summarize expenditure patterns.
  • Description: This sub-agent consumes the structured output and:
    • Tags and clusters expenses by category, frequency, and payment method.

    • Highlights spending trends like:

      • You dine out 4 times/week

      • 40% of your monthly spending is on subscriptions

      • Cash payments are used only for transportation

    • Summarizes data into:
      • Total spend per category (table)

      • Pie chart–style structure showing percent allocation

      • Top 3 merchants by spending

    • Provides a markdown-based bullet list of actionable recommendations

    • Consolidates recurring subscriptions

  • LLM Used: Google Vertex (inherits from parent).
Tools Used:
  • MCP Client Tool – For parsing PDF content and structuring data into machine-readable formats.
Note: For details on modifying the Tools, refer Tools Library section.
Agent Workflow Behavior Summary
  • User uploads an expense management PDF.
  • The Expense Data Extractor parses the document and organizes it into labeled JSON or tabular data, preserving key attributes like dates, categories, transaction IDs, and amounts. It applies tagging logic (e.g., frequent, high-value, recurring) to each transaction.
  • The structured dataset is passed to the Expense Classifier sub-agent.
  • The Expense Classifier analyzes spending patterns, categorizes expenses by type, frequency, and payment method, and generates:
    • Summary tables and pie chart–style structures.
    • Top 3 merchants by spending.
    • Bullet-point markdown insights highlighting behaviors and recommendations.
  • The final output serves both as an analytical report and as a user-friendly overview of spending habits and opportunities for optimization.
Sample Questions:
  • What are the top 5 most expensive items I have recorded in the last 3 months?
  • Give me a breakdown of my spending habits