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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb26a2a367bfa5579055279a04f00fbe51962f0acfce64ca22d09251eb6e4f8e
|
|
| MD5 |
c486aaba34a094e875dccee04085825c
|
|
| BLAKE2b-256 |
dc4496979cf87c404a62915aa166b09013cd9f8672a20e0c2a532db97c2ac2f7
|
Provenance
The following attestation bundles were made for finsum-0.1.0.tar.gz:
Publisher:
publish.yml on tsowersby/finsum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finsum-0.1.0.tar.gz -
Subject digest:
eb26a2a367bfa5579055279a04f00fbe51962f0acfce64ca22d09251eb6e4f8e - Sigstore transparency entry: 928419955
- Sigstore integration time:
-
Permalink:
tsowersby/finsum@e259b55ddb1248365e81ec000e6c56debd475d65 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tsowersby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e259b55ddb1248365e81ec000e6c56debd475d65 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f736da7ed313df24a0a571ceb7df82fdab9a86c6ccdc802b807d237eb76fd1e8
|
|
| MD5 |
2314de7f053b69d3c12667e439e862d0
|
|
| BLAKE2b-256 |
2133c1bfae8c2b3365f0e3a37754896afec04b02378b82532a38de66196c7193
|
Provenance
The following attestation bundles were made for finsum-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tsowersby/finsum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finsum-0.1.0-py3-none-any.whl -
Subject digest:
f736da7ed313df24a0a571ceb7df82fdab9a86c6ccdc802b807d237eb76fd1e8 - Sigstore transparency entry: 928419956
- Sigstore integration time:
-
Permalink:
tsowersby/finsum@e259b55ddb1248365e81ec000e6c56debd475d65 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tsowersby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e259b55ddb1248365e81ec000e6c56debd475d65 -
Trigger Event:
release
-
Statement type: