Skip to main content

Summarizes financial information for stock tickers

Project description

SEC 10-K RAG Pipeline

Summarize SEC 10-K filings with one function call.

Usage

from facade import summarize

summary = summarize(
    ticker="AAPL",
    item="1a",
    query="What are the main risk factors?",
    llm_api_key="your-mistral-api-key",
)
print(summary)

With Reranking

summary = summarize(
    ticker="AAPL",
    item="7",
    query="What drove revenue growth?",
    llm_api_key="your-mistral-key",
    reranker_api_key="your-zeroentropy-key",
)

Parameters

Parameter Required Description
ticker Yes Company ticker symbol (e.g., "AAPL")
item Yes Item section to analyze (e.g., "1a", "7")
query Yes Question or topic to summarize
llm_api_key Yes Mistral API key
reranker_api_key No Zero Entropy API key for reranking
top_k No Number of chunks for context (default: 10)

Item Sections

Item Section Name
1 Business
1a Risk Factors
1b Unresolved Staff Comments
2 Properties
3 Legal Proceedings
4 Mine Safety Disclosures
5 Market for Common Equity
6 Reserved
7 Management's Discussion and Analysis (MD&A)
7a Quantitative and Qualitative Disclosures About Market Risk
8 Financial Statements
9 Changes in and Disagreements with Accountants
9a Controls and Procedures
9b Other Information
10 Directors and Executive Officers
11 Executive Compensation
12 Security Ownership
13 Certain Relationships
14 Principal Accountant Fees
15 Exhibits and Financial Statement Schedules

Installation

pip install -r requirements.txt

Configuration

Settings in config/settings.json:

{
  "chunking": {
    "chunk_size_tokens": 512,
    "chunk_overlap_tokens": 50,
    "min_chunk_chars": 50,
    "max_chunk_chars": 2200
  },
  "llm": {
    "model": "mistral-small-latest",
    "temperature": 0.3,
    "max_tokens": 1024
  },
  "retrieval": {
    "embedding_model": "BAAI/bge-small-en-v1.5",
    "vector_dim": 384,
    "top_k": 10,
    "min_score": 0.0,
    "rerank_top_k": 20
  }
}

Architecture

summarize(ticker, item, query, llm_api_key, reranker_api_key)
│
├─ 1. ingestion  → Download 10-K via datamule
├─ 2. chunking  → Split item section into chunks
├─ 3. storage        → Store chunks with embeddings
├─ 4. retrieval         → Vector search(sentence-transformers) and Optional reranking (Zero Entropy API)
└─ 5. inference         → Generate summary (Mistral API)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finsum-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finsum-0.1.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file finsum-0.1.0.tar.gz.

File metadata

  • Download URL: finsum-0.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finsum-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb26a2a367bfa5579055279a04f00fbe51962f0acfce64ca22d09251eb6e4f8e
MD5 c486aaba34a094e875dccee04085825c
BLAKE2b-256 dc4496979cf87c404a62915aa166b09013cd9f8672a20e0c2a532db97c2ac2f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for finsum-0.1.0.tar.gz:

Publisher: publish.yml on tsowersby/finsum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file finsum-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: finsum-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finsum-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f736da7ed313df24a0a571ceb7df82fdab9a86c6ccdc802b807d237eb76fd1e8
MD5 2314de7f053b69d3c12667e439e862d0
BLAKE2b-256 2133c1bfae8c2b3365f0e3a37754896afec04b02378b82532a38de66196c7193

See more details on using hashes here.

Provenance

The following attestation bundles were made for finsum-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tsowersby/finsum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page