10 / AI in finance / Agentic RAG
Agentic Trading Signal
A team-built agent that turns a ticker into a BUY, HOLD or SELL with its reasoning, by retrieving financial news from a vector index. It is a research-triage prototype, and it has not been backtested.
Ingest
- Yahoo Finance10 news items per ticker
- Chunk500-character pieces
- ModernBERT768-d embeddings
- MongoDB Atlasvector index, cosine
Query
- Ticker“what news suggests it may rise or fall?”
- ModernBERTquery vector, 768-d
- Vector searchtop 5 articles retrieved
- Gemma 3 1Bsignal · confidence · reasoning
01 / The question
Can an agent triage the news an analyst can't read?
Price and financial-statement data are structured and largely priced in by the time they reach a screen. The earliest signal often sits in unstructured news: earnings coverage, press releases and commentary, at a volume no analyst covering 30 or more tickers can read. The project asks how to retrieve and analyse investment-relevant information from that stream automatically.
02 / What the agent does
One ticker in, a reasoned signal out.
Yahoo Finance news for the ticker (10 items) is split into 500-character chunks and embedded with ModernBERT (nomic-ai/modernbert-embed-base, 768 dimensions). The vectors are stored in a MongoDB Atlas collection with a vector index. A question such as “What recent news suggests that TSLA stock may rise or fall?” is embedded the same way, and a vector search returns the top five articles.
Gemma 3 1B Instruct then receives only those articles and is told not to use outside knowledge. It returns a signal (BUY, HOLD or SELL), a confidence level (LOW, MEDIUM or HIGH) and three to five sentences of reasoning. A Gradio front end wraps the pipeline, and a longer version adds a FinBERT sentiment reading alongside Gemma. The team's deck explains why the two jobs are split: FinBERT can classify sentiment but cannot generate reasoning or a structured signal.
03 / What it produced
The evidence is visible, and the answer moves.
For TSLA, the notebook run retrieved these five articles, ranked by cosine similarity to the question.
| Article | Similarity |
|---|---|
| Tesla Sank 15% on Its Q2 Miss. Wall Street's Average Price Target Now Implies 29% Upside. | 0.862 |
| Tesla's Revenue Beat Hid The Number That Actually Sank The Stock | 0.838 |
| Alphabet flops, Intel shocks, and Tesla tanks: AlphaSpace weekly recap | 0.838 |
| Dow Jones Futures: Market Triggers Sell Signal; Apple Earnings, Iran News, Fed Meeting In Focus | 0.822 |
| Ranking the Best "Magnificent Seven" Stocks to Buy Right Now | 0.814 |
From those articles the model returned HOLD at MEDIUM confidence, citing the Q2 earnings miss and the cash burn against the revenue beat and a higher analyst price target. The team's dashboard example for TSLA, run on a different set of articles, shows SELL at LOW confidence, with the negative factors cited as the earnings miss, negative free cash flow and reliance on AI and robotics projects. The deck reports about five seconds end to end on a T4 GPU. For NEE, thin retrieval produced HOLD at LOW confidence, which the deck uses as the case for an explicit “insufficient evidence” state.
04 / What it can't claim
The limits are part of the design.
The team's deck lists the risks plainly, and they define how far the output can be trusted.
| Risk | What it means |
|---|---|
| No backtest | Signals are not validated against realised returns, so accuracy is unmeasured. |
| Retrieval gaps | Coverage depends on one news feed; thin coverage produces no usable signal. |
| Hallucination | The model can assert a factor the articles do not support. Grounding reduces this, but not to zero. |
| Recency bias | Only recent news is retrieved, so there is no memory of how similar news resolved. |
| No position context | The agent does not know the portfolio, cost basis, risk limits or mandate. |
| Regulatory exposure | Automated investment output touches suitability and record-keeping. Production use needs compliance review. |
05 / What to change next
Measure the signal before trusting it.
The next step the team names is a backtest of signals against realised returns, then widening the news sources beyond a single feed and adding an explicit insufficient-evidence state. Two further changes would make the results checkable: log the retrieved articles alongside every signal, so runs like the two TSLA outputs can be compared, and record batch results in the notebook (tickers covered, articles embedded, signal mix), because the deck's coverage figures and its note that signals skew heavily to HOLD are not backed by a results table in the files.