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
Architecture
The agent uses a 4-node LangGraph workflow:- Enrich query - Adds context about time period, categories, and merchants
- Query Snow Leopard - Converts natural language to SQL and retrieves data
- Analyze and coach - Generates insights, recommendations, and follow-up questions
- 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
- Python 3.10+
- OpenAI API key
- Snow Leopard API key
- A datafile uploaded to Snow Leopard Playground
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:.env file:
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
- View the full source code on GitHub
- Learn more about LangGraph
- Explore the LangGraph quickstart