> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reconifyhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reconify's API reference is read-only for customer data. Do not invent endpoints or authentication behavior beyond the OpenAPI contract.
> The public OpenAPI document contains only the documented external /v2 contract.

# Sources and pairs

> How source definitions and reconciliation pairs work together.

A `reconify.yaml` describes two things: where your files are and how to parse them (`sources`), and which sources to compare and under what rules (`pairs`). Once you can read those two blocks, you can read any Reconify config.

## Sources

A source names one family of input files and tells Reconify how to parse them.

```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
sources:
  left_source:
    file_pattern: "path/to/left-files/*.csv"
    parser:
      type: csv
      date_col: "Date"
      date_layout: "2006-01-02"
      amount_col: "Amount"
      multiplier: 100
      ref_col: "Reference"
      name_col: "Description"
```

`file_pattern` is what `reconcile` uses to find files when you don't pass `--left-file` or `--right-file` explicitly. The `parser` block controls how each row becomes a transaction: see [Transactions](/cli/concepts/transactions) for the fields it produces.

## Pairs

A pair tells Reconify which two sources to compare and how strict to be about it.

```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
pairs:
  left_source_vs_right_source:
    left: left_source
    right: right_source
    date_window: "1d"
    amount_tolerance_minor: 0
    name_mode: "none"
```

`date_window` and `amount_tolerance_minor` set how close a same-reference row on each side has to be to count as `matched` rather than `amount_diff` or `timing_diff`. `name_mode: tokens` turns on name-based matching for rows that reference matching couldn't resolve.

The right source is indexed first, and that index is what bounds peak memory for the run. For large files, prefer the smaller or more index-friendly file as the right side.

See [Handle large files](/cli/guides/large-data) for what "index-friendly" means at scale.

## Multiple pairs in one config

A single `reconify.yaml` can define more than one pair, each with its own tolerances:

```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
pairs:
  left_source_vs_right_source:
    left: left_source
    right: right_source
    date_window: "1d"
    amount_tolerance_minor: 0
    name_mode: "tokens"

  left_source_vs_another_source:
    left: left_source
    right: another_source
    date_window: "2d"
    amount_tolerance_minor: 5
    name_mode: "none"
```

Run one of them with `--pair`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
reconify reconcile --config reconify.yaml --pair left_source_vs_right_source --out results.json
```

## One left, several counterparts (`rights`)

Some workflows need one left source reconciled against several counterpart sources in a fixed order, for example a ledger that might settle through either of two PSPs. Use `rights` instead of `right`:

```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
pairs:
  left_source_vs_counterparts:
    left: left_source
    rights: [right_source, another_source]
    date_window: "2d"
    amount_tolerance_minor: 0
```

`right` and `rights` are mutually exclusive: set exactly one. Passes run in the order listed in `rights`, and each counterpart only sees the left rows still unmatched from the previous pass, so `right_source` gets the full left set and `another_source` only sees what `right_source` didn't consume.

If two counterparts could both match the same left row, the earlier one in `rights` wins. Order here is a configuration decision, not a formality: swapping the list changes which counterpart gets first claim on ambiguous rows.

A `rights` pair carries some caveats a single-`right` pair doesn't:

* `--audit` isn't supported for multi-counterpart runs yet.
* `name_mode: tokens` isn't supported in streaming multi-counterpart mode; omit it for `rights` pairs.
* `--right-file` doesn't apply, since each counterpart resolves its own file through its source's `file_pattern`.

## Which side is left?

Left and right aren't interchangeable. The right source gets indexed, which is where memory cost concentrates, so put the larger or harder-to-index file on the left when you have a choice.

It also determines which unmatched bucket a row lands in: a row present only in the left source comes back as `unmatched_left`, and a row present only in the right source comes back as `unmatched_right`. Pick left and right so those two buckets mean something to whoever reads the results, not just so the run finishes fast.
