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:

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 data/finance_coach.sql, a sample dataset built from the Kaggle Personal Finance dataset that covers January 2018 through September 2019. You can also use your own transaction data.

Setup

Clone the repository:
Install dependencies:
Load the sample dataset into your PostgreSQL database:
In Snow Leopard Cloud, add the database as a data source to your instance. Then create an API key on the Keys tab and copy the instance ID from the Connection Info tab. Create a .env file:
Run the agent:

Example queries

The sample data covers January 2018 through September 2019, so ask about those months rather than “this month”.
  • “Show me my spending by category”
  • “Which merchants did I spend the most at?”
  • “Compare March 2019 vs February 2019”
  • “How much did I spend on groceries?”

Next steps