AI Categorization
AI Transaction Categorization
Open Ledger uses advanced AI to automatically categorize your financial transactions according to double-entry accounting principles. This system analyzes transaction data, determines the economic nature of each transaction, and suggests the most appropriate categories from your chart of accounts.
How It Works
Our AI categorization system:
- Analyzes transaction details (amount, description, counterparty, etc.)
- Uses vector search to find similar historical transactions for context
- Enriches the data with AI-generated context about the transaction
- Determines the transaction type (expense, revenue, transfer, etc.)
- Identifies the most appropriate category codes based on your chart of accounts
- Provides a confidence score for each suggestion
- Streams results in real-time using Server-Sent Events
API Endpoint
The AI categorization endpoint is available at:
Note: This endpoint uses Server-Sent Events (SSE) for real-time streaming of categorization results.
Request Parameters
Transaction Object Structure
Example Request
Response Format (Server-Sent Events)
The API returns categorization suggestions as Server-Sent Events. Each event contains a JSON object:
For Already Categorized Transactions:
For New Transactions (Streaming):
Error Responses:
Retry Logic
The API includes automatic retry logic for failed categorizations:
Transaction Types
The AI categorization system identifies several transaction types:
Integration Examples
JavaScript (with Server-Sent Events)
Python (with SSE Support)
Best Practices
-
Provide Complete Transaction Data: Include all available fields (description, counterparty, amount, date) for better categorization accuracy.
-
Handle Streaming Responses: Implement proper SSE handling to receive real-time updates during categorization.
-
Monitor Confidence Scores: Review suggestions with confidence scores below 0.8 before applying them.
-
Batch Process: Send multiple transactions in a single request for efficiency.
-
Handle Retries: The system automatically retries failed categorizations, but implement error handling for permanent failures.
-
Set Up Categories: Ensure your entity has a well-structured chart of accounts with
isCategory: true
accounts. -
Use Vector Context: The system leverages historical transaction patterns for better accuracy over time.
Vector Enhancement Features
Our AI categorization includes advanced vector-based features:
- Semantic Similarity: Finds similar transactions based on meaning, not just keywords
- Historical Context: Uses past categorization patterns to improve suggestions
- Adaptive Learning: Gets better over time as you categorize more transactions
- Contextual Enrichment: Provides detailed analysis of counterparties and transaction purposes
Error Handling
The streaming API can return various error conditions:
Always implement proper error handling for production applications.