Skip to main content
A CLI agent that analyzes personal spending data and provides AI-powered financial coaching. Built with LangGraph for multi-step workflows.

What it does

This agent acts as a personal financial coach through a command-line interface. Users can:
  • Ask questions about their spending in natural language
  • Get breakdowns by category, merchant, or time period
  • Receive personalized recommendations and savings opportunities
  • Have multi-turn conversations with conversation memory
Example interaction:
You: Show me my spending by category

╔══════════════════════════════════════════════════════════╗
║           💡 FINANCIAL COACHING INSIGHTS                 ║
╚══════════════════════════════════════════════════════════╝

📊 YOUR SPENDING ANALYSIS
──────────────────────────────────────────────────────────────
  💰 Real Monthly Spending: $2,543.22
  🔴 Highest Expense: Rent @ $1,200.00 (47.2% of total)
  💡 Found 3 optimization opportunities totaling $425/month

💡 RECOMMENDATIONS FOR YOU
──────────────────────────────────────────────────────────────
  1. Your Rent is your largest expense (47.2%). This should be priority #1.
  2. Meal prep 2x/week could save $127/month (Highest impact)

Architecture

The agent uses a 4-node LangGraph workflow:
  1. Enrich query - Adds context about time period, categories, and merchants
  2. Query Snow Leopard - Converts natural language to SQL and retrieves data
  3. Analyze and coach - Generates insights, recommendations, and follow-up questions
  4. Format response - Creates formatted CLI output with Rich

Key components

  • LangGraph orchestrates the multi-step workflow
  • Snow Leopard handles natural language to SQL conversion
  • Coaching analyzer generates personalized financial insights
  • Memory manager maintains conversation context across turns
  • Rich CLI provides formatted terminal output

Run the example

Prerequisites

The example includes a script to generate sample financial data, or you can use your own SQLite database with transaction data.

Setup

Clone the repository:
git clone https://github.com/SnowLeopard-AI/snowy-examples.git
cd snowy-examples/agent_examples/financial_coach_langchain
Install dependencies:
pip install -r requirements.txt
Generate sample data (optional):
python data/create_sample_data.py
Create a .env file:
OPENAI_API_KEY=your-openai-key
SNOWLEOPARD_API_KEY=your-snowleopard-key
SNOWLEOPARD_DATAFILE_ID=your-datafile-id
Run the agent:
python main.py

Example queries

  • “Show me my spending by category”
  • “Which merchants did I spend the most at?”
  • “Compare this month vs last month”
  • “How much did I spend on groceries?”

Next steps