← Back to selected work

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.

Decision signalRAG / MODEL 10
notebook · HOLD · mediumdeck · SELL · lowBUYHOLDSELL
HOLD → SELLTSLA, two runs: the signal moved and confidence fell
Model chart / RAG pipelineModernBERT → Gemma 3

Ingest

  1. Yahoo Finance10 news items per ticker
  2. Chunk500-character pieces
  3. ModernBERT768-d embeddings
  4. MongoDB Atlasvector index, cosine

Query

  1. Ticker“what news suggests it may rise or fall?”
  2. ModernBERTquery vector, 768-d
  3. Vector searchtop 5 articles retrieved
  4. Gemma 3 1Bsignal · confidence · reasoning
ingest once, query per ticker
Pipeline as built in the notebook · after the ticker is entered, retrieval and generation run without human input
768embedding dimensions
Top 5articles retrieved per query
10news items per ticker

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.

The intended user is a junior equity research analyst. The tool is scoped as research triage. It is not an execution system, no capital is allocated on its output, and every signal needs analyst review.

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.

The evidence is visible, and the answer moves.

For TSLA, the notebook run retrieved these five articles, ranked by cosine similarity to the question.

Notebook run · TSLA · top five retrieved articles
ArticleSimilarity
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 Stock0.838
Alphabet flops, Intel shocks, and Tesla tanks: AlphaSpace weekly recap0.838
Dow Jones Futures: Market Triggers Sell Signal; Apple Earnings, Iran News, Fed Meeting In Focus0.822
Ranking the Best "Magnificent Seven" Stocks to Buy Right Now0.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.

Same ticker, different answer. Both outputs are plausible readings of their articles, which is the point: without a backtest there is no way to say which one, if either, was right.

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.

Limitations and risks, from the team deck
RiskWhat it means
No backtestSignals are not validated against realised returns, so accuracy is unmeasured.
Retrieval gapsCoverage depends on one news feed; thin coverage produces no usable signal.
HallucinationThe model can assert a factor the articles do not support. Grounding reduces this, but not to zero.
Recency biasOnly recent news is retrieved, so there is no memory of how similar news resolved.
No position contextThe agent does not know the portfolio, cost basis, risk limits or mandate.
Regulatory exposureAutomated investment output touches suitability and record-keeping. Production use needs compliance review.

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.