Skip to content
flyaurelienPublic

About

One ticker in, one institutional-grade pre-market research briefing out — point-in-time macro, technicals, fundamentals, SEC filings and news, with optional local-LLM analysis.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

daybrief

One ticker in. One institutional-grade pre-market briefing out.

daybrief turns a stock symbol into the research dossier a dedicated trader would want in hand five minutes before the US open: macro regime, multi-timeframe technicals with the pre-market gap, dated fundamentals and analyst actions, SEC filings (index + full text of the latest 10-K/10-Q/8-K), and the complete overnight news flow — all filtered to what was knowable strictly before 09:25 ET. Optionally, your local LLM reads the whole thing and writes the morning note.

$ pip install git+https://github.com/flyaurelien/daybrief
$ daybrief AAPL

Below is genuine output (excerpted) for Monday 2026-07-27. The complete ~21,000-token briefing, SEC full text and charts included, is in examples/AAPL_2026-07-27.md.

> Briefing depth: ~21,173 tokens of point-in-time input (13 articles + SEC filings
> + dated fundamentals + macro tape + 3 charts).

# Pre-market briefing - AAPL - Mon 2026-07-27

## Timeline of this trading day
| Moment | When (Eastern) | Notes |
|---|---|---|
| Previous session close | Fri 2026-07-24 (3 days before) 16:00 ET | the news window opens here |
| **Decision moment** | **Mon 2026-07-27 (today) 09:25 ET** | everything predates this instant |
| Regular open | Mon 2026-07-27 09:30 ET | 5 minutes after the decision moment |
| Regular close | Mon 2026-07-27 16:00 ET | standard session; 6.5h of trading |
| Next session | Tue 2026-07-28 (in 1 day) | anything held overnight carries into this |

## Macro & market regime
MARKET CONTEXT (SPY), through the close of Fri 2026-07-24 (3 days before):
5 sessions -0.6% (vs close of Fri 2026-07-17), pre-market +0.81% as of
Mon 2026-07-27 08:31 ET (54min before the decision moment) - neutral.
- VIX (fear): 18.70 (+12.4% d/d)      - US 10Y yield: 4.70 (+1.0% d/d)

## Technicals (multi-timeframe)
### Reference session: Fri 2026-07-24 (3 days before)
- prior close $333.05, settled at 16:00 ET that day
- ATR(14) $7.80 (~2.3% of price) - the yardstick for intraday targets and stops
### Performance, each measured from a dated session
- 1 session: +3.6% (vs close of Thu 2026-07-23 (4 days before))
- 20 sessions: +21.0% (vs close of Thu 2026-06-25 (32 days before))
### Range
- 20-session range $274.25 (low Fri 2026-06-26) to $334.98 (high Fri 2026-07-17)
  -> prior close sits at 97% of that range
### Pre-market on Mon 2026-07-27, 04:00 ET -> 09:25 ET cutoff
- last pre-market print $333.93 at Mon 2026-07-27 08:43 ET (42min before the open)
- GAP +0.26% vs the 2026-07-24 close of $333.05

## Fundamentals & analyst actions
**Rating changes in the 45 days before the decision moment:**
  - Thu 2026-07-23 (4 days before): Morgan Stanley main -> Overweight
  - Fri 2026-07-17 (10 days before): HSBC up -> Buy

## SEC filings index (last 6 months)
- **Fri 2026-05-01 (87 days before)** `10-Q` - quarterly report

## News (point-in-time window: 2026-07-24 16:00 ET -> 2026-07-27 09:25 ET)
1. **Fri 2026-07-24 16:03 ET (2 days 17h before the open)** [ ] - Oil Broke $100,
   Alphabet's AI Bill Scares Investors: What Moved Wall Street This Week (benzinga)

Note the discipline on time: no timestamp is ever purely relative. "4 days before" always travels with Thu 2026-07-23, because an agent sizing an entry should never have to infer what "recent" meant.

Charts

Three figures are rendered from the same point-in-time bars as the text, so a chart can never show what the text couldn't. Vision-capable local models read them directly (--vision).

AAPL daily candles

AAPL pre-market

Why this exists

LLMs are surprisingly good at reading a dense research pack and reasoning about it — but they are only as honest as their inputs. Most "AI stock analysis" pipes in whatever data is lying around today, which quietly leaks the future into any historical evaluation. daybrief was extracted from a private trading-agent system where the briefing is the entire information diet of an autonomous pre-open decision maker, so it is built around one obsession:

Point-in-time correctness. Ask for --date 2026-07-18 and every section is reconstructed from data dated before that day's open: news queried with a historical window, filings filtered by filing date, insider trades embargoed by the Form 4 filing delay — and every undated source (analyst price targets, valuation snapshots) is excluded outright rather than silently contaminating the past.

That makes briefings usable both as a daily research tool and as honest inputs for backtesting an LLM-driven strategy.

Features

  • Zero-config start — works with no API keys at all (free Yahoo Finance path). Each optional key unlocks a better data path; every degradation is explicit in the output, never silent.
  • Point-in-time news — with free Alpaca paper keys, the news section is queried with a historical window: exactly the articles that existed between the prior close and 09:25 ET.
  • SEC EDGAR full text — the latest 10-Q, 10-K and recent 8-Ks, stripped to plain text and packed into a configurable size budget (the briefing's "elastic" section).
  • Absolute dates everywhere — every timestamp carries its weekday, ISO date, Eastern-time clock and distance from the 09:25 ET decision moment, plus a timeline table of the session (previous close, decision moment, open, close, next session). Bare "5d ago" never appears.
  • Charts for vision models (-o renders them; --vision sends them) — daily candles with SMA20/50 and volume, the pre-market tape against the prior close, and normalized performance vs peers. Same point-in-time bars as the text.
  • Readable filings — inline-XBRL tagging noise (xbrli:shares, taxonomy URIs, context ids) is stripped, and extraction starts at the document's real cover page instead of the machine-readable header.
  • Self-explaining sections — each section opens with one italic line saying what it contains and how to read it, for humans and models alike.
  • Local-LLM morning note (--analyze) — any OpenAI-compatible endpoint (LM Studio, Ollama, llama.cpp, vLLM). Catalyst, tape, timed risks, a lean, and ATR-sized target/stop zones. Your data never leaves your machine.
  • Prompt-injection hygiene — scraped third-party text (news bodies, filing text) is wrapped in explicit UNTRUSTED EXTERNAL CONTENT fences, and the bundled analyst prompt instructs the model to treat it as data, never as instructions.
  • Fails loudly — an unreachable LLM or a non-trading day is a clear error, never an empty-looking "neutral" output.
  • Library or CLI — await build_briefing("NVDA") returns a structured object (markdown + per-section dict) for your own pipelines; --json on the CLI gives the same.

Install

pip install git+https://github.com/flyaurelien/daybrief
# or, for development:
git clone https://github.com/flyaurelien/daybrief && cd daybrief
pip install -e ".[dev]"

Requires Python ≥ 3.11.

Usage

daybrief AAPL                           # today's briefing -> stdout
daybrief AAPL -o briefs/                # write briefs/AAPL_2026-07-23.md
daybrief AAPL --date 2026-07-18         # historical, strictly point-in-time
daybrief NVDA --peers AMD,AVGO,TSM      # add a relative-strength section
daybrief AAPL --analyze                 # + morning note from your local LLM
daybrief AAPL -o briefs/ --analyze --vision   # also send the charts to a vision model
daybrief AAPL --json > aapl.json        # structured output
daybrief AAPL --no-sec-fulltext         # small & fast (skip filings full text)
daybrief AAPL --no-charts               # text only
daybrief AAPL --target-chars 60000      # fit smaller LLM context windows

As a library:

import asyncio
from daybrief import build_briefing
from daybrief.llm import analyze

async def main():
    b = await build_briefing("GOOGL", peers=["MSFT", "META"])
    print(b.approx_tokens, b.n_articles)
    print(b.sections["technicals"])
    note = await analyze(b)   # needs a local LLM server running
    print(note)

asyncio.run(main())

Configuration

Copy .env.example to .env (or export the variables). All keys are optional.

Variable Default Unlocks
ALPACA_API_KEY_ID / ALPACA_API_SECRET_KEY – Real-time IEX bars, exchange calendar (holidays + half-days), point-in-time news. Free paper keys; market-data only — daybrief contains no trading code.
DAYBRIEF_EDGAR_CONTACT – SEC filings sections. The SEC requires a contact email in requests — set one you own.
DAYBRIEF_LLM_URL http://localhost:1234/v1 The --analyze endpoint (LM Studio default; Ollama: http://localhost:11434/v1).
DAYBRIEF_LLM_MODEL (server's first model) Model name for --analyze.
DAYBRIEF_TARGET_CHARS 150000 Total briefing budget (~4 chars/token). SEC full text absorbs the slack.
DAYBRIEF_MAX_ARTICLES 40 News cap — overflow keeps the newest articles.

How a briefing is built

              ┌────────────────────────────────────────────────┐
 ticker ──────►  trading-day calendar (Alpaca / weekday fallback)
 (+ date)     │  09:25 ET point-in-time cutoff                 │
              └───────────────┬────────────────────────────────┘
        ┌─────────────┬───────┴──────┬──────────────┬───────────────┐
        ▼             ▼              ▼              ▼               ▼
   macro regime   technicals    fundamentals   SEC filings    overnight news
   SPY + VIX/     bars, SMA,    earnings,      index + full   point-in-time
   rates/oil/     ATR, ranges,  ratings,       text 10-K/     window, digest
   gold tape      pre-mkt gap   insiders       10-Q/8-K       + full bodies
        └─────────────┴──────┬───────┴──────────────┴───────────────┘
                             ▼
                    markdown briefing  ──► (optional) local LLM morning note

Full documentation lives in docs/: Configuration · Data sources · Anatomy of a briefing · Point-in-time correctness · Local LLM setup

FAQ

Does it place trades? No. There is deliberately zero order/trading code in this repository. It produces research documents.

Is the data free? Yes — Yahoo Finance, SEC EDGAR, and Alpaca's free IEX feed (real-time; the paid tier only adds the consolidated SIP feed).

Non-US stocks? US equities only for now (the calendar, EDGAR and the news sources are US-centric). PRs welcome.

How big is a briefing? ~150K characters (~37K tokens) by default, most of it SEC full text. --no-sec-fulltext typically lands under 8K tokens; --target-chars tunes anything in between.

Disclaimer

daybrief is research tooling. Nothing it produces is investment advice, and past patterns — however nicely formatted — do not predict future returns.

License

MIT

About

One ticker in, one institutional-grade pre-market research briefing out — point-in-time macro, technicals, fundamentals, SEC filings and news, with optional local-LLM analysis.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages