记忆

sec-guidance

试用

Extract management guidance and forward-looking statements from SEC filings (10-K/10-Q, and 20-F/40-F/6-K for foreign private issuers). Self-contained by default (fetches from EDGAR, in-memory BM25, Claude/OpenAI). Optional heavy mode delegates to a local RAG pipeline.

它能做什么

Extract management guidance and forward-looking statements from SEC filings (10-K/10-Q, and 20-F/40-F/6-K for foreign private issuers). Self-contained by default (fetches from EDGAR, in-memory BM25, Claude/OpenAI). Optional heavy mode delegates to a local RAG pipeline.

技能文档

SEC Guidance Extractor

Fetches the latest SEC filing for a ticker from EDGAR, ranks passages with BM25, and asks Claude (or OpenAI) to answer forward-looking questions with inline citations. Handles both domestic filers (10-Q/10-K) and foreign private issuers (20-F/40-F/6-K) via --form auto.

Quickstart (light mode — default)

pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...     # or OPENAI_API_KEY; optional, see below
python extract_guidance.py --ticker AAPL

That's it. No Docker, no Elasticsearch, no Ollama.

No API key? The skill still runs: it prints the top-ranked filing passages with quotes instead of synthesized answers, and tells you which key to set to get full answers.

When to invoke

  • User asks what management said about future revenue, earnings, margins, or outlook
  • User asks for guidance from an SEC filing (10-K, 10-Q, 20-F, 6-K)
  • User asks "what is [company]'s guidance for next quarter?"
  • User wants forward-looking statements or risk factors from SEC filings

When NOT to invoke (boundaries)

  • Stock prices or valuation — this reads filings, not market data. Use a market-data skill for quotes, charts, or ratios.
  • Companies that don't file with the SEC — private companies and non-US companies without a US listing have no EDGAR filings. The skill fails with a clear error, but don't invoke it for these.
  • Earnings-call transcripts or news — only EDGAR filing text is fetched. What the CEO said on the call is out of scope.
  • Buy/sell recommendations — the skill extracts and cites what management said; it is prompted to never produce trading advice.

Division of labor: this skill answers "what did management commit to in the filing". Pair it with market-data skills for prices and transcript tools for call commentary.

Options

# Auto form selection (default): 10-Q → 10-K → 20-F → 40-F → 6-K
python extract_guidance.py --ticker BABA          # foreign issuer → picks 20-F/6-K

# Specific form
python extract_guidance.py --ticker AAPL --form 10-K --top-k 8

# Single custom question
python extract_guidance.py --ticker MSFT --query "What did management say about Azure growth?"

# Structured output (JSON on stdout, progress on stderr)
python extract_guidance.py --ticker NVDA --json

# Force a mode (default: auto)
python extract_guidance.py --mode light --ticker NVDA
python extract_guidance.py --mode heavy --ticker NVDA

Env vars

VarRequiredPurpose
ANTHROPIC_API_KEYno*Claude API key (preferred)
OPENAI_API_KEYno*OpenAI API key (fallback)
SEC_GUIDANCE_UAnoUser-Agent for EDGAR requests. SEC rate-limits generic UAs — set to "yourname you@example.com" if you make many requests.
SEC_GUIDANCE_MODELnoOverride default LLM model. Anthropic default: claude-sonnet-4-6. OpenAI default: gpt-4o-mini.
SEC_PIPELINE_DIRnoEnables heavy mode — see below.

*With neither key set, output degrades to ranked passages with quotes (no synthesized answers).

Standard queries (default, when --query not given)

  1. Future revenue and earnings outlook
  2. Forward-looking performance expectations
  3. Expected gross margins and profitability
  4. New product launches, services, or expansion plans
  5. Macroeconomic risks and uncertainties

Output & citations

For each query: an LLM answer with inline [1], [2] citations, plus a source list showing chunk index, BM25 score, and a direct quote from each cited chunk so every claim can be checked against the filing URL printed at the top. --json emits the same content as structured JSON (answers, sources with quotes, filing metadata, recall stats).

Recall check: after retrieval, the skill reports how many "guidance-dense" chunks (≥3 forward-looking keywords) the retrieved set covered, and warns when coverage is low — BM25 can miss relevant sections, and this makes that visible instead of silent. Raise --top-k or ask a narrower --query when warned.

EDGAR requests retry 3× with backoff on 429/5xx. Filings are cached under ~/.cache/sec-guidance/ so repeat runs on the same ticker are fast.

Heavy mode (optional — for bulk / repeat users)

If you already run a local SEC RAG pipeline (Elasticsearch + sentence-transformers + cross-encoder rerank + Ollama), you can wire this skill to it:

export SEC_PIPELINE_DIR=/path/to/your/pipeline
python extract_guidance.py --ticker AAPL  # auto-detects heavy mode

The skill auto-detects heavy mode when SEC_PIPELINE_DIR is set, the pipeline is importable, and Elasticsearch is reachable. Otherwise it silently falls back to light mode. Heavy mode gives higher-quality retrieval on large indexed corpora (cross-encoder rerank, hybrid dense+sparse search) — worth the setup only if you're querying hundreds of tickers per day. --json and --form auto are light-mode features; heavy mode maps auto to 10-Q.

Heavy-mode pipeline expected layout:

  • pipeline/index.py exports get_es(), INDEX
  • pipeline/embed.py exports Embedder
  • pipeline/retrieve.py exports hybrid_search(query, embedder, es, top_k)
  • pipeline/rerank.py exports Reranker (optional)
  • pipeline/answer.py exports generate_answer(query, results)

See the reference implementation at the homepage repo. The heavy pipeline is a slimmed-down open version of the system behind deltavigil.com — daily SEC-guidance monitoring across 1000+ US tickers (currently invite-only).

Limitations of light mode

  • One filing at a time (the most recent matching form). Heavy mode indexes the full history.
  • BM25 only, no semantic embeddings or reranking. Roughly ~20% quality gap on the same single-filing query, larger gap on ambiguous questions. The recall check surfaces (but cannot fix) retrieval misses.
  • 6-K filings are thin wrappers around press releases; guidance content varies much more than in 10-Q/10-K and answers may be sparse.
  • Full filing text is sent through chunking (~1500 char chunks); very large 10-Ks (>500 chunks) may be slow to rank. Not slow enough to matter for interactive use.

相关技能

SEC filings, insider trades & company financials for AI agents — pull SEC EDGAR filings, 8-K material events, Form 4 insider transactions, headline financial...

2 次安装

Clean company financials from SEC EDGAR via Edgrapi.com. Four tools — pull normalized income/balance/cash-flow fundamentals, computed ratios, company profile...

1 次安装

Resolve a ticker to a CIK, then pull SEC EDGAR filer profiles, filings, XBRL financial concepts and full-text search across 2001-today. 6 endpoints, 1 credit each, structured JSON.

Researches stocks, crypto, SEC filings, insider/congressional trading, and private-market (VC/PE) profiles via the Crawlora API — Yahoo Finance quotes/financials/history/options, SEC EDGAR filings and financial statements, congressional stock disclosures, CoinGecko crypto markets, and PitchBook company/fund/investor teasers — returning clean JSON. Use when the user asks about a ticker's price/financials/news, a company's SEC filings or insider trades, what a member of Congress traded, a crypto coin's market data, or a private company/fund/investor profile.

3 次安装

Company profiles and recent SEC filings from EDGAR via Edgrapi.com. Resolve a US-listed ticker to its CIK, industry, fiscal-year end, and exchange, and list...

1 次安装

Normalized company financial statements and computed ratios from SEC EDGAR via Edgrapi.com. Pull clean income/balance/cash-flow figures and margin/return/lev...

1 次安装