Skip to content
All library documents

Multi-Agent Workflow for Buffett-Inspired Value Investing

Article Lumibot

Summary

This example describes an AI-assisted value-investing workflow inspired by Warren Buffett’s public approach. One agent reviews filings and assesses business quality, cash generation, balance-sheet strength, and durability. A second challenges the valuation and asks whether the share price leaves a margin of safety. A portfolio manager then checks the account and order state and decides whether to hold or size a company that passes both reviews, with an individual holding capped at 20% of portfolio value.

The document says the workflow’s source check reads an actual company filing through EDGAR, while daily prices come from Yahoo. It describes how the example can be run with a broker connection or in backtest mode, but reports no investment results, benchmark comparison, or validation of the agents’ judgments. The Buffett framing is inspiration rather than replication, and the brief description does not specify how business quality or fair value is quantified. Its trading output therefore depends on the quality of agent analysis and the reliability of account and market data.

Key ideas

  • A research agent assesses business quality, cash generation, filings, and durability.
  • A separate valuation reviewer challenges the price and tests for a margin of safety.
  • The portfolio manager acts only when the business and valuation cases both pass review.
  • The example caps a qualified holding at 20% of portfolio value and checks account and order state.
  • The document describes data sources and operating modes but gives no performance evidence or valuation formula.

Tags

Full text
# agents example warren buffett value


Warren Buffett Value AI Trading Team
====================================

.. meta::
   :description: This strategy is inspired by Warren Buffett's public investing style: understand the business first, read the filings, care about durability, avoid overpaying.

.. image:: ../docs/assets/ai-trading-team-workflows/warren-buffett-value.png
   :alt: AI trading team workflow for Warren Buffett value style investing
   :width: 100%

This strategy is inspired by Warren Buffett's public investing style: understand
the business first, read the filings, care about durability, avoid overpaying,
and only act when the idea is strong enough to own. The point is not to clone
Buffett. The point is to show how AI agents can divide a value-investing process
into research, skepticism, and final portfolio action.

The first agent behaves like an annual-report reader. It looks for business
quality, cash generation, balance-sheet strength, and durability. The second
agent plays valuation skeptic and asks whether the price still leaves a margin
of safety. The portfolio manager only trades if the business-quality case and
valuation discipline both survive.

How the team works
------------------

* ``annual_report_reader`` studies business quality, cash flow, filings, and durability.
* ``valuation_skeptic`` challenges valuation and asks for a margin of safety.
* ``portfolio_manager`` is the dedicated trading-and-risk agent. It verifies account and order state, then holds or sizes one qualified compounder to at most 20% of portfolio value.
* The source proof calls ``get_filings`` and ``get_filing_section`` on a real EDGAR 10-K before it holds. Yahoo supplies the daily prices.

Run it with a broker
--------------------

The file defaults to broker-connected execution. With Alpaca, it runs in paper
mode unless you set ``ALPACA_IS_PAPER=false``.

.. code-block:: bash

   export OPENAI_API_KEY='your-key-here'
   export ALPACA_API_KEY='your-alpaca-key'
   export ALPACA_API_SECRET='your-alpaca-secret'
   export ALPACA_IS_PAPER=true
   python lumibot/example_strategies/ai_trading_team_warren_buffett_value.py

Backtest it
-----------

Use the same strategy class and change ``IS_BACKTESTING = False`` to ``IS_BACKTESTING = True`` in the runner:

.. code-block:: bash

   export OPENAI_API_KEY='your-key-here'
   python lumibot/example_strategies/ai_trading_team_warren_buffett_value.py

Example code
------------

.. literalinclude:: ../lumibot/example_strategies/ai_trading_team_warren_buffett_value.py
   :language: python

Shown in full with attribution under the source's licence. Licence: GPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.