Inspiration

I am always dreaming up new ideas or sitting around the table with friends talking about "what ifs.." and "we should do this..", but it is always hard to know if the idea will have legs or not. Ideas are great, but execution is everything, and sometimes it is hard to factor in all the variables that could impact execution, especially when trying to get a quick back-of-the-napkin plan done. To solve this problem, I built CashflowThis as really a tool for myself to decide if business ideas, investments, or side hustles were really worth chasing or the level of effort required.

What it does

CashflowThis is able to take a user's input which is in the form of a written business idea, concept, or investment opportunity and convert it into a detailed well-researched cashflow forecast. The tool leans on the power of Perplexity's Sonar API to source the most relevant and up-to-date information to fill in any gaps that the user may have left off of their input, and to gather all of the assumptions and variables needed to create a structured cashflow.

Once the cashflow is generated, the user can then tweak the cashflow, view changes/history, and export the cashflow to a PDF report for offline viewing and analysis, and as a potential artifact to power further analyses for potential investment.

How we built it

The journey of building CashflowThis was made using a combination of handwritten and AI-generated code using VSCode and Cline. AI-generated code still has its quirks, however as an individual with a strong background in software engineering, I was able to provide very detailed instructions to Cline. For example, a lot of the evaluation logic and schema definitions were written by hand and surrounding features that are...more boring to write such as CRUD interfaces, modals, form inputs, tables, cards, auth middleware, etc were all written by Cline with very detailed supervision by myself. I chose to go with a React+Vite frontend styled with tailwind in the aesthetically pleasing Catppuccin theme. The backend is a simple Express API hosted on Render on top of a Neon Postgres database. Authentication is powered by Stytch. The AI interface logic and workflow (cashflow generating agent) are powered by Cloudflare's new Cloudflare Workflows which provides stateful and fault-tolerant execution of the AI pipeline between Perplexity Sonar, OpenAI GPT 4.1, and Anthropic Claud Sonnet 3.7.

Challenges we ran into

Consistency is key when building out financial models, and so the broad unconstrained solution space that is provided by most AI platforms can create challenges for users wanting quick and consistent results. The biggest challenge was ensuring that consistency in results by building a highly structured cashflow model and ensuring the AI models don't create issues like cyclical dependencies between the various functions in the model (one row/item depending on another row/item that depends on that same row/item), hallucinating incorrect mathematical expressions in the functions, or creating duplicate items that overstate inflows/outflows (having both net profit and gross revenue as an inflow, when this is incorrect and will overstate total inflows).

Accomplishments that we're proud of

I am proud of the decoupling of the AI agent processing from the main API and moving it to using Cloudflare's new Cloudflare Workflows platform that is freshly out of beta. This gave the user experience a lot of fault-tolerance and consistency since page refreshes would not impact processing and a user could navigate away from the site and come back once it is complete.

Another accomplishment I am quite proud of is the design of the proprietary cashflow schema that is used as a tool input for either GPT 4.1 or Claude (depending on the success). This gave the ability to constrain the solution space to a particular data model. However, Claude and GPT are limited when it comes to interfacing with external data, so Perplexity's Sonar API gives CashflowThis the secret weapon of being able to fill in the gaps where user's might not consider all aspects of a particular business concept to build out a cashflow. So Perplexity Sonar is used to pull in all the assumptions and details up front and then funnels those details and citations down the pipeline so the cashflow can be enriched with up-to-date and very relevant data.

What we learned

I learned that AI models thrive when input is freely unconstrained and limited by only the boundaries of human speech, and output is constrained by a set of rules and data models. This constraining on the output mitigates (but does not completely eliminate) the possibility of malicious behavior (jailbreaking), hallucinating, and drift, while also improving the user experience by creating consistency in the output (what you see if what you get).

What's next for CashflowThis

I will continue to expand the footprint of CashflowThis by creating different opportunities for various personas such as individuals who want to start a side hustle, realtors who want to give quick back-of-the-napkin financial forecasts for first time homebuyers, investors who want to test out a particular idea in an industry, and more. I see CashflowThis being a precursor tool to complex spreadsheets and modeling tools where users can quickly test out hypotheses and prepare for more intensive forecasting exercises.

Built With

Share this project:

Updates