Skip to main content

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)

Metadata

Release files for finsum 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finsum 0.1.0
File Size Uploaded
finsum-0.1.0.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for finsum 0.1.0
File Interpreter ABI Platform
finsum-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.2 kB

Release files / finsum-0.1.0.tar.gz

Download URL finsum-0.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eb26a2a367bfa5579055279a04f00fbe51962f0acfce64ca22d09251eb6e4f8e
BLAKE2b-256 checksum
How to use checksums
dc4496979cf87c404a62915aa166b09013cd9f8672a20e0c2a532db97c2ac2f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / finsum-0.1.0-py3-none-any.whl

Download URL finsum-0.1.0-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f736da7ed313df24a0a571ceb7df82fdab9a86c6ccdc802b807d237eb76fd1e8
BLAKE2b-256 checksum
How to use checksums
2133c1bfae8c2b3365f0e3a37754896afec04b02378b82532a38de66196c7193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page