> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787365312803.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Statement Vault

> Store account statements and understand how Sure suggests matching accounts for uploaded PDFs

# Statement Vault

The Statement Vault stores original account statement files for a family. It accepts PDF, CSV, and XLSX uploads, keeps the original file, and uses the file hash to avoid storing the same document twice.

You can upload statements from Settings -> Statement Vault. If you choose an account during upload, Sure links the statement to that account immediately. If you leave the account blank, the statement stays in the unmatched inbox and Sure may suggest a matching account for review.

<Note>
  An account suggestion is not the same thing as an account link. Sure only links an unmatched statement after a person confirms the suggestion or selects an account manually.
</Note>

## How PDF account suggestions work

When an unmatched PDF is uploaded, Sure reads metadata from the filename and compares it with visible accounts in the same family.

For PDFs, Sure currently uses filename-based detection:

* Statement period, from dates or month names in the filename
* Account last four digits, from patterns like `ending 1234`, `last 4 1234`, `acct 1234`, or `xx1234`
* Institution and account name hints, from meaningful remaining filename text after generic words and dates are removed

Sure then scores each visible account:

* Institution hint matches the account name, institution name, or institution domain: `+0.45`
* Account name hint matches the account name: `+0.25`
* Last-four hint matches the account name or institution name: `+0.25`
* Statement currency matches the account currency: `+0.05`

Accounts below `0.35` confidence are ignored. The highest scoring account becomes the suggested account shown in the unmatched inbox.

## Example

A file named `Chase_Bank_2024-01_account_6789.pdf` can produce:

* A January 2024 statement period
* `Chase Bank` as an institution/account hint
* `6789` as the account last-four hint

If a visible account has matching Chase metadata and the same currency, Sure will show that account as a suggestion with a confidence score.

## Reviewing suggestions

From Settings -> Statement Vault, unmatched statements show:

* The original filename
* Detected statement period, when available
* Suggested account, when Sure finds one
* Confidence score
* Actions to link or reject the suggestion

Selecting the link action files the statement against that account. Rejecting the suggestion clears it and marks the statement as rejected so it is not re-suggested by routine metadata edits.

## PDF imports and AI extraction

PDF transaction imports use the Statement Vault as their storage layer, but account matching and AI extraction are separate steps.

When you upload a PDF through the import flow, Sure first stores it as an unmatched statement, then creates a PDF import and queues AI processing. The AI processing classifies the document and may extract transactions for bank or credit card statements. That AI extraction does not currently improve the account suggestion; the suggestion comes from the statement metadata matching described above.

After transactions are extracted, the import still needs an account before it can be published.

### Reconciliation against existing transactions

When you assign an account to a PDF import, Sure compares each extracted transaction against what the account already holds. Transactions that already exist — whether from a provider sync or a previous import — are marked as reconciled rather than offered for import again. Only genuinely new transactions appear in the review screen.

This means you can safely import a PDF statement for a provider-backed account. Transactions that your bank sync already brought in are matched and skipped; only any gaps are offered for import.

Matching uses amount and date (with a small date window to account for posting-date differences between statements and provider records). Transaction names are not matched because statement descriptions and provider names for the same transaction rarely agree.

### Import summary

After AI extraction and account assignment, Sure shows a summary of the statement broken down into:

* **Extracted** — total transactions found in the statement
* **Already recorded** — transactions that already exist in the account
* **Imported** — transactions added by this import
* **Awaiting review** — transactions not yet published

A statement where every transaction was already on file completes with zero rows to import. The summary screen explains this outcome rather than showing a generic "Document analyzed" message.

### Reverting a PDF import

Reverting a PDF import removes the entries it created and releases the reconciliation marks it set on existing transactions. The import returns to a reviewable state so you can reassign the account or discard it.

## Tips for better matches

* Keep the institution name in the filename.
* Include the statement month or date range.
* Include a masked account suffix when available, such as `account_6789`.
* Avoid generic filenames like `statement.pdf`; they usually do not contain enough information to suggest an account confidently.
