[Part 1] Unlocking the Power of LLMs for the Cashflow Game

As a passionate learners and game enthusiasts, Marius Fleischer and I recently took on the challenge of designing an interactive “rat race” workflow of the popular Cashflow game by Robert Kiyosaki, author of the iconic book “Rich Dad, Poor Dad”. Cashflow is a financial education game that teaches players about investment strategies, asset management, and personal finance.

The goal was to leverage the power of large language models (LLMs) to build an interactive, AI-driven Cashflow game experience – which can run on an edge device in a cost effective manner. Through this project, I gained valuable insights into the design and implementation of such workflows.

Initial Design and Workflow Concepts

Here’s how we started out by brainstorming and building this agentic workflow:

An analyst agent (left). Full agentic workflow for the game (right).

Game Workflow Breakdown

Initial workflow involved an analyst agent using tools (such as a calculator) to analyze any game decisions. This comes up in many places in the workflow. The workflow for each turn follows the rules/ structure of the game within the “rat race” –

  • Evaluate shared opportunities (if any) and decide if you want to act on it
  • Decide on bank interactions such as repaying or borrowing
  • Roll the die
  • Resolve various card types - options include deals (small/big, allowing you to buy assets), charity (you can do so if you have the money to, in exchange for more options to roll the die), doodad cards (getting a baby, payday, buying things), and market cards (opportunities that allow you to sell assets)

Analyst agent can analyze decisions and assess your financial situation (managed through a financial statement). It will make a recommendation and the game goes on!

Challenges and Insights

Implementing the workflow with Llama 3.2 (via Ollama) revealed critical challenges and design considerations. Caveat: Larger models would have probably done better, but the goal was to develop this solution on edge devices with minimal costs incurred. Attempting to use tool calling for different card types proved challenging. Direct computation emerged as a more efficient approach. With all the game data (including financial statement) readily available, it became clear that simply presenting information to the LLM could work effectively. Furthermore, not every workflow requires complex agent interactions! This led to reconsidering Agentic vs simple LLM workflow and revisiting the crucial differences between the two.

Agentic vs. Simple LLM Workflow

An agent architecture would be more suitable when:

  • LLM needs to plan or explore decision paths for what to do next
  • Complex tool calling is required
  • Control flow isn’t immediately apparent and may need to be decided by the LLM

In this game workflow, the LLM didn’t need to determine program control flow. The game provided all necessary data for decision-making, eliminating the need for an agent-based approach. This realization highlighted a crucial design principle: choose the simplest workflow that effectively solves the problem.

Key Lessons Learned

Simplicity Over Complexity: An elaborate agent architecture wasn’t necessary for this particular use case. A streamlined LLM-driven workflow proved more effective.

Direct Computation: Handling calculations directly within the workflow maintained system efficiency.

Reminder: As the design principle goes, “Keep It Simple, Stupid” (KISS), the simplest solution often works best. So, if you’re working on your own projects or systems, remember that sometimes less really is more. Apply this thinking in your own endeavors and don’t be afraid to reevaluate your approach as you go!

Workflow Components

The refined workflow included the following components:

  1. Financial Statement Management: The game maintains a comprehensive financial statement, tracking the player’s cash, income, expenses, assets, and liabilities. This allows the LLM to make informed recommendations based on the player’s current financial situation.

  2. Opportunity Evaluation: When presented with an investment opportunity (for example, a deal or a shared market opportunity), the player’s details are passed to the LLM, which evaluates the opportunity and provides a recommendation on whether to buy or sell, along with the reasoning behind the decision.

  3. Deal Size Recommendation: The LLM also provides guidance on the appropriate deal size based on the player’s financial position, helping them make informed decisions about the scale of their investments.

  4. Charity: The workflow evaluates whether charity donations are possible using the player’s financial positions and decides if donating to charity is beneficial.

  5. No-Deal Scenarios: The game also handles situations where the player encounters events like payday, downsizing, having a baby, Doodad cards (e.g., you’re buying a TV), or any other no-deal scenarios. The workflow calculates the payments and manages the player’s financial statement.

  6. Borrowing/Repayment Decisions: The workflow includes logic for borrowing/repayment (from/to the bank at a high interest rate) decisions, with the LLM offering recommendations tailored to the player’s financial circumstances.

The project demonstrated the potential of LLMs in creating an interactive Cashflow game experience without the need for a complex agent architecture, highlighting thoughtful system design.

If you’re interested in learning more about the implementation details, stay tuned for the second part of this post!




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Reading Assistant
  • News Automation System
  • Recipe Finder Agent using smolagents