Open-Source AI Development & Pull Request Review | Mycroft AI

Tanmay Kulkarni reviews his merged pull request to Mycroft, an open repository of finance pipelines. The video follows an invented stock through three simulators and a weighted verdict, then describes a cross-language bug found while testing.

3:54 video3 min readWatch on YouTube

This video follows a pull request to Mycroft, a working repository of finance pipelines that it calls recipes. Tanmay Kulkarni, presenting in for Humanitarians AI, opens with a line that a workflow sends to an AI: "Your action plan must strictly match sell." His question for the whole video is who decided that verdict, and how much of a vote each part of the workflow had. Every company shown is invented, and the video states that none of it is investment advice.

The meeting metaphor

The recipe in question is a simulation workflow that asks three different questions about a stock and then hands an AI the answers. Tanmay frames it as a meeting. The workflow is the chair and the three simulators are its voices. His merged pull request made the six steps before the AI runnable on test data, with checks.

The chair's first job is to make sure every seat has something to read. If a request arrives with nothing filled in, the chair fills every seat itself, as it does for a placeholder called Unknown Company. The meeting starts anyway.

The three voices

The example stock is an invented company, Ironbridge Power, with 5% growth, a sentiment of 0.35, a price-to-earnings ratio of 80, and an aggressive investor.

  • The first voice sorts the stock into one of nine boxes, rating growth and sentiment as low, medium or high. Ironbridge is low and low, and the voice says strong sell with 82% confidence.
  • The second voice judges the same stock for three kinds of investor. Conservative and balanced both say avoid. Aggressive has the loosest limits, and Ironbridge sits exactly on all four of them, so it says enter a full position.
  • The third voice asks a different question: how close is the verdict to changing? It nudges growth and sentiment up and down six ways, and three of the six nudges change the verdict. The stability score is 0.05 out of one.

Weighing disagreement

Now the voices disagree, but nobody has made a mistake, since they were asked different questions. The chair weighs them 45, 35 and 20 on a scale from one to five, where strong sell is at the bottom and enter a full position at the top. Together they come to 2.17 out of five. A score from 1.8 to 2.8 is written down as a sell.

The chair then writes the minutes, about 470 words, covering the stock, each voice, the stress tests, the verdict and a final instruction. The AI only ever receives the minutes, and in the minutes a number someone typed looks the same as a number the chair filled in.

A bug found by a second implementation

To check the original, Tanmay wrote a second minute taker, a Python copy of the six steps, and ran both on the same meetings. On two requests, they wrote different verdicts. In those, growth had been typed as letters and sentiment left as empty text. Python and JavaScript disagree about the smallest of a list when one entry is not a number. After the fix, both write the same minutes on all 23 requests, and a test keeps the problem from returning.

Nothing was sent anywhere. The step that would call the AI and the step that would save the answer are written down as hand-offs marked not approved, and five items in the recipe remain open. It still says draft on purpose.

Key takeaways

  • The pull request made the six steps before the AI runnable on invented test data with checks.
  • Three simulators ask different questions, so disagreement between them is not an error.
  • The chair weighs the voices 45, 35 and 20 and writes a verdict from the weighted score.
  • The AI sees only the written minutes, not the process behind them.
  • A second implementation in Python exposed a difference in how Python and JavaScript handle non-numeric entries when finding a minimum.
  • A test now keeps that bug from coming back.
  • The AI call and the save step remain unapproved hand-offs.

Try it yourself

If an AI is going to summarise your next meeting, read the minutes. The video's test is whether the summary names the voices and their weights, since "the AI will figure it out" does not count. The project is on GitHub as nikbearbrown/mycroft, and the pull request discussed is number 70.

Full transcript(auto-generated, with timestamps)

[0:00]This is the last line of a message an AI is about to receive. Your action plan must strictly match sell. A workflow writes that line to hold a model to a verdict it has already been given. So, who decided the verdict? Let me take you to the meeting. Hi, this is Tanmay Kulkarni in for Humanitarian's AI. This week I contributed to Mycroft, a book in a working repository of finance pipelines. It calls them recipes. One of them, the would-be simulation agent, asks three different questions about a stock, then hands an AI the answers. Three voices, one written record, and one question for this whole video. Who had a vote and how

[0:34]Much? My pull request, now merged, made the six steps before the AI runnable on test data with checks. Every company you'll see is invented and none of this is investment advice. Today's stock is Ironbridge Power, invented growth 5%, sentiment .35, a price-to-earnings of 80, and an aggressive investor. I'll call the workflow the chair and the three simulators its voices. The chair's first job is to make sure every seat has something to read. Ironbridge arrived with everything filled in, but if a request arrives with nothing, the chair fills every seat itself. A company called Unknown Company, growth 15%, sentiment .5. The meeting starts anyway. First voice, growth against sentiment.

[1:14]It sorts a stock into one of nine boxes, low, medium, or high on each. Ironbridge is low and low. The voice says strong sell with 82% confidence. Second voice, the same stock judged for three kinds of investor. Conservative says avoid. Balanced says avoid. Aggressive has the loosest limits. Growth at least 5%, sentiment at least .35, price-to-earnings no more than 80, debt-to-equity no more than 1 and 1/2, and Ironbridge sits exactly on all four, four out of four, enter a full position. Third voice, and this one asks something different. Not what should we do, but how close is it to changing its mind? It nudges growth and sentiment up and down

[1:53]Six ways and watches the verdict. Three of the six nudges change it. The stability score, 0.05 out of one. Now they disagree. The first voice says strong sell. The second says enter a full position. Nobody has made a mistake. They were asked different questions. So the chair weighs them 45, 35, and 20. The chair scale runs from one to five. Strong sell sits at the bottom and enter a full position at the top. So a smaller weight on the top can outweigh a bigger weight on the bottom. The voices contribute 0.37, 1.75, and 0.05. Together, 2.17 out of five. Anywhere from 1.8 to 2.8, the chair

[2:28]Writes down a sell. Then the chair writes the minutes, about 470 words. The stock, each voice, the stress tests, the verdict, and one last instruction for someone who wasn't in the room. The action plan must strictly match sell. The AI only ever receives the minutes. And in the minutes, a number somebody typed looks exactly like a number the chair filled in. Here's where I got something wrong. To check the original, I wrote a second minute taker, a Python copy of those six steps, and ran both on the same meetings. On two requests, it wrote a different verdict. Those were requests where growth was typed as the letters A,

[3:04]B, C, and sentiment was left as empty text. Python and JavaScript disagree about the smallest of a list when one entry isn't a number. I fixed it. Now both write the same minutes to the letter. On all 23 requests, and a test keeps that slip from coming back. Nothing was sent anywhere. The step that would call the AI in the step that would save the answer are written down as hand-offs marked not approved. Five items in the recipe are still open, and it still says draft on purpose. If an AI is going to summarize your next meeting, have you read the minutes? Who had a vote, and how much of one? A good

[3:39]Answer names the voices and their weights. The AI will figure it out doesn't count. Adjourned. Tanmay Kulkarni, in for Humanitarian's AI, signing off.

More from Mycroft Financial AI

Humanitarians AI Lyrical Literacy Project