Skip to content

The bull and the bear: cheatsheet

For education only. Multi-agent architecture taught via stock analysis; not investment, financial, or trading advice.

Force the argument, then judge it. Two agents argue the same evidence with opposite mandates, the debate is capped at a small number of turns, and a separate, more capable judge reads both cases and commits to one decision. (Anchored to the TradingAgents framework, frozen snapshot 7e9e7b8.)

A single pass gives you one slanted view and the confidence to match. It underweights whatever does not fit its lean. You cannot prompt that away; you fix it with structure, by giving the counter-case its own dedicated advocate.

  • Bull (agents/researchers/bull_researcher.py): told to build the case for. Opening instruction: “You are a Bull Analyst advocating for investing in the stock.”
  • Bear (agents/researchers/bear_researcher.py): the mirror. Opening instruction: “You are a Bear Analyst making the case against investing in the stock.”
  • Both read the same four analyst reports. Each also reads the other’s last argument and is told to rebut it. That rebuttal is what makes it a debate, not two monologues.
  • Each turn appends to a running transcript, records who spoke, and ticks a turn counter up by one.
QuestionAnswerIn the code
Stop yet?Enough turns happened, hand off to the judgeif count >= 2 * max_debate_rounds: return "Research Manager"
Whose turn?If the bull just spoke, the bear is nextif current_response.startswith("Bull"): return "Bear Researcher"
OtherwiseThe bull goesreturn "Bull Researcher"

Default is one round: one bull turn, one bear turn, then the judge. (The file has a loose “3 rounds” comment; the behavior follows the number, which defaults to one.) Raise the number for longer debates; the structure does not change.

The Research Manager did not argue either side. It reads the full transcript and must commit to exactly one of five stances:

Buy Overweight Hold Underweight Sell

It runs on the more capable model (the two advocates run on the cheaper one), the same “spend capability at the judgment point” idea from lesson 1. Its decision is written into shared state as the investment plan. (These labels are the system’s own architectural choice, not advice to you.)

Read it free in your browser at github.com/TauricResearch/TradingAgents (pinned snapshot). No account, no Git, no programming knowledge needed. The short code 7e9e7b8 marks one frozen version, so the lessons match what you see.

  1. Assign opposite mandates over the same evidence; each role must answer the other’s strongest point.
  2. Cap the rounds, so the debate ends whether or not anyone “won.”
  3. Hand the transcript to a separate judge (ideally your most capable model) that must commit to one option from a fixed set.
  • A single advocate weighing its own pros and cons (the counter-case needs its own dedicated voice).
  • An unbounded debate (two advocates will not converge; the stop has to be designed).
  • A judge that is also an advocate (that is letting the winner score the match).
  • Bull / bear: the optimistic advocate (argues it goes up) and the pessimistic advocate (argues it goes down).
  • Bounded debate: a back-and-forth capped at a fixed number of turns, then ended.
  • Judge: a separate agent that reads both cases and commits to one decision; here, on the more capable model.