Bkper Agent
Automatically extracts transactions from uploaded documents using AI. Drag invoices, receipts, or bank statements into your book — the agent extracts dates, amounts, and descriptions, then finds the right accounts based on your transaction history.
The agent learns from your corrections and improves extraction accuracy over time.
How it works
Upload — select an account and drop a file into the book. The agent extracts transactions from the document and creates drafts. For bank statements and CSVs, it creates one transaction per line item. For invoices and receipts, it creates a single transaction.
Attach — drop a file onto an existing transaction. The agent extracts data and updates the transaction with the extracted amount, date, description, and custom properties.
Note: Attachments are always treated as invoices or receipts, even if the file is a multi-page statement.
The agent detects the document type automatically:
- CSV files are always treated as statements (one transaction per row).
- PDFs and images are analyzed to decide if they contain a statement table (multiple transactions) or an invoice/receipt (single transaction).
Account discovery
After extracting data, the agent assigns From and To accounts by searching your book's transaction history for similar patterns:
- Extract key terms — AI identifies meaningful parts of the description (e.g.
Office DepotfromOFFICE DEPOT #1234 PURCHASE 04/15) - Search by account + creator — finds posted transactions with similar terms, scoped to the selected account and user
- Search by account — same search, any user
- Search by description — searches across all accounts
- Pick by frequency — assigns the most commonly used accounts from matching results
When you correct an account and post the transaction, the agent re-runs discovery on all pending drafts in the book — one correction can fix many.
When the agent finds matching transactions to determine the accounts, it also looks at the custom properties on those historical transactions. If every matching transaction shares the same property (for example, a consistent category or project code), the agent copies that property onto the new draft. Properties that have already been auto-copied are tracked per-account so they are not suggested again.
The agent also extracts amounts and dates from transaction descriptions using AI, even without a file upload.
Learning from corrections
When you edit an AI-extracted transaction and post it, the agent compares the posted version against its original extraction. If the data changed significantly, it improves its extraction instructions:
- Reflect — analyze what the extraction got wrong
- Curate — generate new instructions and merge with existing ones
- Validate — re-extract the document with the improved instructions and verify results are better without regressions
The improved instructions are saved to purpose-specific properties on the account or group: agent_prompt_transaction for invoices and receipts, and agent_prompt_transactions for statements. Future documents processed through that account or group benefit from the accumulated learning.
For invoices, this runs immediately on post. For statements, the agent flags the account or group and processes improvements asynchronously.
When an account or group has no stored prompt yet, the first posted transaction through that account can establish a baseline prompt automatically — even if you made no corrections. This gives the agent a starting point for future improvements.
Existing agent_prompt values are still honored as a silent fallback, but new prompt improvements are saved to the purpose-specific properties.
Configuration
Account and group properties
| Property | Description |
|---|---|
agent_prompt_transaction |
Custom extraction instructions for invoices and receipts that produce a single transaction |
agent_prompt_transactions |
Custom extraction instructions for statements and CSVs that produce multiple transactions. The agent appends learned statement instructions here automatically |
agent_prompt_file |
Custom extraction instructions for file-level metadata properties, such as invoice numbers, statement periods, or bank names |
agent_prompt_skip |
JSON array or comma-separated list of property keys to ignore during extraction comparison and learning |
agent_parser_url_transaction |
URL of an external invoice/receipt extraction service that returns one transaction |
agent_parser_url_transactions |
URL of an external statement extraction service. When set, multi-transaction file parsing is delegated to this endpoint instead of using built-in AI |
agent_parser_url_file |
URL of an external file metadata extraction service that returns file properties |
Example — custom statement extraction instructions:
agent_prompt_transactions: |-
Extract transactions from the statement table.
- Do not include header rows
- Include the reference number as a property called "ref"
Example — skip properties that vary per transaction:
agent_prompt_skip: ["trade_date", "settlement_date"]
Book properties
| Property | Description |
|---|---|
agent_parser_url_transaction |
URL of an external invoice/receipt extraction service for this book. Account and group agent_parser_url_transaction take priority |
agent_parser_url_transactions |
URL of an external statement extraction service for all statement files in this book. Account and group agent_parser_url_transactions take priority |
agent_parser_url_file |
URL of an external file metadata extraction service for this book. Account and group agent_parser_url_file take priority |
Events handled
| Event | Behavior |
|---|---|
FILE_CREATED |
Extracts transactions from the uploaded file and creates draft transactions. Delegates purpose-specific extraction to external services when parser URL properties are set |
TRANSACTION_CREATED |
When a transaction has an attached file, extracts transaction and optional file metadata, then updates it. Also runs account discovery and AI-based amount/date extraction on all new transactions |
TRANSACTION_POSTED |
Compares posted data against the original AI extraction and improves the prompt if corrections were made. If the posted transaction's credit or debit account changed, the agent re-runs account discovery on pending drafts in the book (skipped when the backlog has more than 50 items) |
TRANSACTION_UPDATED |
Same as TRANSACTION_POSTED |
TRANSACTION_DELETED |
Flags the source account for prompt improvement when a statement-extracted transaction is deleted, indicating a false positive |
BOOK_AUDITED |
Processes one flagged account or group, running the full improvement pipeline for statement extraction |
Supported file types
| Format | Extensions |
|---|---|
| CSV | .csv |
.pdf |
|
| Images | .jpg, .jpeg, .png, .bmp, .webp |
External extraction service
External parsers are configured per purpose. A parser URL takes precedence over the GenAI prompt for that same purpose:
agent_parser_url_transactionreturnsdata.transactionfor invoices and receipts.agent_parser_url_transactionsreturnsdata.transactionsfor statements and CSVs.agent_parser_url_filereturnsfile.propertiesfor file-level metadata.
Lookup priority is account property, account's group property (first match), explicit group property, then book property. The service receives a POST request with file content (base64-encoded), book metadata, and account context when available.
For statement transactions, each returned transaction can optionally include:
book_id— record the transaction in a different book than the upload targetaccount_name— assign the transaction to a specific account by name
The same endpoint may be configured for multiple parser URL properties; the agent consumes only the response section for the configured purpose.
Transaction metadata
The agent stores metadata on processed transactions. These are internal properties (suffixed with _) used for learning and traceability:
| Property | Description |
|---|---|
agent_extracted_ |
Original AI extraction data (JSON). Used to detect corrections when the transaction is posted |
agent_file_id_ |
ID of the source file. Links statement transactions to their document |
agent_credit_account_id_ |
ID of the discovered credit account |
agent_debit_account_id_ |
ID of the discovered debit account |
agent_description_part_ |
The key term that matched during account discovery |
Learn more
- Recording transactions — how to record and manage transactions in Bkper