Latest / Deep Values: Value Investing Deep Dives / 🚀 AI Stock Agents Already Beats Wall Street? MIT TradingAgents Framework Exposed!
Transcript
- 0:00Have you ever felt just, you know, utterly overwhelmed by the
- 0:03sheer fire hose of information, especially when you're trying to
- 0:06understand complex fields like, say, the stock market?
- 0:08Oh definitely. It's a constant barrage.
- 0:10Exactly. It's this dizzying world of
- 0:12financial reports, breaking news, shifting sentiment, these
- 0:15intricate technical charts, trying to synthesize it all to
- 0:19spot the signal from the noise. It can feel like trying to drink
- 0:22from a fire hydrant, honestly. Information overload is real.
- 0:26What if there was a shortcut? Or maybe not a shortcut, but a
- 0:29better way. A way to gain that deep, multi
- 0:33faceted understanding without that crushing feeling?
- 0:36Imagine having like an entire professional trading firm
- 0:39staffed by brilliant minds right at your fingertips, distilling
- 0:42all that complexity into clear, actionable insights just for
- 0:46you. That's that's quite the vision.
- 0:48Well, today in the Deep dive, that's precisely what we're
- 0:51going to explore. Our mission is to cut through
- 0:53that noise and show you how cutting edge AI is stepping into
- 0:57this arena, specifically helping make profound sense of the
- 1:00stock. Market sounds fascinating.
- 1:01We're diving deep into something called Trading Agents.
- 1:04It's an open source framework meticulously developed by
- 1:07brilliant researchers at UCLA and MIT.
- 1:09Think of it as your very own virtual trading firm powered by
- 1:13these advanced large language models, LLMS and engineer to
- 1:16mimic the sophisticated collaborative workflow of real
- 1:20human financial experts. Right.
- 1:22So it's not just one AI, it's like a team.
- 1:24Exactly, by the end of this deep dive, you won't just understand
- 1:27what trading agents is, you'll grasp how it works, what it
- 1:30actually costs to run this intelligence system, which is
- 1:33important, and crucially, how it can be custom tailored to
- 1:36reflect specific investment philosophies you might hold,
- 1:39like the, you know, time tested principles of value investing.
- 1:42OK, so customization is key. Definitely.
- 1:45This isn't just abstract tech sitting in a lab.
- 1:47It's about practical, powerful insights for anyone looking to
- 1:49truly understand market analysis, whether you're
- 1:52prepping for a high stakes meeting, catching up on the
- 1:54latest breakthroughs in AI finance, or maybe you just
- 1:57possess an insatiable curiosity. All right, let's unpack this
- 2:01fascinating development. The real breakthrough here, I
- 2:03think, isn't just AI on its own, It's AI teamwork.
- 2:06Trading agents really shatters that myth of a single all
- 2:10knowing super brain for finance. Instead, it demonstrates how
- 2:14specialized AI agents, working together almost like departments
- 2:17within a human trading firm, can unlock far more nuanced and
- 2:20robust financial insights. This multi agent approach with
- 2:25each AI playing a distinct role, That's fundamentally the secret
- 2:29sauce here. That's a great distinction.
- 2:30So if it's a multi agent system, how does that truly
- 2:33differentiate it from just having one monolithic super
- 2:37powerful AI model doing everything?
- 2:38What's the unique advantage of this collaborative team approach
- 2:42when you apply it to something as complex as market analysis?
- 2:45Well, it's really about simulating the division of Labor
- 2:47and the specialized expertise you find in a real trading firm,
- 2:50right? A single large AI, while
- 2:52powerful, might struggle to maintain distinct perspectives
- 2:55or even, you know, prevent its own cognitive biases from
- 2:57creeping in. I see.
- 2:59But by breaking down the problem into these different expert
- 3:02agents, you've got a fundamentals expert, a news
- 3:04expert, a sentiment expert, a technical one.
- 3:07You ensure each piece of data is analyzed through its own
- 3:09dedicated lens. This prevents that tunnel vision
- 3:12we talked about and helps build a more holistic, more robust
- 3:17picture of the situation. It's really about combining
- 3:20diverse insights where the whole truly becomes greater than the
- 3:23sum of its parts. I see.
- 3:24So it's not just about crunching more data faster, but analyzing
- 3:28that data through multiple distinct cognitive frameworks.
- 3:31Almost like bringing together a really diverse board of advisors
- 3:35for each decision. That makes a lot of intuitive
- 3:37sense, Something as multifaceted as the market.
- 3:39Exactly. And from what I understand, this
- 3:41isn't just some interesting academic experiment sitting on a
- 3:43shelf. The back test conducted by the
- 3:45researchers actually reveal a pretty compelling advantage,
- 3:48right? Absolutely.
- 3:50And this is where it gets really compelling.
- 3:51I think the framework has demonstrably outperformed
- 3:54traditional baseline strategies in simulated environments in
- 3:57their back tests. OK.
- 3:57I'll performed how? We're talking about higher
- 3:59returns, superior sharp ratios, which for anyone unfamiliar
- 4:03that's a critical measure of risk adjusted returns, basically
- 4:06showing how much return you get for the risk you take, and also
- 4:08lower drawdown. Meaning fewer big dips in value.
- 4:11Precisely fewer painful dips or sustained losses in the
- 4:15portfolio value. This performance validation
- 4:17really makes a strong case for this collaborative LLM based
- 4:20approach. It illustrates how a team of
- 4:22specialized AIS can indeed outperform simpler single
- 4:27strategy models. So OK, let's imagine each AI
- 4:30agent is a distinct member of your personal financial analysis
- 4:32team, each playing a crucial specialized role.
- 4:36If we connect this to the bigger picture, this kind of pipeline
- 4:38based architecture you mentioned is really central to its
- 4:41effectiveness. Can you walk us through how this
- 4:44Symphony of AI minds actually operate step by step?
- 4:46How does the information flow? Certainly, the system is
- 4:49meticulously organized into a sequential flow, and it's
- 4:52designed to mirror precisely how a real world trading firm
- 4:55operates. It moves methodically from that
- 4:57initial data analysis all the way through to the final
- 5:00decision execution. You can visualize it as
- 5:02information flowing seamlessly through different expert
- 5:05departments, if we will, each adding its layer of insight
- 5:08before passing it along. This structured approach is
- 5:11really what allows such complex reasoning to occur reliably.
- 5:15OK, let's peel back the layers then and walk through that
- 5:17ingenious pipeline. It all begins, logically enough,
- 5:22with the analyst team. These are your initial data
- 5:25gatherers, right? Working concurrently to pull
- 5:28intelligence from every conceivable angle, we're talking
- 5:31about four highly specialized roles here, and each one results
- 5:34in a concise, focused report. Exactly, the 1st and arguably
- 5:37one of the most foundational especially for long term
- 5:40investors is the fundamentals analysts.
- 5:42Right, the bedrock. Yeah, this agent really digs
- 5:45deep into the company score financials.
- 5:47It's looking for that underlying health and value, evaluating
- 5:50things like PE ratios, which indicate how much investors are
- 5:53willing to pay per dollar of earnings, revenue trends over
- 5:56time, the strength of the balance sheet, cash flow
- 5:58statements, all that good stuff. So finding in the intrinsic
- 6:01value. Its goal is precisely that
- 6:03identify stocks that appear undervalued or overvalued based
- 6:07on their intrinsic business strength rather than just, you
- 6:09know, market whims. This agent provides that solid
- 6:12bedrock of data-driven insight. Then you have this sentiment
- 6:16analyst, which to me is utterly fascinating.
- 6:19This AI isn't looking at balance sheets at all.
- 6:21It's scanning social media platforms, financial forums,
- 6:24news comments, other public sentiment indicators.
- 6:27It's essentially assessing the overall mood swings around a
- 6:30stock or even the broader market.
- 6:32Kind of like taking the market's temperature.
- 6:34Exactly. Is the crowd bullish or bearish?
- 6:36Is there irrational exuberance or deep fear?
- 6:39It's looking for those emotional currents that can often drive
- 6:42short term price movements and create opportunities or, you
- 6:44know, risks. Then Next up is the news
- 6:47analyst. This one is constantly vigilant,
- 6:49monitoring breaking news headlines, financial reports,
- 6:51macroeconomic events. Think central bank
- 6:54announcements, earnings surprises, geopolitical shifts.
- 6:56Stuff that moves markets fast, right?
- 6:59This agent is designed to anticipate how the market might
- 7:02react to that information as it hits the wire.
- 7:05It's about discerning the immediate and potential ripple
- 7:08effects. And the fourth analyst?
- 7:10And finally, the technical analyst comes into play.
- 7:13This one examines historical price patterns and technical
- 7:16indicators. This is where you see concepts
- 7:18like moving averages which smooth out price data to
- 7:21identify trends, right? The charts.
- 7:23Yeah, the charts and things like the relative strength index or
- 7:26RSI, which measures the speed and change of price movements to
- 7:29spot overbought or oversold conditions and the moving
- 7:32average convergence divergent or Med, which is a momentum
- 7:36indicator. Some people swear by this stuff.
- 7:38Well, while some might view it as reading tea leaves, it's a
- 7:42distinct and widely used methodology in trading.
- 7:45And the critical output of each of these 4 analysts is that
- 7:48concise, digestible report summarizing their key findings.
- 7:52The profound relevance for you, the listener, is that these
- 7:54diverse analytical lenses working together, they
- 7:57collectively prevent that tunnel vision we mentioned.
- 8:00Instead of relying on just one data point or one type of
- 8:02analysis, this multi faceted approach creates a truly
- 8:06holistic view. It arms you with a much richer,
- 8:09more nuanced understanding of a stock's potential, considering
- 8:12not just its financial health, but also market mood breaking
- 8:16events and historical price action.
- 8:18It's really comprehensive. It is an incredibly
- 8:20comprehensive initial assessment, but importantly, it
- 8:23doesn't just stop there. Once these specialized reports
- 8:26are compiled, they aren't immediately acted upon.
- 8:28They go to the next stage, the researcher team.
- 8:31OK, the researchers, these are debaters, you said.
- 8:33This is where the nuance and critical thinking really begin
- 8:35to shine within the AI system. You have a dead indicated
- 8:38bullish researcher and a dedicated bearish researcher, is
- 8:41that right? That's exactly right, and this
- 8:43raises an important question. How does an AI truly debate
- 8:47conflicting viewpoints without just sort of defaulting to an
- 8:50average or getting stuck in indecision?
- 8:52Yeah, how does that work? The beauty here is their
- 8:55programmed dialectical process. They are explicitly prompted to
- 8:59debate, the analyst reports, each taking a strong opposing
- 9:02stance. The bullish researcher
- 9:04highlights opportunities, positive indicators, potential
- 9:07upsides, basically constructing A compelling argument for a long
- 9:10position. Conversely, the bearish
- 9:13researcher meticulously focuses on risks, negative signals,
- 9:17potential downsides, building the case for caution, or maybe
- 9:21even a short position. This structured debate ensures A
- 9:24balanced adversarial assessment where assumptions are challenged
- 9:27from both sides. That dialectical process sounds
- 9:29crucial. It forces a comprehensive look
- 9:32at both sides of the coin. Prevents confirmation bias
- 9:34maybe? Exactly.
- 9:35It's not just summarizing facts, it's actively interrogating
- 9:37them. After that rigorous debate
- 9:39happens, the synthesized insights then flow to the trader
- 9:42agent. The decision maker.
- 9:43Precisely. The trader agent is essentially
- 9:45the central nervous system, the ultimate decision maker of the
- 9:48entire operation. It takes all that meticulously
- 9:51analyzed and debated information from the analysts and
- 9:53researchers, synthesizes it, and then formulates a concrete
- 9:57trading plan. And not just buy or sell.
- 9:59No, it's more detailed. It includes the specific action
- 10:02buy, sell or hold along with crucial details like the
- 10:05recommended timing of the trade and the suggested size or
- 10:07allocation is where all the upstream intelligence culminates
- 10:11into an actionable strategy. Well, hold on.
- 10:13Before any virtual money changes hands, so to speak, there's a
- 10:16vital safety net. It's not just the trader calling
- 10:18the shots. Every proposed trade must first
- 10:22go through the risk management team.
- 10:24Yes, the Guardians. Guardians of the portfolio.
- 10:26I like that they meticulously vet the proposed trade against a
- 10:31predefined set of crucial metrics.
- 10:34Correct. This is an absolutely crucial
- 10:36role, especially if you are ever thinking about real world
- 10:38application. The risk management team
- 10:40assesses factors like projected volatility, you know how much
- 10:44the price might swing, liquidity, how easily the asset
- 10:48can be bought or sold without tanking the price, exposure
- 10:51limits, making sure the portfolio isn't too concentrated
- 10:53in one thing, and potential draw down the maximum expected loss
- 10:57from a peak to a through. They can say no.
- 10:59Oh yes, they possess the power to flag concerns, request
- 11:03revisions to the plan, or even outright veto a trade.
- 11:07They ensure that the strategy rigorously adheres to safe,
- 11:10predefined parameters and keeps the overall portfolio secure.
- 11:14It's the essential safety net. OK, makes sense.
- 11:17And finally, if the trading plan is sound and successfully passes
- 11:20that rigorous risk review. Then the fund manager agent
- 11:22steps in for the final ultimate review and approval.
- 11:25Once that green light is given, the trade is then executed
- 11:28within the simulation environment and then the entire
- 11:31comprehensive cycle can repeat, adapting to new data and market
- 11:34conditions. Well, that's quite a flow.
- 11:36And one subtle but absolutely critical aspect underpinning
- 11:39this entire workflow is the communication protocol between
- 11:42these agents. It's not like a free form
- 11:44conversational chat you might imagine between humans just
- 11:47talking. No.
- 11:48How does it work? Instead, agents primarily
- 11:50produce highly structured outputs.
- 11:52Think clear, concise reports, bullet points, maybe even simple
- 11:55diagrams or tables where appropriate.
- 11:57Why structured? It's designed to preserve key
- 11:59information and enable precise querying and seamless handoffs
- 12:03between agents. It prevents valuable context
- 12:06from getting lost in translation.
- 12:07Essentially, natural language dialogue is used more sparingly,
- 12:11mainly for the deeper reasoning and those adversarial debates
- 12:14within the researcher and risk teams, allowing for that nuanced
- 12:17exploration without sacrifice and clarity.
- 12:20This structured approach is vital for keeping complex multi
- 12:23step reasoning on track in a financial context.
- 12:26OK, so that's the sophisticated workflow.
- 12:28Now let's peel back the layers even further and talk about the
- 12:30actual brains behind this operation, the core technology
- 12:33that powers this AI dream team. The researchers implemented a
- 12:36really smart and efficient dual model LLM strategy.
- 12:40What's that about? Yeah, this concept involves
- 12:43intelligently distributing tasks to different large language
- 12:46models based on their complexity and importantly, their cost.
- 12:49You have a quick thinking LLM assigned for fast, lightweight
- 12:52tasks, things that primarily involve summarization,
- 12:54information retrieval, or simple data formatting.
- 12:57OK, the simple stuff, right? Then there's a separate deep
- 13:00thinking LLM reserved for the more cognitively demanding tasks
- 13:03like complex reasoning, synthesis, and critical decision
- 13:07making. Gotcha.
- 13:08And which models did they use? In their experiments, the Quick
- 13:11Thinking model was typically a GPT 3.5 tier model.
- 13:15They actually refer to it as GPT 4-O Mini in their latest
- 13:18configurations, which is Open AI's newer faster model in that
- 13:21class for the truly heavy lifting.
- 13:24The Deep Thinking model was a more powerful GBT 4 tier model,
- 13:28often specifically O1 preview which is open a eyes latest
- 13:31flagship model known for strong reasoning.
- 13:33And the efficiency here is incredibly clear.
- 13:35You aren't wasting expensive top tier model calls on routine
- 13:39tasks that a less powerful, cheaper model can handle
- 13:42perfectly well. Exactly summarizing financial
- 13:44data or retrieving simple facts is handled by the faster, more
- 13:47cost effective model, while those truly crucial high stakes
- 13:50decisions like the final trading recommendation get the benefit
- 13:53of the more capable, albeit pricier model.
- 13:55Superior reasoning. It's a very practical, almost
- 13:57business minded approach to managing AI resources
- 14:00effectively. What's also genuinely
- 14:01fascinating about trading agents is it's modular and model
- 14:05agnostic design. Can you elaborate on that?
- 14:07Sure, the entire framework is built on something called Lane
- 14:10Graph, which is a powerful library specifically designed
- 14:13for constructing these complex stateful LLM driven agent
- 14:17graphs. Okay, this architectural choice
- 14:20means developers aren't locked into a single provider like only
- 14:23Open AI. They can easily swap in
- 14:25different LLM providers or models as new, more efficient or
- 14:29maybe more specialized models become available down the line.
- 14:32It's sort of future proofs the system and adds immense
- 14:34flexibility. And it comes with a fantastic
- 14:37hardware benefit that's a real game changer for accessibility.
- 14:40You can run the core system without needing powerful GPUs on
- 14:43your local machine, right? That's a huge point.
- 14:46The heavy, computationally intensive work of complex
- 14:48natural language reasoning is entirely offloaded to those
- 14:51remote LLM API calls, whether it's Open AI or another cloud
- 14:54provider. Your local machine is primarily
- 14:57just acting as the orchestrator managing the flow of data and
- 15:00prompts, which isn't particularly demanding
- 15:02computationally. So let's drill down into the
- 15:04specific core components that make this all possible.
- 15:07You mentioned Landgraf acts as the central orchestrator.
- 15:10Yes, Landgraf is the conductor. Essentially it manages the
- 15:13complex multi agent interactions, handling
- 15:16sophisticated workflows, loops, ensuring stateful interactions
- 15:19are maintained as information flows through the graph.
- 15:22It's the backbone of the entire collaborative process.
- 15:25And for data it hooks into the Fen Hub API.
- 15:28Right Fen Hub is a comprehensive financial data provider.
- 15:31This API supplies real time and historical market data, things
- 15:34like livestock prices, crucial financial statements, income
- 15:38statements, balance sheets, and a continuous stream of news
- 15:41feeds. And crucially for anyone looking
- 15:44to experiment, the free tier of Fen Hub is actually sufficient
- 15:47for basic testing and demos. That's great for accessibility.
- 15:50Very much so, it makes it easy to get started.
- 15:52And by default, the Open AIAPI serves as the primary LM
- 15:55provider, the brains. Correct.
- 15:58It's the brains that power the reasoning and decision making
- 16:01for each individual agent. Every single decision an agent
- 16:04makes, every report it generates, every piece of
- 16:07analysis it performs, that translates into an API call to
- 16:10an open AI model like GPT 4 or GPT 3.5.
- 16:15That's where the core intelligence and generative
- 16:17capabilities reside. They also include wife and utils
- 16:20for offline data support. What's that for historical data?
- 16:23Yeah. Typically related to Yahoo
- 16:24Finance data, it allows the agents to access cash to
- 16:27historical information. This is invaluable for back
- 16:30testing and running simulations because it provides a rich data
- 16:33set of past financial ratios, historical stock prices, news
- 16:36events, ensures the agents aren't limited solely to live
- 16:39API calls when doing retrospective analysis.
- 16:42The source actually mentions a local data set called Toric
- 16:44Trading DB being used for this, providing A consistent
- 16:47historical snapshot. OK.
- 16:48And for the short reading agent, the technical analyst?
- 16:51Right, for the technical analyst, there's stock stats.
- 16:53It's a dedicated Python library specifically for technical
- 16:56analysis. This library computes all those
- 16:59widely used indicators we mentioned, moving averages,
- 17:01RSIMCD, and so on. It provides the technical
- 17:04analyst agent with the quantitative tools needed to
- 17:06evaluate price trends, momentum, and generate signals based on
- 17:10chart patterns. So when you put all these
- 17:13meticulously chosen components together, yeah, what you get is
- 17:16a remarkably comprehensive full closed loop trading simulation.
- 17:21Exactly. It covers every step from
- 17:24initial data gathering through deep analysis and nuanced
- 17:26decision making, all the way to simulated trade execution and
- 17:29evaluation. And the modularity here is a
- 17:32true superpower. You have the freedom to adjust
- 17:34agent roles, fine tune the depth of analysis, even plug in
- 17:37entirely different data sources or LML models without
- 17:39dismantling the whole thing. It's an incredibly flexible and
- 17:41adaptable system. Now that we've unpacked what
- 17:44trading agency is and how it's meticulously built, let's get
- 17:47hands on how do you actually get this virtual trading floor up
- 17:49and running on your own machine? The good news you said is it's
- 17:52entirely open source. That's right, written in Python,
- 17:55readily available on GitHub under an Apache 2.0 license,
- 17:58which means you can inspect it, modify it, use it freely.
- 18:02So how easy is the setup? It's remarkably straightforward,
- 18:05especially for anyone familiar with basic Python development
- 18:08environments. You essentially start by cloning
- 18:10the repository from GitHub onto your local machine, just
- 18:13downloading the code. Then you navigate into the
- 18:16roject directory using your terminal.
- 18:18OK From there you simply install the required Python packages
- 18:21using a single command. I install R requirements dot
- 18:25TXT. It's crucial to use Python 3.0
- 18:28or newer, and we strongly recommend using a virtual
- 18:31environment like conda or van Vim to manage your dependencies
- 18:34cleanly and avoid conflicts with other Python projects you might
- 18:37have. Got it.
- 18:38Any tricky parts? Well, one small but important
- 18:41detail which can sometimes trip people up.
- 18:43There's an external dependency called TA Lib.
- 18:46It's used for some of the more advanced technical indicators.
- 18:48If you're using conda, you might need to install it separately
- 18:51using a command like conda install dashi condaforge Tay
- 18:54Lib. It's a minor extra step, but
- 18:56just something to be aware for a smooth setup.
- 18:58OK, good tip. And before you run anything, you
- 19:00need API keys, right? It's critically important, yes.
- 19:03Before you can even begin to run any analysis, you'll need to set
- 19:06up two essential API keys as environment variables on your
- 19:09system. The 1st is your Finn Hub API key
- 19:13that grants access to the crucial financial data.
- 19:16And like we mentioned, the developers conveniently noted
- 19:19that the free tier of Finn Hub is more than sufficient for
- 19:21testing and demos. Which is great for starting out.
- 19:24Definitely the second key, and perhaps more impactful for your
- 19:27ongoing expenses, is the Open AIAPI key.
- 19:31Trading agents in its default configuration relies heavily on
- 19:34Open AI models for every single agents prompt completion.
- 19:38Every thought costs something. Pretty much every action an
- 19:40agent takes, every piece of text it generates, translates
- 19:43directly into an API call to Open AI.
- 19:46So you'll need an active, paid Open AI account to unlock the
- 19:49full functionality. This is where the ongoing API
- 19:52costs truly come into play, and it's a significant consideration
- 19:55we'll dive into more deeply very soon.
- 19:56OK, so environment setup keys in place.
- 19:58How do you actually run it? Once your development
- 20:00environment is fully configured with those keys, you're ready to
- 20:03launch the interactive command line interface or CLI program.
- 20:07You simply run Python dash M on client dot main in your terminal
- 20:11and this is where you, the user get to take the reins and truly
- 20:14customize your deep dive into market analysis.
- 20:17Right, this is where you pull the levers.
- 20:18It's an interactive interface that prompts you for several key
- 20:21inputs, letting you tailor the AI's analysis.
- 20:24First, it asks for the ticker you want to analyze.
- 20:26Correct. You can enter a single stock
- 20:28symbol like AAPL for Apple, or analyze multiple companies
- 20:31simultaneously, maybe NVDA, TSLA, AMD.
- 20:35If you provide multiple tickers, the framework smartly spins up a
- 20:37complete set of analyst agents for each one in parallel.
- 20:40Well, that's a ficken. Very.
- 20:41So for three stocks, you'd actually have 12 analyst agents
- 20:44running concurrently. It makes for a truly efficient
- 20:47workflow when analyzing a basket of stocks.
- 20:49What else does it ask for? Next, you'll specify the date
- 20:52for your analysis. This feature is particularly
- 20:55powerful for back testing or doing historical analysis.
- 20:58For instance, if you enter 2024 so 510, the agents will
- 21:02rigorously ensure they only use data that was available up to
- 21:06that specific date. So no cheating with future
- 21:08knowledge. Exactly.
- 21:09It allows them to make a hypothetical trading decision as
- 21:12if they were operating on that exact day in the past,
- 21:15critically without any knowledge of future events.
- 21:18This is fundamental for validating strategies against
- 21:21historical data without that foresight bias.
- 21:23OK, you can also choose which agents to include, right?
- 21:26This seems key for tailoring it. Absolutely.
- 21:28This is where you can fundamentally shape the
- 21:30analytical lens to your personal investment philosophy.
- 21:33You have the option to select all four analysts, perspectives,
- 21:36technical sentiment, news and fundamentals, or just a specific
- 21:40subset. Like if I'm a value investor I
- 21:42might ditch the technical guy. Precisely.
- 21:45If you're a pure value investor, you might decide to focus
- 21:47primarily on fundamentals, maybe add news for context, and
- 21:51explicitly exclude the technical or sentiment analysts.
- 21:54All together this offers incredible control over the
- 21:57input streams feeding the decision process.
- 21:59Then there's research depth. Shallow, medium or deep?
- 22:03What's the difference? This is another critically
- 22:06important lever, impacting both the quality of analysis and the
- 22:09cost. Deeper research means the agents
- 22:11will conduct a more thorough and iterative analysis, potentially
- 22:15involving multiple rounds of debate between the bullish and
- 22:17bearish researchers. More back and forth.
- 22:19Right. While this comes at the cost of
- 22:21more API calls and longer run times, the authors of trading
- 22:24agents actually suggest using the deepest setting for the best
- 22:27analytical results. If the associated costs aren't
- 22:30prohibitive for your specific use case, it's a direct trade
- 22:33off. Thoroughness versus expense.
- 22:35Makes sense. And finally you select the
- 22:38specific LMM models for quick deep thinking.
- 22:40Yes, by default these are Open AI models, and you'll often have
- 22:44choices like GPT 3.5 Turbo for quick tasks and GPT 4 for deep
- 22:48ones. The CLI even offers intelligent
- 22:51recommendations suggesting GPT 4-O Mini for quick thinking, an
- 22:55O1 preview for deep reasoning. Essentially, Open AI is latest
- 22:59faster, smaller model and their most powerful advanced reasoning
- 23:02model respectively. And the trade off there is
- 23:05quality versus cost speed. Exactly.
- 23:08Opting for higher end models like O1 Preview will generally
- 23:11yield better quality analysis and more sophisticated
- 23:13reasoning. But they come with increased
- 23:15latency, they take longer to respond, and, as we're about to
- 23:18explore, significantly higher API costs.
- 23:21OK, so once you've made all those choices, you hit go and
- 23:23trading agents starts crunching. Pretty much it springs into
- 23:26action. You'll see the agents progress
- 23:28and their detailed outputs unfolding directly in your
- 23:30terminal or potentially A dedicated web interface.
- 23:32If you've configured it that way, you might first see the
- 23:35fundamental analysts detailed pop up, then the sentiment
- 23:38analysts findings, and so on as they complete their tasks.
- 23:40And it all leads to. The entire multi stage process
- 23:43culminates in a comprehensive trading decision report.
- 23:47This report clearly tells you whether the system recommends
- 23:49buying, selling or holding the stock.
- 23:52Crucially, it provides A detailed, multifaceted rationale
- 23:56based on all the agent inputs and includes those thorough risk
- 23:59assessments from the risk management team.
- 24:01This is really the ultimate aha moment where all that AI driven
- 24:04analysis becomes tangible, actionable and distilled into a
- 24:08clear recommendation for you. Now when you hear about all this
- 24:11sophisticated AI and multi agent systems, you might immediately
- 24:13think, OK, this sounds like it needs a supercomputer to run.
- 24:17But here's the genuinely surprising and incredibly
- 24:19accessible truth about the hardware requirements.
- 24:21Yeah, you actually do not need a powerful dedicated GPU or any
- 24:26other specialized expensive hardware to run trading agents.
- 24:29That's right, that truly is a game changer for anyone looking
- 24:32to experiment with advanced AI and finance.
- 24:34So how does that work? Where's the heavy lifting
- 24:36happening? Well, all that complex natural
- 24:38language processing, the intricate reasoning, the Nuance
- 24:40debates, it's all performed remotely by the LLM API calls to
- 24:44Open AI or whichever cloud provider you choose.
- 24:47So your local machines primary role is simply orchestrating
- 24:50these calls, sending the prompts, receiving the
- 24:52responses, and doing some basic data processing like organizing
- 24:55the reports. So my laptop is just the
- 24:57conductor. Exactly.
- 24:59It's not particularly computationally demanding work
- 25:01for your local machine. It runs perfectly fine on
- 25:04standard CPU only systems. And the developers confirm this.
- 25:07Oh yes, they explicitly state that trading agents is designed
- 25:10to operate without the need for GPU's.
- 25:13Users have successfully run it on common everyday setups like
- 25:16laptops, even basic cloud VM instances.
- 25:19And if you happen to have an Apple Silicon Mac like a Mac
- 25:21Mini with an M1 or M2 chip, it's absolutely feasible and performs
- 25:25brilliantly. The Python code runs efficiently
- 25:28on Mac OS leveraging the M series chips.
- 25:30Strong single core performance for managing that orchestration
- 25:33overhead. So as long as you stick to using
- 25:35a cloud based LLMAPI like open AIS, your personal computer,
- 25:40Mac, Windows PC, Linux machine is essentially just a
- 25:44sophisticated remote control. That's a good way to put it.
- 25:47It sends prompts to the powerful AI models in the cloud and
- 25:50receives their intelligent responses.
- 25:52Your local hardware isn't doing the really heavy lifting.
- 25:55OK, but what about memory RAM? Does it need a lot?
- 25:59That's a good point. While it doesn't demand a
- 26:01powerful GPU, the memory footprint can grow, especially
- 26:04if you're running deeper analysis or processing multiple
- 26:07tickers concurrently. Why is that?
- 26:09Because a significant amount of text, all those agent prompts,
- 26:12their detailed outputs, the results of their debates, is
- 26:14constantly being passed around and temporarily stored in your
- 26:17system's RAM. So we'd recommend having at
- 26:19least a few gigabytes of free RAM available, maybe 8GB or
- 26:22ideally 16GB, just to ensure smooth operation and prevent any
- 26:26slowdowns, especially on those deeper runs.
- 26:28Got it. And this all changes if you
- 26:29decide to run the LLMS locally, right?
- 26:32Yes, it's important to note that this whole no special hardware
- 26:35needed picture changes fundamentally.
- 26:37If you decide to go a step further and run large language
- 26:40models locally on your own machine, that's a powerful
- 26:43option We'll discuss in more detail shortly.
- 26:45But in that scenario, your local hardware, particularly your GPU
- 26:49and system RAM, become significantly more relevant as
- 26:52you'd be performing the heavy inference directly on your
- 26:54machine. OK, that makes sense.
- 26:55Which brings us to a really critical point for anyone
- 26:58considering using trading agents extensively.
- 27:01The economics of AI investing. Because the framework relies on
- 27:04multiple LLM calls for every single investment decision,
- 27:07those API usage costs they can accumulate surprisingly quickly,
- 27:12can't they? They certainly can.
- 27:13Every agent invocation, every time an agent thinks or
- 27:16generates report. It's essentially a prompt
- 27:18completion call to a large language model, and those calls
- 27:21cost money based on token usage. So break it down, how many calls
- 27:25are we talking about for say 1 stock?
- 27:27OK, let's breakdown the typical API calls involved.
- 27:29For just one stock analysis, assuming all agents are enabled
- 27:34and you're running in deep research mode, you're looking at
- 27:36roughly 4 distinct analyst reports being generated, then at
- 27:40least two iterative researcher debates, and those themselves
- 27:44can involve multiple back and forth calls to refine their
- 27:47arguments. Add to that one comprehensive
- 27:49trader decision, one rigorous risk check, and potentially a
- 27:53final fund manager confirmation. This easily tallies up to
- 27:56anywhere from 7 to 10 separate LLM prompts for a single
- 28:00comprehensive run on just one stock.
- 28:02And maybe even more if it's doing complex.
- 28:04Stuff exactly. If you opt for that deep
- 28:06research mode which encourages those iterative rounds of debate
- 28:09and more complex, or if you enable online tools for real
- 28:13time data fetching which might be invoked by the LLMS, these
- 28:16processes can initiate additional internal steps
- 28:18leading to even more token usage.
- 28:20So it truly does mean lots of tokens being sent to and from
- 28:23the models, consuming both input and output tokens which both
- 28:26contribute to the cost. OK.
- 28:27So give us a rough ballpark on opening eyes pricing, what are
- 28:30we talking cost wise? Sure, based on say mid 2024
- 28:34early 2025 rates which can change.
- 28:36A model like GPT 3.5 turbo is approximately 01005 per 1000
- 28:41input tokens and 0001000 output tokens.
- 28:45So very cheap fractions of a cent.
- 28:47OK, and GPT 4. GPT 4, specifically the O1
- 28:50preview view model they recommend for deep thinking, is
- 28:52significantly more expensive. We're talking maybe $0.01 per
- 28:551000 input tokens and $0.03 per 1000 output tokens.
- 28:59So orders of magnitude more than GPT 3.5 tier models.
- 29:02So let's translate that. A single run on one stock using
- 29:05GPT 4 for everything? Yeah.
- 29:07What might that cost? OK, let's estimate.
- 29:09If each agent interaction consumes maybe 500 to 1000
- 29:12tokens and combined input and output, and you have those 710
- 29:15interactions, a single full comprehensive run on one stock
- 29:18utilizing only the expensive GPT 4 model for everything thing
- 29:21might consume roughly 5000 to 10,000 tokens total.
- 29:23That could translate to approximately let's say $2.00
- 29:25and $15.30 in GPT 4 API fees per single decision. 15 to $0.30 per
- 29:29stock analysis. That doesn't sound like much,
- 29:31but. Right, but if you're running
- 29:32hundreds of back tests or analyzing a portfolio of 50
- 29:35stocks daily, it adds up very very quickly.
- 29:38Now running everything with the cheaper GPT 3.5 equivalent would
- 29:41be significantly cheaper. Probably just pennies per run.
- 29:45So the developer recommendation makes sense.
- 29:46Use a mix. Exactly.
- 29:48The default recommendation from the developers.
- 29:50Is that smart mix? Use a cheaper model like GPT 4
- 29:52Mini for the simpler summarization tasks analysts and
- 29:56reserve the pricier, more powerful O1 preview model for
- 29:59the complex, nuanced decision making tasks trader risk
- 30:02manager. And this raises that important
- 30:04question for you, the listener, Yeah, what are the cost
- 30:06implications if you're planning to run many simulations, maybe
- 30:09for a large portfolio or extensive back testing?
- 30:11Yeah, the Trading Agents team explicitly recommends using
- 30:14smaller, cheaper models, especially for testing and
- 30:17development purposes. To dramatically save on these
- 30:20costs, use those O4 Mini or GPT 4.1 Mini equivalents.
- 30:24By adopting this pragmatic approach, you can significantly
- 30:27cut down on your expenses while you experiment.
- 30:30Then maybe reserve the stronger, more expensive models only when
- 30:33you absolutely require the highest quality analysis for
- 30:36final decisions or live simulation.
- 30:38You got to watch that budget. OK, so how do you get smart
- 30:42about your spending and effectively manage these API
- 30:45costs, ensuring you get the most intelligence for your buck?
- 30:48You mentioned the hybrid approach.
- 30:49What? Else right, the first and
- 30:51perhaps most intuitive strategy is that hybrid model allocation,
- 30:54assigning the cheaper, faster model like GPT 4 mini to the
- 30:57analysts and maybe researchers, then reserving the powerful O1
- 31:01preview for the critical trader and or risk manager roles.
- 31:03Because summarizing doesn't need the big guns, but the final call
- 31:06does. Precisely.
- 31:08Tasks like summarizing a financial report, identifying
- 31:11sentiment, computing a technical indicator generally don't
- 31:15require the most advanced reasoning.
- 31:16GPC 3.5 tier models handle those perfectly well.
- 31:20But making that new launch trading decision, reconciling
- 31:22conflicting signals, or performing a rigorous risk
- 31:25assessment that profoundly benefits from GPT 4's superior
- 31:29reasoning. This hybrid approach leverages
- 31:31the dual model design to optimize both performance and
- 31:34cost. OK.
- 31:35What's strategy #2? Another effective strategy is
- 31:38simply to limit the research depth.
- 31:40Remember those shallow, medium, deep settings?
- 31:43While those deep multi round debates are insightful, each
- 31:45extra round is more API calls, more tokens, more costs.
- 31:49Just dial it back, yeah. If cost is a primary concern,
- 31:52opt for the medium research setting instead of deep.
- 31:55Or you can manually configure the Max debate arounds parameter
- 31:58in the config file to a lower number, maybe even one, which is
- 32:01often the default anyway. This shortens the conversation,
- 32:04reduces calls. You might miss some deeper
- 32:06insights, but the cost scales down roughly linearly.
- 32:08It's a direct trade off. What about batching multiple
- 32:11tickers in one run? Does that save money?
- 32:13Not really. On the cost per analysis note,
- 32:15the CLI lets you analyze multiple stocks simultaneously,
- 32:18and it runs agents in parallel for each.
- 32:21While this doesn't reduce your total token usage, in fact it
- 32:24increases it because you're analyzing more stocks.
- 32:27Running them in parallel might be more convenient or faster
- 32:29overall. But Open AI doesn't give bulk
- 32:32discounts. Correct.
- 32:34Open AI fundamentally bills per token used, input and output, so
- 32:39there's no inherent bulk discount for processing more
- 32:42tickers in one command. It's more about convenience and
- 32:45parallel execution speed rather than direct cost reduction per
- 32:48analysis. OK.
- 32:49What about using other AI providers?
- 32:51You mentioned that briefly. Yes, that's a very compelling
- 32:53strategy, especially for initial experimentation actively
- 32:56considering alternative providers beyond open AI.
- 32:58Google's Palm Gemini API, for example, often has a very
- 33:01generous free tier, sometimes up to 60 requests per minute free,
- 33:05and frequently A substantial free credit like $300.00 for new
- 33:07users. Wow, that could cover a lot, a
- 33:09lot of testing. Absolutely, if you have access
- 33:11to that, using the Google back end could dramatically reduce
- 33:14your costs, potentially making initial experiments entirely
- 33:17free. The quality of Google's Gemini
- 33:20models is competitive and improving rapidly, though maybe
- 33:23not quite at GPT 4's absolute peak for every complex financial
- 33:27nuance yet Still 0 cost is hard to beat for trying things out.
- 33:31The trading agent stocks even show config snippets for
- 33:34switching easily. Any others?
- 33:35Similarly, Azure Open AI could be a viable option if your
- 33:39organization has enterprise credits or different pricing
- 33:41structures available through Microsoft Azure.
- 33:44It's worth investigating alternatives.
- 33:45OK. And the final, maybe most
- 33:47drastic strategy for cost cutting?
- 33:49Go local, running LLM's on your own terms.
- 33:51As we touched on, trading agents is flexible.
- 33:54Running your own LLM means you pay absolutely zero in ongoing
- 33:57API fees. But you pay in setup and
- 33:58hardware. Exactly.
- 34:00The cost shifts from recurring payments to the initial
- 34:03investment and effort in your local infrastructure plus
- 34:05electricity. You might need time and
- 34:07technical expertise to set it up, and inference runs could be
- 34:11slower than cloud APIs depending on your hardware.
- 34:14However, if you have an always on machine like a dedicated
- 34:16server or even just a powerful PC, you can host an open source
- 34:20model yourself and entirely avoid those persistent API fees.
- 34:24That sounds appealing for heavy users.
- 34:25It really is, especially if you plan to do a lot of runs, large
- 34:28scale back tests over years of data, or extensive iterative
- 34:32optimizations of your strategies.
- 34:34There are many excellent open source models available like
- 34:37LAMA, Mistral, Falcon which are generally free to use under the
- 34:40respective licenses. OK, so moving beyond just
- 34:43managing API costs, let's dive deeper into that local option.
- 34:46If you want to cut costs entirely, or maybe just keep
- 34:49your data private, running LLM's on your own hardware is the way.
- 34:53Yes, it's a very attractive option for those reasons.
- 34:56There are a couple of main ways to do it.
- 34:57The first and often much easier approach is to run an open AI
- 35:01compatible local server. How does that work?
- 35:03Tools like a Llama or LM Studio or local AI are fantastic for
- 35:07this. They allow you to download and
- 35:08host various open source models, different versions of Llama,
- 35:12Mistral, Mixtroll, even those DeepSeek distillations we'll
- 35:15talk about. And importantly, they expose a
- 35:17local API endpoint that precisely mimics open AI's.
- 35:20So trading agents doesn't even know the difference.
- 35:22Pretty much. Since Trading Agents is built to
- 35:24talk to Open AI's API format, you can simply point it to your
- 35:28local server's address, typically something like HTTP
- 35:30dot localhost .11434 V 1 for a llama, with just a couple of
- 35:35changes in the configuration file.
- 35:36That sounds surprisingly simple. It is quite elegant and what's
- 35:40really neat is that Trading Agents actually checks if the
- 35:42back end drill you provide is a local host address.
- 35:45If it detects a local server, it intelligently switches to use a
- 35:48local embedding model like Nomic Embed Text instead of calling
- 35:52out to open a IS embedding service.
- 35:54Even better for privacy and cost.
- 35:55Exactly. It keeps even more of the
- 35:57processing entirely local. So you primarily just change
- 36:00your config backing dual to your local server's URL and then
- 36:04specify the deep thinklm and quick thinklm to be the names of
- 36:08the models that your local server is hosting, like Llama 3
- 36:11or Mistral. OK, what's the second harder
- 36:13option? The second option is direct code
- 36:15modification. This is considerably more
- 36:17involved and generally not recommended unless you're a
- 36:20seasoned, developed developer comfortable digging into the
- 36:22framework score code. Why is it harder?
- 36:24Because trading agents is architected around making those
- 36:27standardized API calls directly integrating a Python based local
- 36:31model, say one loaded directly using the Hugging Face
- 36:34Transformers library, would require modifying the core
- 36:37trading agents graph code itself to bypass the API call structure
- 36:41and interact with the model directly in Python.
- 36:43It's doable since it's open source, but significantly more
- 36:46complex than just running that local API wrapper.
- 36:48The wrapper is usually the way to go.
- 36:50Gotcha. Now what about running really
- 36:52powerful cutting edge models like DeepSeek locally that
- 36:55generated a lot of buzz? Is that feasible on say, my Mac
- 36:58Mini? DeepSeek.
- 37:00That's been a big topic. The full original DeepSeek
- 37:03models, especially the huge 67 billion or even 670 billion
- 37:07parameter versions, are just too large for typical personal
- 37:10machines. They'd require multiple high end
- 37:13expensive GPU's or an enormous amount of RAM that most
- 37:15individuals simply don't have, and there aren't official
- 37:18smaller DeepSeek models released by the original creators that
- 37:21would readily run on standard consumer hardware.
- 37:24So no DeepSeek locally then? Not the original big ones.
- 37:27However, the open source community has ingeniously found
- 37:30a solution distilled smaller models.
- 37:33These are often 14 billion or even 8 billion parameter
- 37:36versions that other researchers or groups have trained to try
- 37:38and mimic the behavior of the much larger DeepSeek models.
- 37:42Smaller versions trained by others, can those run locally?
- 37:44Yes, these smaller versions can indeed be run on local hardware
- 37:47with sufficient memory. For instance, your Mac M2 or M3
- 37:51with 16 gigabyte or more of RAM could likely run an 8 to 13
- 37:54billion parameter model using something called 4 bit
- 37:57quantization. Quantization.
- 37:59What's that? It's basically a technique that
- 38:00compresses the model, making it significantly smaller in terms
- 38:03of memory usage, often allowing it to run on less RAM while
- 38:06retaining much of its capability.
- 38:08It uses the Max CPU or Apple's Metal GPU acceleration quite
- 38:12effectively. And are these easy to get
- 38:14running? Tools like a Llama, GPT 4 All,
- 38:16or LM Studio make it incredibly straightforward these days.
- 38:20You can often download these distilled models, including deep
- 38:23sick distillations, with just a click or a simple command and
- 38:26get them running through that local API wrapper almost
- 38:28immediately. Users often describe the process
- 38:31as remarkably straightforward or surprisingly easy now compared
- 38:35to how it used to be. So I could potentially use a
- 38:37distilled DeepSeek model with trading agents locally.
- 38:40Yes, most likely by running it through that open AI compatible
- 38:43API wrapper like a llama. Just point trading agents to
- 38:46your local A llama server running the DeepSeek model.
- 38:49However, it's important to manage expectations regarding
- 38:52the quality. A 13 billion parameter deep seat
- 38:54distilled model, while impressive for its size, might
- 38:58offer reasoning sophistication closer to GBT 3.5 than to A full
- 39:02top tier model like GPT four O 1 preview.
- 39:05So you might experience some degradation and highly complex
- 39:08decision making capabilities compared to using the best cloud
- 39:10models. It's a trade off.
- 39:12Are there other good open source models worth considering for
- 39:14local runs besides DeepSeek distillation?
- 39:17Oh absolutely. The Llama series from Meta,
- 39:19particularly Llama 3, is excellent.
- 39:21The 70 billion parameter Llama 3 model is very powerful, though
- 39:24it still needs a beefy machine or quantization on systems with
- 39:27maybe 32GB or 64GB of RAM. But the smaller Llama 38 B 8
- 39:33billion parameter version is fantastic, runs very well on
- 39:35machines with 16 gigabyte RAM like your Mac mini, and offers
- 39:38performance often considered competitive with or even better
- 39:41than GPT 3.5. South Llama Three AB could be a
- 39:44great local choice. Definitely a strong contender
- 39:46for local use with trading agents balancing performance and
- 39:48feasibility. Mistral and Mixedral models are
- 39:51also really popular and perform well locally.
- 39:53OK. So summing up the local option,
- 39:55the big benefit is cost and privacy, but the downside is
- 39:59setup, maybe speed and potentially slightly lower
- 40:02quality than the absolute top cloud models.
- 40:05That's the core trade off exactly.
- 40:07Running local LLM's means $0.00 ongoing API fees and enhanced
- 40:11privacy, which is huge for long term or sensitive use.
- 40:14But you might face increased setup complexity initially,
- 40:17potentially slower inference speeds depending on your
- 40:19hardware compared to highly optimized cloud API's, and maybe
- 40:23a slight step down in raw capability compared to the very
- 40:25top tier cloud models like GPT 4 or cloud three Opus.
- 40:29It's a balance you have to weigh cost and privacy versus
- 40:31convenience and cutting edge quality.
- 40:33This tape dive has truly highlighted the raw power and
- 40:36incredible flexibility of trading agents.
- 40:38It's really impressive stuff, but let's take it a step further
- 40:40now. What if you as the listener are
- 40:42deeply committed to a specific investment philosophy?
- 40:44How can we take this sophisticated AI system and
- 40:47tailor it to align precisely with a time tested approach like
- 40:49say, value investing? This is where the true
- 40:51customization magic happens, right?
- 40:53Absolutely. That's a truly fascinating
- 40:55application and a very relevant one for many investors.
- 40:59First, though, let's just make sure we're all on the same page
- 41:01regarding what we mean by value investing.
- 41:03Good idea. Lay it out for us, OK?
- 41:06So its core principle, famously championed by legends like
- 41:09Benjamin Graham and of course his most famous disciple Warren
- 41:12Buffett, is essentially about finding security stocks, usually
- 41:16that the market has undervalued. Buying things for less than
- 41:18they're worth. Exactly.
- 41:20This philosophy emphasizes looking beyond fleeting market
- 41:23trends and instead focusing intently on a company's
- 41:26fundamental strengths. It's solid earnings.
- 41:29It's tangible assets. It's consistent cash flows to
- 41:32determine its true or intrinsic value.
- 41:35And the key, the concept is margin of safety.
- 41:37That's the hallmark concept, yes, Margin of safety.
- 41:39This means intentionally buying a stock at a price significantly
- 41:42below it's calculated intrinsic value.
- 41:45That difference, that margin, provides a crucial cushion
- 41:48against potential errors in your analysis or unforeseen market
- 41:51downturns or just bad luck. And it's a long term game.
- 41:54Fundamentally, it's a long term hold strategy, one that
- 41:57deliberately downplays or even ignores short term market noise
- 42:01like daily price fluctuations, technical chart patterns, or
- 42:04momentary sentiment swings. In fact, true value investors
- 42:08are often contrarians. Buying when others are fearful.
- 42:11Precisely looking to acquire quality companies precisely
- 42:15during periods of widespread market pessimism, when others
- 42:18are selling in fear, because that's often when the biggest
- 42:20discounts, the widest margins of safety appear.
- 42:23OK, So that's value investing. How does trading agents as
- 42:27initially configured straight out-of-the-box aligned with this
- 42:30deeply ingrained philosophy? Does it fit at all?
- 42:33Well, it actually has a very direct link right away through
- 42:35its explicit, explicit fundamentals analyst.
- 42:37As we discussed earlier, this agent's entire role is to
- 42:40meticulously evaluate a company's financial health and
- 42:43identify stocks that appear undervalued or overvalued based
- 42:46on this core metrics. So it's doing the basic value
- 42:48screening. Exactly.
- 42:49This is precisely what a human value analyst would do,
- 42:52scrutinizing PE ratios, revenue growth, balance sheet strength,
- 42:56other intrinsic metrics to judge if the stocks current market
- 42:59price is justified by the underlying business strength.
- 43:02But I sense a but coming. But yes, the framework in its
- 43:06out-of-the-box design is definitely a bit of a hybrid.
- 43:10It also incorporates shorter term and non fundamental factors
- 43:13through its other analyst agents, the sentiment news and
- 43:16technical analysts. Things a pure value investor
- 43:18might ignore. Right.
- 43:20A strict value investor might, for instance, entirely
- 43:22deprioritize a temporary Twitter rumor causing a sentiment dip or
- 43:26a fleeting one day price breakout driven purely by
- 43:28technical patterns. However, trading agents,
- 43:31sentiment, and technical analysts do actively consider
- 43:34these signals in the default setup, so right out-of-the-box
- 43:36it's more of an ensemble of various investment philosophies
- 43:39rather than a pure unadulterated value strategy.
- 43:42So how does it behave in practice?
- 43:43Can it make value like decisions?
- 43:45It certainly can in its current form.
- 43:48If a stock is genuinely undervalued based on its
- 43:50financials, the fundamentals analysts will flag it as an
- 43:53opportunity. The bullish researcher would
- 43:55likely amplify this, building a case for a great long term buy.
- 44:00The trader agent seeing that strong fundamental case will
- 44:03then typically lean towards a buy decision so it can
- 44:06effectively mimic a value investors decision on an
- 44:09undervalued stock, especially if the fundamental evidence is
- 44:12really compelling. OK, but where do the deviations
- 44:15come in? When might it not act like a
- 44:17value investor? The deviations come into play
- 44:19precisely because Trading Agents is designed to listen to all its
- 44:22agents. By default it might override
- 44:24right or perhaps delay a purely value based buy decision if for
- 44:28example the sentiment analyst reports extremely negative
- 44:31public mood or the technical analysts flag strong bearish
- 44:34price patterns suggesting the price might fall further short
- 44:37term. Which a value investor might see
- 44:38is an even better buying opportunity.
- 44:40Exactly. A pure value investor might
- 44:43ignore those signals entirely, or even see extreme negative
- 44:46sentiment as an opportunity to buy an even cheaper bargain.
- 44:50Furthermore, the risk manager in its default setup focused on
- 44:52things like volatility, might veto a trade if the perceived
- 44:56market volatility for that stock is too high, even if the
- 44:58fundamentals are stellar. Whereas Buffett says volatility
- 45:01isn't risk. Right.
- 45:02This default behavior reflects more of a trading oriented
- 45:05mentality of balancing multiple factors and managing short term
- 45:08risk. Whereas value investing famously
- 45:10asserts volatility is not risk, permanent loss of capital is
- 45:13risk. If the fundamentals are sound,
- 45:15volatility can be your friend. OK, so this raises the big
- 45:18question, what exactly would it take to make trading agents
- 45:23truly value aligned to make it reflect the core principles of a
- 45:27gram or buffet? And the exciting part where the
- 45:29magic really happens for you, the listener, is that treating
- 45:32agents is extraordinarily configurable.
- 45:34You can quite literally program it, or perhaps better said,
- 45:37configure it with your specific investment philosophy.
- 45:40OK, let's dive into some concrete, actionable steps you
- 45:43could take to mold this AI into a dedicated value investor.
- 45:47What's step one? 1st and probably most impactful
- 45:50single change is you can heavily emphasize the fundamentals
- 45:53analysts output. This is about increasing the
- 45:56weight the importance that fundamental analysis carries in
- 45:59the final trading decision. How do you do that?
- 46:01Is it in the code? It's usually right in the
- 46:03configuration files within the frameworks config.
- 46:06Agents insights are often aggregated and you can assign
- 46:08numerical weights to each agents contribution.
- 46:11For example, the default might give Fundamentals maybe 40%
- 46:14importance, Technicals 30%, Sentiment 20%, News 10%
- 46:18something like that. So you just change those
- 46:20numbers. Exactly.
- 46:21To align with a pure value investing approach, you would
- 46:23dramatically shift those weights towards fundamentals.
- 46:25You might allocate say 70% or even 80% importance to the
- 46:28fundamentals analyst, perhaps 1020% to news for crucial macro
- 46:32context or company specific bad news, maybe zero, 10% to
- 46:36sentiment specifically to capture contrarian
- 46:37opportunities, and potentially even 0% for technicals if you
- 46:40want to completely disregard short term price signals.
- 46:43So the trader agent listens mostly to the fundamentals guy.
- 46:45Precisely this configuration ensures the trader agent
- 46:49prioritizes the fundamental analysts recommendations above
- 46:52all else, making technical or sentiment factors play only a
- 46:55minor or even negligible role in the final decision.
- 46:59OK, what else? Value investing is often about
- 47:01deep research. Right.
- 47:03So 2nd and vital for true value investing, you could aim to
- 47:07extend and deepen the fundamental analysis itself.
- 47:10A real value investor digs deep, often performing sophisticated
- 47:13discounted cash flow or DCF models, forecasting future cash
- 47:17flows and discounting them back to present value, or
- 47:20meticulously pouring over 10K filings, those detailed annual
- 47:23reports. Can the AI do that?
- 47:25Well, you could enhance the existing fundamentals agent.
- 47:28You could prompt it to use more advanced finance tools, perhaps
- 47:31by giving it access via an API to a service that calculates
- 47:34more sophisticated ratios, or even by prompting the LLM agent
- 47:37to perform simple high level DCF populations based on provided
- 47:41earnings forecast to estimate an intrinsic value.
- 47:44What about reading the actual reports?
- 47:46Giving the LLM agent access to the full text of 10K filings or
- 47:50maybe expertly summarized versions of them, perhaps via
- 47:53enhanced news feeds or specialized financial data, AP
- 47:56is would allow its analysis to be much more aligned with the
- 47:58rigorous deep dive research conducted by real world value
- 48:02investors. It helps move beyond surface
- 48:04level ratios to a more comprehensive understanding of
- 48:07the business model, competitive advantages of the Moat and long
- 48:10term prospects. Make sense?
- 48:13Third Point, value investing is famously patient.
- 48:15Absolutely crucial. Third, you need to drastically
- 48:18reduce trading frequency. Think long term.
- 48:21Value investing is inherently about long term holds, not daily
- 48:24or even weekly trades. So you'd adjust the framework to
- 48:27operate on a much longer time horizon.
- 48:29Change the execution cycle. Exactly.
- 48:31You might configure it to make investment decisions, say
- 48:33monthly or quarterly, instead of daily.
- 48:36Furthermore, the system could be specifically prompted to execute
- 48:39trades only when there's a truly significant margin of safety
- 48:42detected, A substantial gap between its estimated intrinsic
- 48:45value and the current market price.
- 48:47And prevent it from selling too soon.
- 48:48Yes, once a position is open based on value principles, you
- 48:52could enforce long term holds. You could instruct the AI,
- 48:55perhaps through the trader or risk manager prompts, not to
- 48:58churn or sell unless the fundamental investment thesis
- 49:01genuinely deteriorates, for example the companies Moat
- 49:05erodes, debt balloons, or the stock reaches its calculated
- 49:08fair value target triggering a planned exit.
- 49:11The frameworks, existing memory and reflection mechanisms could
- 49:14be explicitly used to maintain that long term context and
- 49:17prevent constant short term churning on a stock bought for a
- 49:21long term value reason. OK, .4 relates to risk, right?
- 49:24Value investors see risk differently.
- 49:26Definitely 4th. You can significantly adjust
- 49:28risk management to focus on fundamental risk rather than
- 49:31just price volatility. A value investors view of risk
- 49:34as we said is fundamentally different from a short term
- 49:36traders. It's more about the underlying
- 49:38business itself. Things like excessive debt, a
- 49:40crumbling competitive additive advantage, poor management,
- 49:43accounting flags, not temporary price fluctuations.
- 49:45Include the risk manager, agent. Precisely.
- 49:48You could fine tune the risk agents criteria mostly through
- 49:51its prompts to specifically scan for fundamental red flags.
- 49:55Things like signs of impending bankruptcy risk, unsustainable
- 49:58debt to equity ratios, a clear loss of competitive advantage,
- 50:02questionable accounting practices rather than simply
- 50:04reacting to market based volatility metrics like beta or
- 50:08recent price swings. So it won't panic sell a good
- 50:10company just because the market market is jumpy.
- 50:12Exactly. This would involve changing the
- 50:14prompt for the risk agent to emphasize fundamental red flags
- 50:18and long term capital preservation instead of purely
- 50:21short term market fluctuations or liquidity concerns that might
- 50:24trigger premature selling of a fundamentally sound but
- 50:26temporarily out of favor asset. It ensures the AI isn't scared
- 50:30out of a good long term position by short term market jitters.
- 50:33OK. Now here's a really creative and
- 50:34powerful idea you mentioned, incorporate a Warren Buffett or
- 50:38value mentor agent. Tell me more about that.
- 50:40Yeah, this is a fascinating possibility given the power of
- 50:43LLM's. It involves adding an entirely
- 50:46new LLM Persona agent explicitly designed to channel the
- 50:49principles and philosophy of a Legendary Value investor.
- 50:53Imagine an agent you create with a specific instruction, A
- 50:56carefully crafted prompt, like you are a Legendary value
- 50:59investor known for your patient, disciplined, rational approach.
- 51:03Your primary goal is to identify wonderful businesses trading at
- 51:06fair prices or fair businesses trading at wonderful prices,
- 51:09always demanding a significant margin of safety.
- 51:12You ignore short term market noise, speculation and emotional
- 51:15swings, focusing only on the underlying business
- 51:18fundamentals, management quality, competitive advantages
- 51:20and long term value creation. Wow, so this this agent would
- 51:24just argue for value all the time?
- 51:25Pretty much this new agent could either replace one of the
- 51:28existing researcher agents, maybe the bullish 1 gets a value
- 51:31focus, or perhaps act as an additional influential voice in
- 51:35the overall debate and decision making process.
- 51:37Its role would be to ensure strong, unwavering value
- 51:40perspective is always present in the discussion.
- 51:42Like having Buffett's ghost in the machine.
- 51:44Sort of. Such an agent would continually
- 51:47push the conversation towards long term value rational
- 51:50analysis and patience, potentially swaying the trader
- 51:53agent towards value aligned decisions when appropriate.
- 51:56It's a really interesting way to try and bake in that kind of
- 51:59human centric investing wisdom directly into the AI system.
- 52:04Very cool. And finally a very direct step
- 52:06related to the initial setup. Ignore or minimize technical
- 52:10analysis. Yes, a straightforward one.
- 52:12Many purest value investors outright dismissed technical
- 52:15chart analysis, considering it akin to reading tea leaves and
- 52:18utterly irrelevant to a company's intrinsic value or
- 52:21long term aspects. If you wanted to align trading
- 52:24agents with that purist view, you could simply disable the
- 52:27technical analyst agent entirely in the configuration or.
- 52:29Just give it 0 weight. Or just set its decision making
- 52:32weight to near 0 in the config file we discussed earlier.
- 52:34Effectively takes it right out of the equation.
- 52:36What about sentiment and news? Should a value investor ignore
- 52:39those two? Well, maybe not entirely.
- 52:41They could still be considered relevant to a nuanced value
- 52:44investing approach, particularly as contrarian indicators.
- 52:47You might choose to use them primarily for timing your
- 52:49purchases. How so?
- 52:50For example, if the sentiment analyst reports extremely
- 52:54negative public mood, and that's precisely why a fundamentally
- 52:57strong stock has become incredibly cheap, a savvy value
- 53:00investor might actually see that combination as an incredibly
- 53:03strong buy signal, not a reason to avoid the stock.
- 53:06Buying pessimism? Exactly, So you could
- 53:09specifically tweak the trader agents prompt to treat extreme
- 53:12negative sentiment combined with strong fundamentals as a
- 53:15definitive BUY signal. That's a classic contrarian
- 53:19value approach, using market irrationality to your advantage.
- 53:22The core take away here seems to be that the configurability of
- 53:24trading agents is really its key strength for this kind of
- 53:27tailoring. Absolutely.
- 53:29Most of these profound changes we've discussed, shifting
- 53:31weights, changing risk focus, even adding personas involve
- 53:34simply editing existing configuration files dot π or dot
- 53:38yaml usually, or adjusting the natural language prompt
- 53:41templates provided to the agents.
- 53:42So not necessarily heavy coding. Often not tweaking those agent
- 53:46weights in the config immediately changes influence
- 53:50editing the prompt templates for the risk manager can
- 53:52fundamentally shift its focus from volatility to fundamental
- 53:55solvency just by changing the instructions you give the LLM.
- 53:59And as we discussed, even adding a new custom agent like our
- 54:02Buffett agent is entirely possible.
- 54:04Within the flexible lane graph structure.
- 54:07You'd essentially define a new node for your agent and wire its
- 54:10output into the traders decision process.
- 54:12It's designed for this kind of modification.
- 54:15This approach then creates a truly powerful hybrid, isn't it,
- 54:18marrying the best of both worlds?
- 54:20It really does. You can stay rigorously true to
- 54:22fundamental value principles, picking the right companies
- 54:25based on their underlying strength and value, while still
- 54:28intelligently leveraging the AI's unique ability to process
- 54:31real time news, engage broader market mood, perhaps for
- 54:34optimizing your entry points or spotting fundamental red flags
- 54:37faster. Imagine having the fundamental
- 54:39wisdom to select truly great companies, but then leveraging
- 54:42AI's real time processing to pinpoint the perfect moment to
- 54:45invest. Maybe when market irrationality
- 54:48creates an even bigger discount than usual.
- 54:50That's a synergy that could genuinely redefine how you
- 54:52approach investment decisions. It combines timeless principles
- 54:56with cutting edge execution capabilities.
- 54:58So after this extensive deep dive, let's try and crystallize
- 55:01our key takeaways about trading agents, this remarkable
- 55:04intersection of AI and finance. First, what's the big picture?
- 55:081st, it's clearly a powerful modular AI powered virtual
- 55:12trading team. It brilliantly showcases how
- 55:15these multi agent large language models can collaborate and
- 55:18dynamically interact to tackle incredibly complex, multifaceted
- 55:21tasks like stock trading. It effectively simulates the
- 55:24entire workflow of a sophisticated financial firm
- 55:26using AI. OK, second key take away costs
- 55:28seem crucial. Yes, second, costs are
- 55:32undeniably a significant factor when relying on API driven LLMS
- 55:35like Open AIS. Each intelligent decision, each
- 55:38nuanced analysis comes at a price in terms of token usage,
- 55:42and it can add up fast. However, as we've explored,
- 55:45there are numerous smart strategies to manage these costs
- 55:47effectively, like intelligently using cheaper models for less
- 55:51critical tasks, limiting the depth of analytical research,
- 55:54or, for the ambitious or heavy users, transitioning to running
- 55:57open source LLMS locally on your own hardware.
- 56:00To eliminate those API fees entirely, cost management is
- 56:03doable. 3rd and maybe most exciting for our listeners. 3rd,
- 56:07and perhaps most exciting for you, the individual investor or
- 56:10analyst, the framework is incredibly flexible and
- 56:12adaptable. It's definitely not a rigid
- 56:14black box. It can be deeply configured and
- 56:16customized to align with your specific investment
- 56:18philosophies, whether that's value investing, growth
- 56:21investing, technical trading, or even some nuanced blend.
- 56:24So you can program its wisdom. In a way, yes.
- 56:27You can actively shape its behavior by adjusting agent
- 56:30weights, refining the prompts that guide their thinking, and
- 56:32even introducing entirely new AI persona agents that embody a
- 56:36particular investing wisdom or strategic approach.
- 56:39It truly is a tool you can configure to reflect and enhance
- 56:42your own financial intelligence. And 4th word of caution. 4th
- 56:47Yes. It's crucial to remember that
- 56:48Trading Agents is primarily A sophisticated research tool, not
- 56:52some kind of black box Oracle that guarantees profitable
- 56:55trades right out of the gate. It requires careful
- 56:57configuration, thoughtful prompting, and a deep
- 57:00understanding of its underlying mechanisms and limitations.
- 57:03It's an assistant, not a magic bullet.
- 57:04Exactly. It's a powerful assistant for
- 57:07market analysis, for generating ideas, for testing strategies,
- 57:10but not a magic bullet that makes decisions for you without
- 57:12any critical oversight or validation.
- 57:15The authors themselves explicitly caution against using
- 57:17it for actual, real money trading without further
- 57:20extensive due diligence, testing, and likely significant
- 57:22customization and validation specific to your needs.
- 57:25So as you explore this fascinating and rapidly evolving
- 57:29intersection of artificial intelligence and finance, here's
- 57:32our final thought for you to Mull over.
- 57:35If an AI system like trading Agents can be taught, or at
- 57:37least configured to think with the wisdom, the discipline, and
- 57:40the core principles of a legendary value investor, what
- 57:44other complex human reasoning processes, what other forms of
- 57:47distilled wisdom or ethical frameworks can we potentially
- 57:50distill, embed, and empower within these increasingly
- 57:53intelligent systems? That's a deep question.
- 57:56Consider how this blend of deep methodical analysis and
- 57:59strategic, perhaps even contrarian timing, all enabled
- 58:02by AI, could redefine not just how we approach investing, but
- 58:05maybe any information heavy decision making process in your
- 58:08professional or even personal life, What stands out to you
- 58:11with the very idea? Building an AI with a specific
- 58:13philosophy or perhaps even an ethical framework guiding its
- 58:16actions? Something to think about.
- 58:18Definitely food for thought and just a quick disclaimer for our
- 58:21listeners. All analysis presented here in
- 58:23this deep dive is based on publicly available sources,
- 58:26primarily the Trading Agents paper and repository, and may be
- 58:29subject to revisions or differing interpretations.
- 58:32The content is strictly for educational and informational
- 58:35purposes only and absolutely does not constitute investment
- 58:38advice. Please always conduct your own
- 58:41thorough due diligence before making any investment decisions.
- 58:43Well said. If you enjoyed this deep dive
- 58:45and found it valuable, please do us a favor like and subscribe to
- 58:49the deep dive on Apple Podcasts, Spotify, or our YouTube channel,
- 58:52which is deep value investing. And don't forget to grab the
- 58:55comprehensive book list of essential value investing
- 58:57resources that we've compiled for you.
- 58:59The link is available right in this episode's description.
- 59:01And finally, if you'd like to support our work here and help
- 59:03us bring a powerful Buffett Indicator App alive, a tool
- 59:07designed to distill Warren Buffett's insights on overall
- 59:09market valuation into a daily, actionable metric for investors,
- 59:13please consider contributing to our GoFundMe campaign.
- 59:15You can find the link at gofundme.com/order.
- 59:18Turning Buffett's wisdom into a daily tool for investors.
- 59:21Your support directly helps us continue to bring you these in
- 59:24depth explorations and develop practical tools for the
- 59:26investing community. We really appreciate it.