The Real-Time Spending Coach is a conversational financial assistant that reacts instantly to new purchases. It classifies each transaction, learns from user feedback, predicts future spending behavior, and sends timely nudges through iMessage (via Photon).
Instead of dashboards or static reports, the system engages users in natural conversation — creating reflection and awareness in real time.
The system integrates with Knot for transaction data, Dedalus (MCP) for classification agents, Photon for notifications, and Clerk for authentication.
Most personal finance tools notify users only after money is already spent. The user becomes aware of overspending too late. Our solution intervenes at the moment of purchase, engaging the user in a quick, conversational check-in that reinforces healthy spending decisions.
The MVP demonstrates an end-to-end intelligent feedback loop:
- Detect a purchase (via Knot or mock data).
- Classify the purchase as Need or Want using a Dedalus-powered agent.
- Store classification data and user feedback.
- Message the user via Photon iMessage to confirm the classification.
- Receive the user’s reply (Need or Want).
- Update the database with the corrected label.
- Predict when the user might make a similar purchase next.
- Send a preemptive nudge through iMessage if the purchase is likely to recur soon.
- Provide a simple UI (via frontend) showing recent transactions and predictions.
| Component | Responsibility |
|---|---|
| Backend (Flask) | Orchestrates data flow, exposes APIs, handles webhook events, calls agent and prediction modules. |
| Classification Agent (Dedalus/MCP) | Receives item + merchant info, returns structured output {need_or_want, category, confidence, reasoning}. |
| Database (Snowflake or local fallback) | Stores transactions, classifications, user labels, predictions, and history. |
| Notifications (Photon) | Sends and receives iMessage-based interactions with users. |
| Authentication (Clerk) | Manages user sessions and securely links users to transactions. |
| Frontend (Next.js/Vite) | Minimal visualization for summary and demo — lists recent transactions and predictions. |
[User Purchase]
↓
[Knot API → Flask Backend]
↓
[Classification Agent (Dedalus)]
↓
{need_or_want, category, confidence}
↓
[Database: store transaction + classification]
↓
[Photon iMessage: “Was this a NEED or WANT?”]
↓
[User Reply → Photon Webhook → Backend]
↓
[Database: update user label]
↓
[Prediction Engine: estimate next purchase + savings]
↓
[Photon iMessage: “Skipping this saves $X/yr. Want to skip?”]
↓
[Frontend: display summary for demo]
| Endpoint | Method | Description |
|---|---|---|
/events/transaction |
POST | Receives a new purchase event. Calls classification agent and sends user notification. |
/notifications/reply |
POST | Receives user’s reply (Need/Want) and updates database. |
/user/<user_id>/summary |
GET | Returns recent transactions and predictions for demo display. |
users
- id (primary key)
- name
- clerk_id
transactions
- id (primary key)
- user_id
- merchant
- item
- amount
- timestamp
classifications
- transaction_id (foreign key)
- need_or_want
- category
- confidence
- reasoning
user_labels
- transaction_id (foreign key)
- user_label (Need/Want)
- updated_at
predictions
- transaction_id (foreign key)
- next_eta
- probability
- yearly_savings_estimate
- Provides merchant and transaction data.
- Used to trigger the backend
/events/transactionendpoint.
- Classification logic.
- Should be callable via REST or local RPC from backend.
- Returns structured result with reasoning and confidence.
-
Handles sending and receiving iMessages.
-
Used to send two message types:
- Immediate post-purchase reflection (“Need or Want?”)
- Predictive nudge (“You usually buy coffee tomorrow morning…”)
- Manages user auth.
- Provides user identity for message routing and secure linking to Knot data.
Minimal React (or Vite) app showing:
- List of last 5 transactions
- Label (Need/Want)
- Predicted next purchase time
- Savings estimate if skipped
The frontend exists mainly to visualize backend data for judges.
| Area | Deliverable | Owner |
|---|---|---|
| Flask backend setup | Skeleton with 3 endpoints | Tony / Quang |
| Classification agent | Dedalus MCP integration | Tony |
| Database layer | Schema + CRUD stubs | Nguyen |
| Photon integration | Mock + real notification pipeline | Quang |
| Clerk auth | Basic session and user linking | Quang |
| Frontend | Simple summary page | Noctorious |
| Prediction model | Simple rule-based estimation | Tony |
| Integration test | End-to-end mock transaction flow | Team |
- Submit a fake transaction via
curlor mock event. - Backend calls classification agent → returns “Want”.
- User (simulated) receives message via Photon → replies “Need”.
- Database updates classification with user feedback.
- Prediction model runs and identifies likely future purchase.
- System sends a preemptive nudge.
- Frontend page displays full chain and savings estimate.
Total demo length: under 2 minutes.
| Sponsor | Integration | Relevance |
|---|---|---|
| Knot | Transaction ingestion | Demonstrates real-time data flow |
| Dedalus | Classification agent | MCP + AI reasoning |
| Photon | Notification transport | Conversational interface |
| Clerk | Auth | Secure user context |
| Chestnut Forty | Prediction logic | Behavioral AI modeling |
This architecture directly qualifies for multiple special tracks (Knot, Dedalus, Photon, Chestnut Forty) and fits the Business & Enterprise main track.
- Build for reliability and demonstration clarity, not complexity.
- Prioritize end-to-end loop over feature depth.
- Ensure every module produces visible output in logs or messages.
- Design for “wow” in under 120 seconds: instant feedback, user interaction, prediction.
- Emotional state tracking and progress visualization.
- Richer category detection and multi-agent classification.
- Personal financial goals and savings tracking.
- Personalized tone adaptation in messages.
- Integration with multiple messaging platforms (Slack, WhatsApp).
| Layer | Technology |
|---|---|
| Backend | Python Flask |
| Agent Framework | Dedalus / MCP |
| Database | Snowflake (or SQLite fallback) |
| Messaging | Photon (iMessage) |
| Auth | Clerk |
| Frontend | Next.js or Vite + React |
| Hosting | Local or temporary cloud instance |
| Source Control | GitHub (single repo with /backend, /agents, /frontend, /database) |