June 20, 2025
min read

CrewAI Financial Agent with FloTorch

Authors
Ravi teja
Senior Software Engineer

๐Ÿง  Automate Your Finances with AI Agents: A Deep Dive into crewai-finagent

Managing personal finances shouldnโ€™t feel like a full-time job. But sifting through bank statements, categorizing expenses, and identifying trends can be time-consuming and overwhelming.

What if AI could do all of that for you?

Meet crewai-finagent โ€” an application that uses a team of AI agents to turn your PDF bank statements into structured data, categorized expenses, and actionable financial insights. Upload your PDF and watch the agents go to work.

๐Ÿ“ฝ๏ธ Watch it in action:
Check out the demo video below to see how crewai-finagent simplifies personal finance management.

In this post, weโ€™ll walk through how it works, how to get started, and where it fits in the future of AI-powered personal finance.

๐Ÿš€ What is crewai-finagent?

crewai-finagent is an AI-powered application developed using FloTorch, a modern agent orchestration and experimentation framework. It leverages the CrewAI ecosystem to build multi-agent LLM workflows where specialized agents collaborate to complete a task.

In this case, the goal is simple but powerful: take a financial PDF, and turn it into structured, categorized, and insightful data โ€” automatically.

In this project, three AI agents work together in sequence.

  1. Extract raw transactions from a PDF.
  2. Categorize those transactions by type (e.g., groceries, rent).
  3. Analyze the data to produce a summary of your financial habits.

All of this happens without any manual tagging, spreadsheets, or categorization rules โ€” itโ€™s AI-powered from start to finish.

๐Ÿ›  Installation & Setup

Hereโ€™s how to get started:

โœ… Requirements

  • Python 3.10+
  • FloTorch Base URL andย  API key
1. Clone the repository
	# Run this in your terminal
	# git clone https://github.com/FissionAI/flotorch-labs.git
	# cd finance/crewai-finance-agents/

2. Create and activate a virtual environment
	# python -m venv venv
    # source venv/bin/activate (For Linux/macOS)
    # venv\Scripts\activate(For Windows)

3. Install dependencies
	# pip install -rsrc/financial_document_analyzer/requirements.txt                                                                        
4. Set up environment variables
	(For Linux/macOS)
      # export OPENAI_BASE_URL=https://<gateway-url>/api/openai/v1
      # export OPENAI_API_KEY=<secret-key>
	(For Windows)
      # set OPENAI_BASE_URL=https://<gateway-url>/api/openai/v1
      # set OPENAI_API_KEY=<secret-key>
    (or create .env file with)
      # OPENAI_BASE_URL=https://<gateway-url>/api/openai/v1
      # OPENAI_API_KEY=<secret-key>
      
5. Run App
   # python -m streamlit run src/financial_document_analyzer/streamlit_app/app.py

Youโ€™ll be prompted to upload a financial PDF โ€” for example, a bank or credit card statement.

๐Ÿงฉ Architecture Breakdown

crewai-finagent uses a sequential agent pipeline โ€” each agent completes a specific sub-task before handing its output to the next.

๐Ÿ‘จโ€๐Ÿ’ผ 1. Transaction Extractor

๐Ÿง  Role: Transaction Data Extraction Specialist
๐ŸŽฏ Goal: Extract structured transaction data from raw text with high accuracy and standardized format
๐Ÿ“œ Backstory:
You're an expert in parsing and structuring financial data. Your specialty is extracting transaction details from various text formats while ensuring data consistency and standardization. You're particularly skilled at handling dates, amounts, and transaction descriptions.

What it does:

  • Parses the uploaded financial PDF.
  • Extracts structured data fields: date, id, amount, type (debit/credit), description
  • Ensures standardized formatting (e.g., YYYY-MM-DD, two-decimal precision for amounts).

Output format:

[
        {
          "date": "<string>",
          "id": "<int>",
          "amount": "<float>",
          "type": "<string>",
          "description": "<string>"
        },
 ]

๐Ÿ—‚ 2. Transaction Categorizer

๐Ÿง  Role: Financial Transaction Categorization Expert

๐ŸŽฏ Goal: Accurately categorize financial transactions into meaningful categories based on transaction descriptions
๐Ÿ“œ Backstory:
You're a financial analyst with deep expertise in transaction categorization. You understand various types of expenses and can intelligently map transactions to appropriate categories based on description patterns and context.

What it does:

  • Analyzes the description field of each transaction.
  • Assigns a logical category (e.g., "Dining", "Utilities", "Shopping", etc.).
  • Appends a category field to the transaction.

โ€
Output example:

[
        {
          "date": "<string>",
          "id": "<int>",
          "amount": "<float>",
          "type": "<string>",
          "description": "<string>",
          "category": "<string>"
        },
 ]

๐Ÿ“Š 3. Financial Analyst

๐Ÿง  Role: Financial Data Analyst
๐ŸŽฏ Goal: Analyze categorized transaction data to provide meaningful insights and spending patterns
๐Ÿ“œ Backstory:
You're a seasoned financial analyst who excels at identifying patterns, trends, and insights from transaction data. Your expertise lies in creating comprehensive financial analysis that helps people understand their spending behavior and make informed decisions.

What it does:

  • Processes categorized transaction data.

  • Generates:
    • ๐Ÿ“Œ Summary statistics
    • ๐Ÿ“… Temporal trends (e.g., monthly spending)
    • โš ๏ธ Outlier detection
    • ๐Ÿท๏ธ Category-level spending breakdowns
    • ๐Ÿ’ก Actionable insights and recommendations

Output format:

{
  "summary_statistics": {
    "total_income": "<float>",
    "total_expenses": "<float>",
    "net_income": "<float>",
    "total_transactions": "<int>",
    "total_credits": "<int>",
    "total_debits": "<int>"
  },
  "temporal_trends": {
    "monthly_spending": [
      {
        "month": "<string>",
        "income": "<float>",
        "expenses": "<float>",
        "balance": "<float>"
      }
    ],
    "unusual_spending_patterns": [
      {
        "description": "<string>"
      }
    ]
  },
  "category_analysis": {
    "spending_distribution": [
      {
        "category": "<string>",
        "amount": "<float>",
        "percentage": "<float>"
      }
    ],
    "top_spending_categories": [
      {
        "category": "<string>",
        "amount": "<float>"
      }
    ]
  },
  "key_insights_and_recommendations": {
    "insights": [
      {
        "description": "<string>"
      }
    ],
    "recommendations": [
      {
        "description": "<string>"
      }
    ]
  }
}

๐ŸŽฏ Demo Flow

Hereโ€™s what using crewai-finagent looks like:

  • The user uploads a bank statement PDF.
  • The system:
    • Extracts all transactions.
    • Categorizes each one intelligently.
    • Analyzes the data for patterns and trends.
  • Final output:
    • Structured JSON
    • Insights
    • Charts for quick visualization

Itโ€™s like having a mini finance team analyze your statement โ€” instantly.

๐ŸŒ Real-World Applications

crewai-finagent is simple, but powerful. Here are some ways it can be used:

๐Ÿง Personal Finance

  • Get monthly overviews of your spending habits.
  • Identify overspending patterns.
  • Track income and net savings automatically.

๐Ÿ’ผ Small Business Bookkeeping

  • Extract and categorize expenses for tax season.
  • Build custom dashboards or reports.
  • Save time and reduce manual entry errors.

๐Ÿ›  Developer Starter Kit

  • Use this as a base to build custom LLM agent systems.
  • Add invoice processing, budgeting tools, or integrations with banking APIs.

๐Ÿ’ฌ Final Thoughts

crewai-finagent is a glimpse into what AI agents can do when combined effectively. It's not just a cool demo โ€” it's a practical tool that makes sense in everyday life.

With just a PDF, you get back insights that might otherwise take hours to compile manually. And the modular design means you can customize or extend it to fit your own needs.

If youโ€™re curious about the future of AI-powered assistants and how LLMs can collaborate on structured tasks โ€” this project is the perfect place to start.

๐Ÿ‘‰ Check out the code on GitHub

โ€

๐ŸŒ Additional Resources

Let's Talk

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Tags
Agentic Workflows
AI Agentic Workflows
AI Agents
AI Experimentation
AI Future Trends
AI Trends 2025
Generative AI

Recent Posts

Getting Started with FloTorch-core: Building Modular RAG Pipelines
Getting Started with FloTorch-core: Building Modular RAG Pipelines
FloTorch-core is a modular and extensible Python framework designed for building LLM-powered Retrieval-Augmented Generation (RAG) pipelines. It offers plug-and-play components for embeddings, chunking, retrieval, gateway-based LLM calls, and RAG evaluation.
Transforming Business Processes with AI Agentic Workflows
Transforming Business Processes with AI Agentic Workflows
RAG Benchmarking of Amazon Nova and GPT-4o models
RAG Benchmarking of Amazon Nova and GPT-4o models
We used FloTorch Enterprise software to compare Amazon Nova models vs OpenAI GPT-4o models using the Comprehensive Retrieval Augmented Generation (CRAG) benchmark dataset.