Skip to main content

AI-powered economics research tool: QQA alignment of literature and empirical data.

Project description

Synthesis

AI-powered economics research briefs combining qualitative literature and quantitative data.

Synthesis retrieves papers from arXiv, OpenAlex, and NBER, extracts structured empirical claims using Claude, pulls FRED and World Bank time-series data, and scores theory against evidence using a novel Quantitative-Qualitative Alignment (QQA) method — all in a single command.

synthesis "Does raising the minimum wage increase unemployment?"

→ Generates an 8-section PhD-level research brief with interactive charts and a gap matrix in under 2 minutes.


What It Produces

  • Literature consensus across 20+ papers with identified fault lines
  • Extracted claims structured by variable, direction, methodology, geography, and confidence
  • Empirical data from FRED (US macro) and World Bank (cross-country)
  • QQA alignment scores — each theoretical claim scored against empirical data
  • Research gap matrix — unstudied methodology × geography combinations
  • Suggested research directions with identification strategies
  • Interactive HTML report with Plotly charts (zoomable, hoverable)

The Core Idea: QQA

Most research tools do one of two things: search literature (qualitative) or fetch data (quantitative). Synthesis does both and aligns them.

The Quantitative-Qualitative Alignment (QQA) method:

  1. Extracts structured claims from paper abstracts: variable_a → variable_b | direction | methodology | geography | confidence
  2. Fetches empirical data relevant to the question via Claude-identified FRED and World Bank series
  3. Scores each claim against the data: strongly_supported / supported / neutral / contradicted / strongly_contradicted / insufficient_data
  4. Identifies where the literature and data diverge — the most productive place for new research

Quick Start

pip install synthesis-econ

Set your API keys (get them free):

export ANTHROPIC_API_KEY='sk-ant-...'
export FRED_API_KEY='your-fred-key'

Run a research brief:

synthesis "Does immigration lower wages for native workers?"
synthesis "What is the effect of quantitative easing on inflation?"
synthesis "Do charter schools improve student outcomes?"
synthesis "Does foreign aid promote economic growth?"

The HTML report opens automatically in your browser.


Install from Source

git clone https://github.com/bsin-researcher/synthesis.git
cd synthesis
pip install -e .

How It Works

Your question
    │
    ├── arXiv  (economics: econ.GN, econ.EM, econ.LG, econ.TH, econ.HE, econ.IO)
    ├── OpenAlex  (250M+ peer-reviewed works)
    └── NBER  (64K+ working papers)
           │
           ▼
    Claude extracts structured claims
    (variable_a → variable_b, direction, methodology, geography, confidence)
           │
           ├── FRED  (US macro time-series — series IDs chosen by Claude)
           └── World Bank  (cross-country indicators — chosen by Claude)
                  │
                  ▼
           QQA Alignment Scoring
           (theory vs. data, claim by claim)
                  │
                  ▼
           Research Gap Matrix
           (unstudied methodology × geography combinations)
                  │
                  ▼
    8-section research brief + interactive Plotly HTML report

Example Output

Question: Does raising the minimum wage increase unemployment?

Papers: 22 (arXiv: 8, OpenAlex: 8, NBER: 8, 2 duplicates removed)
Claims extracted: 14
FRED series: Federal Minimum Wage, Unemployment Rate, Nonfarm Payrolls, Labor Force Participation
World Bank series: Unemployment total (% of labor force), Labor Force Participation
Pooled estimate: NEGATIVE −0.17 (weighted by method quality × confidence × citations)

Statistical QQA results (actual tests, not summaries):

  • ΔSTTMINWGFG → ΔUNRATE: Spearman r=0.239, OLS slope=+2.29, p=0.034 — significant but cycle-confounded
  • ΔSTTMINWGFG → ΔPAYEMS: Spearman r=−0.422, OLS slope=−5705, p=0.036 — supports disemployment direction
  • Federal minimum frozen at $7.25 since 2009: CV of Δ=0.00031 → correctly flagged as insufficient_variation

Verdict: Directionally negative, small, margin-shifting, and badly under-identified at the level where policy actually binds. Adjustment runs through hours and slowed hiring, not stock job losses.

Top gap: Contiguous-county-pair DiD on the post-2009 real-minimum-wage decline — tests the inverse natural experiment (falling real floor) that no one has run.


Benchmark: Synthesis vs. Consensus

Same question: "Does raising the minimum wage increase unemployment?"

Synthesis Consensus
Papers retrieved 22 (3 sources, deduplicated) 16
Verdict NEGATIVE −0.17 (weighted pooled) 56% No, 31% Yes
Quantitative data FRED + World Bank (6 series) None
Statistical tests Spearman r, OLS slope, p-values None
Confound detection Flagged business-cycle contamination Not mentioned
Research gap matrix 8 unstudied method × geography cells None
Research directions 5 with identification strategies None
Citation weighting Yes (log-scaled by paper citations) Unknown

Consensus is excellent for a quick literature read — intuitive verdict meter, clean country table, fast. Use it to find out what the literature says.

Synthesis is for researchers who need to know why the data can or can't test a claim, where the gaps are, and how to close them. It is the only tool that aligns theoretical claims against real economic data with actual statistical tests.


Data Sources

Source Coverage Key
arXiv Economics preprints (7 categories) None required
OpenAlex 250M+ peer-reviewed works None required
NBER 64K+ working papers None required
FRED 800K+ US macro time-series Free API key
World Bank Cross-country development indicators None required

Options

synthesis "question" [OPTIONS]

  -o, --output TEXT    Output directory  [default: ./synthesis_output]
  -p, --papers INT     Max papers to retrieve  [default: 24]
  --no-fred            Skip FRED data
  --no-worldbank       Skip World Bank data

Requirements

  • Python 3.10+
  • Anthropic API key (uses Claude Opus 4.8 with adaptive thinking)
  • FRED API key (free, optional but strongly recommended)
anthropic>=0.109.0
requests>=2.34.0
pandas>=2.0.0
plotly>=5.20.0
rich>=13.0.0
typer>=0.9.0
python-dotenv>=1.0.0

Roadmap

  • arXiv + OpenAlex + NBER retrieval with deduplication (DOI + title)
  • Claude-powered structured claim extraction (adaptive thinking, citations included)
  • FRED + World Bank empirical data (series chosen by Claude)
  • Statistical QQA — Spearman r + OLS on first differences, p-value thresholds, flat-series detection
  • Citation-weighted meta-analytic pooling (method quality × confidence × log citations)
  • Research gap matrix (unstudied methodology × geography combinations)
  • Interactive Plotly HTML report with pooled evidence card
  • Benchmark vs Consensus (see table above)
  • Confidence intervals on pooled score (bootstrap)
  • Semantic deduplication across sources (sentence-transformers)
  • PDF and LaTeX export
  • Jupyter notebook mode

Citation

If you use Synthesis in your research:

@software{sinclair2026synthesis,
  author  = {Sinclair, Blake},
  title   = {Synthesis: AI-Powered Economics Research via Quantitative-Qualitative Alignment},
  year    = {2026},
  url     = {https://github.com/bsin-researcher/synthesis},
}

Contributing

Pull requests welcome. The highest-value open items are in the roadmap above.

To add a new data source, implement the pattern in synthesis/data/ — a function fetch_X(question: str, client: anthropic.Anthropic) -> list[DataSeries] and wire it into synthesis/cli.py.


License

MIT

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

synthesis_econ-0.4.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

synthesis_econ-0.4.0-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file synthesis_econ-0.4.0.tar.gz.

File metadata

  • Download URL: synthesis_econ-0.4.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for synthesis_econ-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6f88f9c499195b86c86e6a2ea948e00671b299a98e8a1ff8f0fcd9f2b1034c75
MD5 afab6e5bc54941d4d8dc97eea3400e39
BLAKE2b-256 603d6af0b58167c4b963121c25d1f410ae25971fcf85efa2e97e34af01cc4f6c

See more details on using hashes here.

File details

Details for the file synthesis_econ-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: synthesis_econ-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for synthesis_econ-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d855ef6ca304f804aad419b756276cb569d8c36bf081468e2015d4053bea2b7
MD5 a52fd5d6beb1c4ff713dc7beb642428d
BLAKE2b-256 c4f9000a6503d9869cc559582f7e7ba08aab93815480fa1a04efbbc093b97d80

See more details on using hashes here.

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