DEV Community

William Wang
William Wang

Posted on

I Built an AI Tool to Track Investment Discipline from 26 Legendary Investors — Here's What I Learned

Last year, I lost money on a trade I knew was bad the moment I clicked "buy." Not because I lacked information — I'd read Buffett's letters, studied Munger's mental models, even highlighted passages in The Intelligent Investor. I lost money because in the heat of the moment, none of that wisdom was accessible to me.

That experience became the seed for KeepRule — an AI-powered tool that organizes investment principles from 26 legendary investors and helps you actually apply them when it matters.

Here's what I learned building it.

The Problem Nobody Talks About

There's a strange gap in the investing world. We have endless content about what great investors think — books, podcasts, YouTube breakdowns, Twitter threads. But almost nothing helps you internalize those principles so they show up in your decision-making process.

I tracked my own behavior for three months. The pattern was obvious:

  • Monday: Read a brilliant Buffett quote about patience.
  • Wednesday: Panic-sold a position that was down 8%.
  • Friday: Watched the position recover 12%.

Sound familiar? The issue isn't knowledge — it's the gap between knowing and doing.

Why I Started Building

I'm a developer, so my instinct was to build something. The initial idea was simple: what if I could create a searchable database of investment principles, tagged by investor, category, and situation?

But as I dug deeper, I realized the real challenge was more nuanced. Investment wisdom isn't just a collection of quotes. It's a interconnected web of mental models, psychological insights, and decision frameworks.

Take Buffett's famous "Be fearful when others are greedy" line. On its own, it's a bumper sticker. But connect it to his circle of competence framework, Munger's inversion thinking, and Howard Marks' concept of second-level thinking — now you have a real decision-making toolkit.

That's what I set out to build.

The Technical Journey

I started with a simple database: investors, principles, categories. But structuring investment wisdom turned out to be surprisingly hard.

Challenge 1: Principles aren't atomic. Buffett's approach to valuation isn't one rule — it's a constellation of interconnected ideas about moats, margin of safety, management quality, and intrinsic value. I had to build a tagging and relationship system that could capture these connections.

Challenge 2: Context matters enormously. "Buy when there's blood in the streets" is great advice during a genuine market panic. It's terrible advice when a company is actually failing. Each principle needed situational context.

Challenge 3: Different investors contradict each other. Buffett says concentrate your portfolio. Peter Lynch says diversify. Both are right — for different people in different situations. The system had to handle these tensions gracefully.

I ended up building a multi-layered categorization system with 26 master investors, each with their principles organized by theme: valuation, risk management, psychology, portfolio construction, and more.

What Surprised Me Most

Building this tool forced me to read deeply across dozens of investors, and some patterns jumped out:

1. The Best Investors Are Psychologists First

Roughly 40% of the principles I cataloged are about managing your own psychology — not analyzing stocks. Buffett, Soros, Dalio, Lynch — they all spend more time talking about emotional discipline than financial models.

This led me to build a psychology assessment tool that helps investors identify their specific behavioral blind spots. It's based on the actual cognitive biases that the masters warn about most frequently.

2. Scenarios Beat Principles

Abstract rules are hard to apply. "Buy companies with durable competitive advantages" — okay, but what does that look like when you're staring at a stock screener?

I started building real-world scenarios — "What would Buffett do if a great company dropped 30% in a week?" — and mapping them to specific principles. Engagement with the tool jumped significantly when I added these.

3. Contradictions Are Features

The tensions between different investors' approaches aren't bugs — they're the most valuable part. When Buffett and Soros disagree, that's where the interesting thinking happens. I built the system to surface these tensions rather than hide them.

What I Learned About Building in Public

A few takeaways for other builders:

Ship the ugly version. My first version was a static page with 50 principles in a table. No AI, no fancy UI. But people used it and gave feedback that shaped everything that came after.

Domain expertise compounds. I knew basic investing before this project. Now, after reading thousands of pages of primary sources to build the database, I understand these frameworks at a much deeper level. Building a tool taught me more than years of passive reading.

AI is a force multiplier, not a replacement. I use AI to help users explore connections between principles and to power the scenario analysis. But the core curation — deciding which principles matter, how they relate, what context they need — that required human judgment.

Current State and What's Next

KeepRule now covers 26 investors with hundreds of principles, a psychology assessment, and AI-powered scenario analysis. It's free to use.

What I'm working on next:

  • Portfolio journaling — log your investment decisions and get them analyzed against the principles you say you follow
  • Real-time bias alerts — detect when market conditions are likely triggering common cognitive biases
  • Community principles — let users contribute and vote on principles from investors not yet in the database

The Bigger Lesson

The most important thing I learned isn't about code or investing. It's that the gap between knowledge and action is the most valuable problem space in almost any domain.

We're drowning in information. What we lack are systems that help us act on what we already know. If you're looking for a project to build, look for that gap in whatever field you care about.

If you want to check out what I built, visit keeprule.com. I'd love feedback from this community — especially on the technical implementation and what features would actually be useful.

What tools or systems do you use to maintain discipline in your investing (or any other domain)? I'd love to hear about it in the comments.

Top comments (0)