Personal Project · AI / Investing

StockPickerV3 — An Agentic Value Investor

Automating investment decisions with an AI agent guided by value investing principles

March 2026  ·  v3.0

The Starting Point

I have made a few attempts to achieve a fairly automated investing scheme for my savings. With two successful models of my discounted cash flow model earning a cumulative average of 50% over the last 2 years, it was about time I improved it with some agentic workflows.

With the current geopolitical unrest, it is important to consider all aspects of an investment. Time which I would rather spend on something else.

LLMs have proven to grow smarter each month at an exponential rate. Hence, it seemed like a fun experiment to let an LLM handle all decision making. This said, LLMs, as of now, have a habit of hallucinating — extrapolating from existing data to conclusions it does not have the evidence for, at an unreasonable rate.

However, with proper tool calling and reasoning with context, I have found that the LLM can be a very useful tool for making investment decisions.

The prior two versions of this model produced a cumulative average return of around 50% over two years — a reasonable result, but one achieved without any real-time reasoning or adaptability.

The Safety Net — A Simulated Portfolio

To start off I need to initialise a few safety nets. The agent is not allowed to invest in real stocks. Instead I have built a simulated stock market. The agent is allowed to execute stock transactions within this sandbox while I monitor its performance.

Every buy, sell, and deposit is recorded to a transaction log. A portfolio snapshot is computed from this log at any time, tracking the current price of each holding, unrealised profit/loss using FIFO cost basis, and available cash. The agent can inspect this portfolio before making any decision.

"Prices are offers, not instructions. Volatility is not risk. Never sell because a price falls — hold and wait for the fundamentals to be proven right."

How It Works

The system is structured as a main agent that orchestrates analysis and execution, supported by specialised subagents for deep research tasks. The main agent reasons over the full investment picture and delegates heavy computation to the right tool at the right time.

Key Features

📊

Probabilistic Cash Flow Valuation

Simulates thousands of possible futures from real free cash flow history, then estimates intrinsic value across a range of outcomes — conservative to optimistic — rather than pinning everything to a single number.

📂

Direct SEC Filing Access

Pulls 10-K and 10-Q financials directly from SEC EDGAR. The agent can also read 8-Ks, insider Form 4 trades, and beneficial ownership filings in real time.

🧠

Persistent Memory

The agent writes its findings and reasoning to a memory file between runs. Next time it runs, it reviews prior conclusions before deciding whether any changes are actually warranted.

🌐

Web Search Integration

A dedicated subagent scours the web for recent news, earnings commentary, competitive developments, and macro context — anything that could materially affect long-term business value.

💼

Simulated Portfolio Engine

Full transaction log with FIFO cost basis tracking, real-time price fetching, unrealised P&L per position, and available cash management.

⚙️

Context Summarisation

As the agent's reasoning grows long, a summarisation middleware compresses older context automatically — keeping the agent focused without losing key findings.

The Investment Philosophy

The agent is not a trader. It is programmed as a value investor with a 3–5 year time horizon. Before any trade is executed, every item on a strict checklist must pass:

If any single item fails, no trade is made. Cash is held until a genuine opportunity appears. The primary directive is simple: preserve capital first, grow capital second. Never reverse this order.

The agent holds a concentrated portfolio of 3–10 positions plus cash. It never deploys all cash at once, never chases momentum, and never sells a position just because the price has fallen — only if the underlying business has fundamentally deteriorated.

What's Next

The current version runs as a sandbox experiment. The goal is to run it over a full market cycle and compare the simulated returns against the prior DCF models and the broader market. If it performs well under real conditions — managing volatility, avoiding permanent losses, and compounding steadily — the next step would be cautious deployment with a small real capital allocation.

The broader hypothesis being tested is simple: can a disciplined, rule-bound AI agent outperform the average retail investor not by being smarter, but by being more patient and less emotional?