You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What this source provides (for downstream analysis)
Monthly global GPR level from the Iacoviello academic series, usable as a macro stress / safe-haven demand driver alongside precious metals and volatility narratives.
RAG outputs: per-month markdown narratives and deterministic Qdrant JSONL payloads so retrieval stays idempotent across reruns.
2. Architecture and strategy workflow
Step 1 — Extraction (fault-tolerant download)
Download the latest GPR .xls file directly from Matteo Iacoviello's academic repository.
Retry on failure (up to 3 attempts with 10-second delays) for network drops or site outages.
Parse legacy date formats (e.g., 1985M01) into standard Python datetime objects.
Step 2 — Transformation and statistical enrichment
Operate on the entire historical dataset so long-window metrics stay correct.
Compute:
MoM % (Month-over-Month change)
YoY % (Year-over-Year change)
3-Month Moving Average (trend smoothing)
Historical Percentile (ranks the current threat level against all historical data)
Step 3 — Natural language generation (NLG)
Uses conditional logic based on MoM momentum to generate dynamic RAG-friendly markdown. For example, a >10% jump generates a "significant escalation" narrative, while a <-10% drop generates a "cooling off" narrative.
Hardcodes trading context into the text (e.g., explicitly mentioning the historical correlation between GPR spikes and Gold/Silver price action).
Step 4 — Idempotent archival (load preparation)
Truncation: Keep post-2020 rows only so older regimes do not dominate the vector space.
Deterministic UUIDs: Qdrant document IDs use uuid5 from a fixed string (e.g., GPR_2024_04) so reruns overwrite the same logical documents without duplicates.
3. Pipeline strategy (inputs, outputs, frequency)
Item
Detail
Input
Remote URL only: https://www.matteoiacoviello.com/gpr_files/data_gpr_export.xls (no local input file).
Outputs
See table below.
Update frequency
Monthly per collect_data.py (06:05). Each successful run refreshes the full post-2020 slice in Parquet and Gold files.