Skip to main content

Accrue
The enrichment pipeline engine.

PyPI Python License


Define a pipeline. Point it at your data. Get structured results. Accrue is a Python library for enriching datasets with LLMs. Compose multi-step pipelines, run them across hundreds to tens of thousands of rows, and get validated, structured output back -- with caching, retries, and parallel execution handled for you.

No platform. No markup. Just a pipeline you can version-control, iterate on, and reason about.

Accrue Watch, Overview tab: a live 5,000-row enrichment run with its pipeline steps, models, produced fields, and cost
A 5,000-row run in Accrue Watch -- every step, model, field, and dollar, read live from the run log.

from accrue import Pipeline, LLMStep

pipeline = Pipeline([
    LLMStep("analyze", fields={
        "market_size": "Estimate total addressable market in billions USD",
        "competition": {
            "prompt": "Rate competitive intensity with key competitors",
            "enum": ["Low", "Medium", "High"],
            "examples": ["High - Competes with AWS, Google Cloud"],
        },
        "growth_potential": {
            "prompt": "Assess 5-year growth trajectory",
            "type": "String",
            "format": "X% CAGR - reasoning",
        },
    })
])

result = pipeline.run(df)  # DataFrame in, DataFrame out
print(result.data.head())
print(f"Tokens used: {result.cost.total_tokens:,}")

Install

Requires Python 3.10+.

pip install accrue

Set your API key:

export OPENAI_API_KEY=sk-...

That's it. OpenAI is the default provider (zero config, structured outputs auto-enabled). Anthropic and Google are optional:

pip install accrue[anthropic]  # Claude
pip install accrue[google]     # Gemini

Claude Code Skill

If you use Claude Code, Accrue ships with a built-in /accrue skill that guides you through building pipelines interactively. It designs fields, picks models, estimates costs, and writes your script -- you just review and run.

> /accrue
> I have 500 companies in accounts.csv, I need to qualify them for ICP fit

The skill walks you through field design, model selection, pipeline architecture, and configuration before writing a production-ready script. See Using the Claude Code Skill for details.

Why Accrue

You have a spreadsheet of companies, leads, or entities. You need structured fields added to every row -- classifications, summaries, scores, extracted data. You could write a for loop and call the OpenAI API, but then you're building retry logic, rate limiting, caching, progress tracking, and crash recovery. You could use Clay, but you'd pay $500/month for something you can't version-control.

Accrue is the pipeline between a single API call and a full platform:

Raw API calls Accrue Clay
Scope One call at a time Pipeline of steps across rows Full SaaS platform
Multi-step Manual orchestration DAG with parallel execution Sequential drag-and-drop
Caching Build it yourself SQLite, auto-invalidates on prompt change Platform-managed
Crash recovery Start over Checkpoint + row-level cache resume Platform-managed
Iterate on prompts Re-run everything Only re-process changed steps/rows Re-run everything
Cost API costs API costs $$$$/month + API costs
Version control Yes Yes No

Quick Example

Chain steps together with depends_on. Use web_search() to ground LLM answers in live data:

from accrue import Pipeline, FunctionStep, LLMStep, web_search

pipeline = Pipeline([
    FunctionStep("research",
        fn=web_search("Research {company}: market position, competitors, recent news"),
        fields=["__web_context", "sources"],
    ),
    LLMStep("analyze",
        fields={
            "market_size": "Estimate TAM in billions USD",
            "competitors": {"prompt": "List top 3 competitors", "type": "List[String]"},
            "investment_thesis": "One-paragraph investment thesis",
        },
        depends_on=["research"],
    ),
])

result = pipeline.run(companies_df)

Watch It Run

Accrue Watch (accrue-ui) is a local dashboard for a running pipeline -- rows x steps as a live grid, every cell's values and errors, failures grouped by cause, cost by step. It reads the JSONL run log Accrue writes; there is nothing else to configure. The Overview tab is at the top of this page; this is the run grid:

Accrue Watch, run grid in data view: one produced field per step, with retrying and failed cells highlighted in place
Run grid, data view -- one field per step, filling in as rows complete; retries and failures show in place.

Turn on the run log, then point the dashboard at it:

result = pipeline.run(companies_df, run_log=True)  # writes .accrue/runs/<run_id>.jsonl
pip install git+https://github.com/matt-house-e/accrue-ui  # not on PyPI yet
accrue watch                                                # opens the latest run in your browser

accrue watch is a thin stub that delegates to accrue-ui. Add --pipeline module:attr to enable one-click retry of failed rows from the dashboard. There is no accrue[ui] extra until accrue-ui is published. Run log guide

Features

  • Multi-step pipelines -- Chain LLM steps and function steps into a DAG with automatic dependency resolution and parallel execution. Quickstart

  • Provider-agnostic -- OpenAI, Anthropic (with automatic prompt caching), and Google ship as adapters. Any OpenAI-compatible API works via base_url. Custom providers implement one async method. Providers guide

  • 7-key field specs -- Control LLM output with prompt, type, format, enum, examples, bad_examples, and default. Drives structured outputs and Pydantic validation automatically. Field specs guide

  • Caching and checkpointing -- SQLite input-hash cache auto-invalidates on prompt changes. Checkpointing saves after each step for crash recovery. Caching guide

  • Batch API -- LLMStep(batch=True) for 50% cost savings via OpenAI and Anthropic batch endpoints. Cache-aware, auto-chunking, realtime fallback on failures. Batch guide

  • Web search and grounding -- web_search() factory for search-then-analyze pipelines, or grounding=True for native provider web search with normalized citations. Web search guide

  • Conditional steps -- run_if / skip_if predicates for per-row branching. Skipped rows get defaults, never hit the API. Conditional steps guide

  • Hooks -- Typed lifecycle events for observability. Sync and async callables, never crash the pipeline. Hooks guide

  • Run logs -- run(..., run_log=True) streams the run as append-only JSONL (schema v1): per-step and per-row events with status, errors, and token usage. Crash-safe, tail -f-able. Run log guide

  • Run diffs -- accrue.compare(result_a, result_b) diffs two runs (e.g. before/after a prompt tweak) -- changed rows, per-field churn, distribution shift, and cost delta -- no labels needed. Compare guide

  • provider_kwargs -- Escape hatch for provider-specific features (extended thinking, effort control, etc.) without waiting for first-class support.

Sweet Spot

Accrue is built for 100 to 50,000 rows -- too many for manual work or single-call tools, too few to justify big data infrastructure.

Rows Time (3 steps, 10 workers) Cost (gpt-4.1-mini)
100 ~30s ~$0.20
1,000 ~5 min ~$2
10,000 ~50 min ~$20
50,000 ~50 min (50 workers) ~$100

With batch=True, halve the API costs. Cached steps re-run in seconds.

Documentation

Section Description
Getting Started Installation, first pipeline, core concepts
Claude Code Skill Interactive pipeline builder via /accrue
Guides Field specs, providers, caching, batch API, grounding, hooks, run logs, errors, configuration
Cookbook End-to-end examples: company enrichment, lead scoring, content analysis, batch processing
API Reference Complete reference for every public export

Contributing

git clone https://github.com/matt-house-e/accrue.git
cd accrue
pip install -e ".[dev]"
pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

accrue-1.4.0.tar.gz (133.5 kB view details)

Uploaded Source

Built Distribution

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

accrue-1.4.0-py3-none-any.whl (135.5 kB view details)

Uploaded Python 3

File details

Details for the file accrue-1.4.0.tar.gz.

File metadata

  • Download URL: accrue-1.4.0.tar.gz
  • Upload date:
  • Size: 133.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for accrue-1.4.0.tar.gz
Algorithm Hash digest
SHA256 148cae2b4302b288353d0f00d4ae6d2071bf6da91f3a023eec4a30b5f1318960
MD5 e2832d0c39ab89dd3141330eadd742db
BLAKE2b-256 a15297632fb1bd6fcfc0e63b50810ff781750fc1c9b2988c9309ea33a180161c

See more details on using hashes here.

Provenance

The following attestation bundles were made for accrue-1.4.0.tar.gz:

Publisher: publish.yml on matt-house-e/accrue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file accrue-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: accrue-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 135.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for accrue-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63a9af14ac456244a74b426cccdc9be26b083b188d936be6b81afad6c573fe7c
MD5 0e37ae8c0b58fa226383d4023e1d5377
BLAKE2b-256 72dd58e81bf10a6bfb195d7f39f690a64a03feec07de57e204aeb6cf71396da1

See more details on using hashes here.

Provenance

The following attestation bundles were made for accrue-1.4.0-py3-none-any.whl:

Publisher: publish.yml on matt-house-e/accrue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 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