AI Agent Workflow Examples

Six runnable workflows — each queries multiple datasets in one agent loop and costs fractions of a cent. Copy client.py below, set your token, and run.

Setup

All examples share a minimal API client — client.py. Save it in the same directory as the example script, set your token, and run.

export MICROQUERY_TOKEN=your_token   Get a token at microquery.dev/docs.
client.py ⤓ Download

            

Company Due Diligence

sec.edgar fec.contributions sanctions.entities fred.series

Cross-references four independent datasets to build a complete picture of a public company. SEC EDGAR provides audited financials — revenue trend, net income, debt, cash. FEC campaign finance exposes political donation patterns from employees and PACs. Sanctions screening checks the U.S. Consolidated Screening List for counterparty risk. FRED macro data gives the interest rate and GDP context for the reporting period.

company_diligence.py ⤓ Download

            

Sample run: python3 company_diligence.py --company "Apple" --ticker AAPL

Sample output — Apple Inc.
============================================================ DUE DILIGENCE: APPLE ============================================================ --- 1. Financial Health (SEC EDGAR) --- Entity: Apple Inc. CIK: 320193 Annual revenue trend (10-K): 2025 $ 416.2B 2024 $ 391.0B 2023 $ 383.3B Net income (2025): $112.0B Long-term debt (2025): $90.7B Cash (2025): $35.9B --- 2. Political Exposure (FEC Campaign Finance) --- Contributions from employees listing employer as 'Apple': 2026 $1856k (4169 contributions) Y:$583k V:$486k H:$260k 2024 $9300k (25489 contributions) V:$3108k N:$2579k P:$1075k --- 3. Sanctions Screening (U.S. CSL) --- ⚠ 1 match(es) found on sanctions lists: ORIENTAL APPLE COMPANY PTE LTD [SDN] IFSR, SDGT (false positive — unrelated Dubai trading company) --- 4. Macro Context (FRED) --- Fed Funds Rate (%) 3.64 [2026-04] (+0.00 vs prior) CPI (index) 330.29 [2026-03] (+4.26 vs prior) GDP ($B) 31422. [2025-10] (+1380 vs prior) Unemployment (%) 4.30 [2026-03] (-0.10 vs prior) ============================================================ SUMMARY ============================================================ Total: 68271.7 MB scanned, $0.009545 USDC

U.S. Macro Economy Dashboard

fred.series fred.catalog

Pulls ~20 FRED series in parallel to produce a five-section snapshot of the U.S. economy. Monetary Policy tracks the Fed Funds Rate, IORB, SOFR, and the Fed balance sheet. Yield Curve shows 2Y/5Y/10Y/30Y Treasuries with inversion flags on the 10Y-2Y and 10Y-3M spreads. Inflation covers CPI, Core CPI, PCE, Core PCE, PPI, and 10-year breakeven inflation. Labour Market and Housing & Growth round out the picture. Use --search to query the 539,000-series FRED catalog by keyword.

macro_economy.py ⤓ Download

            

python3 macro_economy.py   or   python3 macro_economy.py --since 2020   or   python3 macro_economy.py --search "housing starts"

Sample output — current snapshot
============================================================ U.S. MACRO ECONOMY DASHBOARD ============================================================ Source: FRED (Federal Reserve Economic Data) Window: obs_year >= 2022 --- 1. Monetary Policy --- Fed Funds Rate (%) 4.33 [2026-04] (+0.00 vs 3p ago) Interest on Reserves (%) 4.40 [2026-03] (-0.10 vs 3p ago) SOFR (%) 4.31 [2026-04] (-0.01 vs 3p ago) Fed Balance Sheet (M USD) 6,697,869 [2026-04] (-245,825 vs 3p ago) --- 2. Yield Curve --- 2-Year Treasury (%) 3.88 [2026-04] (-0.26 vs 3p ago) 5-Year Treasury (%) 4.00 [2026-04] (-0.18 vs 3p ago) 10-Year Treasury (%) 4.33 [2026-04] (-0.06 vs 3p ago) 30-Year Treasury (%) 4.75 [2026-04] (+0.02 vs 3p ago) 10Y minus 2Y spread 0.45 [2026-04] (+0.20 vs 3p ago) 10Y minus 3M spread 0.16 [2026-04] (+0.58 vs 3p ago) --- 3. Inflation --- CPI All Items (index) 319.08 [2026-03] (+5.38 vs 3p ago) Core CPI ex food/energy (index) 329.25 [2026-03] (+3.79 vs 3p ago) PCE Price Index (index) 127.76 [2026-02] (+1.27 vs 3p ago) Core PCE (index) 122.27 [2026-02] (+0.89 vs 3p ago) 10Y Breakeven Inflation (%) 2.22 [2026-04] (-0.10 vs 3p ago) PPI Finished Goods (index) 145.50 [2026-03] (+1.80 vs 3p ago) --- 4. Labour Market --- Unemployment Rate (%) 4.20 [2026-03] (+0.10 vs 3p ago) Nonfarm Payrolls (000s) 159,531 [2026-03] (+544 vs 3p ago) Initial Jobless Claims 222,000 [2026-04] (+7,000 vs 3p ago) --- 5. Housing & Growth --- Housing Starts (000s ann.) 1,324 [2026-02] (-126.0 vs 3p ago) Building Permits (000s ann.) 1,456 [2026-02] (-13.0 vs 3p ago) Real GDP (B chained 2017 USD) 23,548 [2025-10] (+476.4 vs 3p ago) --- 6. Recession Signals --- 10Y minus 2Y spread: +0.45 [2026-04] → positive 10Y minus 3M spread: +0.16 [2026-04] → positive ============================================================ SUMMARY ============================================================ Total: 4831.0 MB scanned, $0.000676 USDC

Drug Safety Report

fda.faers fda.orangebook clinicaltrials.studies clinvar.variants pubmed.baseline

Builds a pharmacovigilance profile from five datasets. FDA FAERS surfaces real-world adverse event reports post-approval, ranked by frequency and severity. Orange Book confirms FDA approval status and generic availability. ClinicalTrials shows what is actively being studied. ClinVar identifies genetic variants linked to the target condition — the patient subpopulations most relevant to the drug. PubMed provides the recent literature trajectory.

drug_safety_report.py ⤓ Download

            

python3 drug_safety_report.py --drug metformin --condition diabetes

Software Security Audit

nvd.cve osv.advisories eol.cycles

Audits a software dependency for known vulnerabilities and runtime end-of-life status. NVD provides the official CVSS-scored CVE record — severity, attack vector, and scope. OSV maps vulnerabilities directly to package ecosystem version strings (PyPI, npm, Go, Maven) answering “is this exact version affected?” EOL.date flags runtimes that no longer receive security patches regardless of CVE status.

security_audit.py ⤓ Download

            

python3 security_audit.py --package requests --ecosystem PyPI --version 2.28.0   or   python3 security_audit.py --runtime python --cycle 3.8

Research-to-Clinic Pipeline

arxiv.papers pubmed.baseline clinicaltrials.studies clinvar.variants

Traces a research topic from preprint frontier to clinical application. arXiv captures the cutting edge — preprints appear months before journals, showing where ideas first surface. PubMed measures how established an area is and whether publication volume is growing or plateauing. ClinicalTrials reveals whether basic research has crossed into human testing — the gap between papers and trial starts quantifies translation lag. ClinVar anchors the condition to specific genetic variants and patient subpopulations.

research_pipeline.py ⤓ Download

            

python3 research_pipeline.py --topic "GLP-1 obesity"   or   python3 research_pipeline.py --topic "Alzheimer tau"

Blockchain Compliance & AML Screening

eth.transfers eth.dex_swaps eth.lending eth.lp_events eth.mev

Screens any Ethereum address for AML red flags across five datasets. eth.transfers measures counterparty concentration — high unique-sender or recipient counts flag layering and structuring patterns. eth.dex_swaps detects cross-protocol layering — swapping through multiple DEX protocols fragments the transaction trail; high swap-to-block ratios indicate automated behaviour. eth.lending flags leverage and liquidation risk — liquidation_call events are a financial-stress signal; repeated borrow/repay cycles may indicate wash activity. eth.lp_events detects wash-trading — high mint/burn churn in the same pool inflates apparent volume without economic purpose. eth.mev identifies automated or sophisticated actors — addresses consistently appearing in MEV-extracted blocks are likely bots or persistent targets.

blockchain_aml.py ⤓ Download

            

python3 blockchain_aml.py --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045   or   python3 blockchain_aml.py --address 0x... --days 30