Skip to content
Bkper Bkper

Bkper Agent

by Bkper

Extract and categorize transactions instantly with AI. Upload invoices, receipts, or bank statements and the agent automatically extracts amounts, dates, descriptions, and intelligently finds the right accounts in your book.

sequenceDiagram participant Book as 📚 Bkper Book participant Agent as ✨ Bkper Agent participant LLM as 🧠 LLM Book->>Agent: Transactions and Files Agent->>Book: Get Context & Samples Agent->>LLM: Document + Context LLM->>Agent: Extracted Data Agent->>Agent: Discover Accounts Agent->>Book: Create/Update Transaction

Features

  • Smart Learning: Learns from existing transactions in your book to match your bookkeeping patterns
  • Import: Upload files to an book → creates new transactions
  • Attach: Attach files to existing transactions → updates them with extracted data
  • Context-Aware: Uses account properties to guide parsing for specific document types
Advanced Configuration

The Agent should be working out of the box for most cases, but you can customize its behavior.

Book Properties

  • agent_prompt_book_id: ID of a remote book to fetch contexts from (for centralized configuration)

Account/Group Properties

  • agent_prompt: Instructions for extracting data from documents when parsing
  • agent_prompt_id: ID to match context from remote book - defaults to account/group name

Example Setup

  1. Create the "Bank Itau" account that represents your checking account.
  2. Add agent_prompt property to the account with the value:
Markdown
Extract Transactions in Date Sequence table from the document.

- Do not include headers
- quantity and price are optional properties and should be added to properties only include if the column Quantity and Price filled, leave it null otherwise.
  1. Upload bank statements with this account selected → transactions are created automatically

Development & Deployment

Local Development

For local development, you can bypass Cloudflare AI Gateway by setting the bypassAIGateway environment variable:

Bash
# .env file
bypassAIGateway=true
GEMINI_API_KEY=your_gemini_api_key

This connects directly to the Gemini API without caching or analytics.

Production Deployment

⚠️ Important: When deploying to production, ensure the following environment variables are configured as Cloudflare Worker secrets:

  • GEMINI_API_KEY - Your Google Gemini API key
  • CF_ACCOUNT_ID - Your Cloudflare account ID
  • CF_AI_GATEWAY_TOKEN - Cloudflare AI Gateway token
  • Do NOT set bypassAIGateway (or set it to "false")

Production deployments should use Cloudflare AI Gateway for:

  • Request caching (cost reduction)
  • Rate limiting and usage control
  • Analytics and monitoring
  • Centralized logging

Configure secrets using:

Bash
wrangler secret put GEMINI_API_KEY
wrangler secret put CF_ACCOUNT_ID
wrangler secret put CF_AI_GATEWAY_TOKEN

See Cloudflare AI Gateway docs for setup instructions.