---
title: "How H6.ai builds AI-powered financial automation with Lakebase Postgres"
description: "H6.ai automates accounts payable by reading invoices, matching them to purchase orders, assigning line items to accounts, and checking against company policies. The company faced a challenge: financial data changes constantly, so a result that differs from an earlier run could be due to code changes or data changes. H6.ai adopted a lakebase architecture with one dedicated Lakebase Postgres database per customer, each holding the customer’s full financial context. When an issue is found, the team branches the database to create a frozen snapshot; test runs fork a short-lived branch from that snapshot, process the invoice against the real pipeline, judge the result, and delete the branch. This approach provides isolation, frozen state, cheap disposable copies, and schema-safe replays, enabling trustworthy regression testing for AI-powered financial automation."
---

# How H6.ai builds AI-powered financial automation with Lakebase Postgres

[Databricks](https://yomu.fyi/company/databricks) · Benji Borg, Mauro Pirrone · Nov 12, 2026

**Type:** Problem & solution

## Summary

H6.ai automates accounts payable by reading invoices, matching them to purchase orders, assigning line items to accounts, and checking against company policies. The company faced a challenge: financial data changes constantly, so a result that differs from an earlier run could be due to code changes or data changes. H6.ai adopted a lakebase architecture with one dedicated Lakebase Postgres database per customer, each holding the customer’s full financial context. When an issue is found, the team branches the database to create a frozen snapshot; test runs fork a short-lived branch from that snapshot, process the invoice against the real pipeline, judge the result, and delete the branch. This approach provides isolation, frozen state, cheap disposable copies, and schema-safe replays, enabling trustworthy regression testing for AI-powered financial automation.

## Context

H6.ai automates accounts payable by reading invoices, matching them to purchase orders, assigning line items to accounts, and checking against company policies. The challenge is that financial data changes constantly (e.g., a purchase order’s remaining quantity may be consumed or amended during the day), making regression testing difficult because a changed result could be due to code changes or data changes.

## Approach / What changed

H6.ai uses a lakebase architecture with one dedicated Lakebase Postgres database per customer. Each database holds the customer’s full financial context (purchase orders, suppliers, chart of accounts, past transactions, and policies). When an issue is found, the team branches the customer’s database to create a frozen snapshot. Test runs fork a short-lived branch from that snapshot, process the invoice against the real pipeline, judge the result, and delete the branch. The snapshot remains unchanged for future tests.

## Takeaways

- H6.ai uses one dedicated Lakebase Postgres database per customer to isolate each customer’s financial data and policies.
- A Lakebase branch creates a frozen snapshot of a database at a point in time using copy-on-write, so the snapshot shares storage with the parent and only stores changes.
- Each test run forks a short-lived branch from a migrated snapshot, processes the invoice with the real pipeline, judges the result, and deletes the branch, leaving the snapshot unchanged.

## FAQ

### How does Lakebase branching work?

A Lakebase branch is an instant, isolated copy of a database that uses copy-on-write: a new branch shares storage with its parent, and only changed data is written separately. Branches appear instantly regardless of database size and do not slow down production.

### Does Lakebase Postgres support multi-tenancy?

Yes, in two ways: give each tenant its own database (as H6.ai does) or keep tenants in shared tables with PostgreSQL row-level security. Scale-to-zero suspends inactive compute, keeping per-tenant databases cost-efficient.

### Is Lakebase Postgres a good fit for AI use cases?

Yes. Lakebase serves as the backend for agent memory and real-time feature serving. Branching makes it easier to test AI systems by replaying real cases against frozen database snapshots to catch regressions when models or logic change.

**Tags:** [AI](https://yomu.fyi/topic/ai), [Financial Services](https://yomu.fyi/topic/financial-services), [Lakehouse](https://yomu.fyi/topic/lakehouse), [Postgres](https://yomu.fyi/topic/postgres), [Testing](https://yomu.fyi/topic/testing)

- Source: [Databricks](https://www.databricks.com/blog/how-h6ai-builds-ai-powered-financial-automation-lakebase-postgres)
- Source URL: https://www.databricks.com/blog/how-h6ai-builds-ai-powered-financial-automation-lakebase-postgres
- Ingested by Yomu: 2026-11-12T18:00:14.785Z

[Read original post](https://www.databricks.com/blog/how-h6ai-builds-ai-powered-financial-automation-lakebase-postgres)
