CrewAI Financial Agent with FloTorch

๐ง 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.
- Extract raw transactions from a PDF.
- Categorize those transactions by type (e.g., groceries, rent).
- 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
- ๐ Summary statistics
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
- FloTorch: flotorch.ai
- GitHub Repository: FissionAI/flotorch-labsโ
- FloTorch Gateway Docs:Flotoch Gateway Docs
Let's Talk
Recent Posts
%20(11).png)