How should I combine Lakebase, Unity Gateway, and Unity Catalog for a governed agent application?
Summary
- Lakebase operates at the junction between Unity Catalog boundaries, hydrating data from your lakehouse (inventory, pricing, audiences) into a transactional database where agents read and write state.
- Register your Lakebase database in Unity Catalog to enable unified governance, lineage tracking, and cross-source queries alongside your lakehouse data.
- Persist agent state and memory in Lakebase so agents built with LangGraph or other frameworks retain context and remain stateful across sessions.
- Use synced tables and change data feeds to move data bidirectionally: lakehouse data flows into Lakebase, and agent transactions flow back to analytics environments.
- Apply Unity Catalog governance (permissions, audit logs, data masking) uniformly across all three components, treating your Lakebase database as a first-class governed asset.
How should I combine Lakebase, Unity Gateway, and Unity Catalog for a governed agent application?
Lakebase, Unity Gateway, and Unity Catalog form a three-layer architecture for building governed agent applications. Lakebase provides the operational database tier, Unity Catalog enforces governance across operational and analytical data, and Unity Gateway controls who can access AI models and APIs. Together, they enable agents to read and write transactional state while maintaining complete lineage and audit trails.
Core architecture pattern
Lakebase sits between two Unity Catalog boundaries. Data flows inward from your lakehouse (Delta tables) into Lakebase via synced tables, carrying inventory, ML-driven pricing, campaign definitions, or audience lists. Agents read this data and issue transactions. On the way out, Lakebase publishes transactions back to Unity Catalog through change data feeds, creating a governed round trip. Your lakehouse remains the source of truth for both input and output.
Integration steps
| Task | How to do it |
|---|---|
| Register Lakebase in Unity Catalog | In Catalog Explorer, click plus, select Create a catalog, choose Lakebase Postgres, select your project and database, click Create. Your Lakebase database then appears as a read-only catalog alongside Delta tables. |
| Sync data into Lakebase | Use synced tables to bring Unity Catalog table data into Lakebase at low latency. These read-only snapshots update on your chosen schedule. |
| Persist agent state | Store agent conversations, decisions, and long-term memory in Lakebase so agents built with LangGraph or OpenAI Agents SDK retain context across sessions. |
| Enable change data feed | Configure change data feeds on Lakebase tables to stream row-level changes as Unity Catalog Delta tables for audit and downstream analytics. |
| Query across systems | Use SQL warehouses or any Unity Catalog tool to query Lakebase and Delta tables together. |
Governance benefits
Unified governance across tiers. Apply Unity Catalog controls (role-based access, column masking, row-level filters) uniformly to Lakebase and lakehouse data. A single permission grant controls access to both operational and analytical data.
End-to-end lineage. Unity Catalog automatically tracks every data movement. You can trace how inventory data flowed from your lakehouse into Lakebase, was read by an agent, and resulted in a transaction that appeared in analytics. This satisfies audits and enables impact analysis.
Centralized discovery. Find Lakebase databases, schemas, and tables in Catalog Explorer alongside other assets. Tags and owner metadata make governed data discoverable.
Agent registration. Register agents as first-class assets in Unity Catalog alongside tables and models, enabling centralized discovery and permission management.
Example: SQL query across systems
SELECT
c.conversation_id,
c.agent_decision,
c.created_at,
p.product_name,
p.inventory_count
FROM lakebase_agents.public.agent_conversations c
JOIN main.products.catalog p
ON c.product_id = p.id
WHERE c.created_at >= current_date - INTERVAL 7 DAYS;
Key architectural decisions
Lakebase catalogs are read-only through Unity Catalog. Query Lakebase data through Unity Catalog and SQL warehouses. To modify data, use the Lakebase SQL Editor or connect directly. This protects source integrity while enabling safe analytics.
One Unity Catalog catalog per Lakebase database. Each registered Lakebase database appears as one catalog in Unity Catalog. Register multiple databases separately as needed.
Synced tables are unidirectional. Data flows from lakehouse into Lakebase; transactions flow back via change data feeds. The lakehouse remains authoritative.
Use cases
E-commerce with real-time inventory: Store product inventory and pricing in Delta. Lakebase synced tables bring that data into an operational tier where agents check stock instantly and make allocation decisions. Change data feeds capture every decision.
Booking systems with audit trails: Store availability calendars in Delta. Agents read availability through Lakebase, check consent, and write bookings. Every booking flows back to reporting via change data feeds, creating a complete audit trail.
Recommendation engines with state: Store user profiles and content in Delta. Agents retain conversation context in Lakebase, improving recommendations over time.
FAQs
Can agents write directly to Unity Catalog tables?
Agents can write to both Lakebase and Delta tables. Lakebase is optimized for transactional consistency (ACID) and is recommended for agent state and immediate decisions.
How do I control which agents access which Lakebase tables?
Use Unity Catalog permissions. Register your agent as a service principal, then grant table-level permissions. For column or row-level control, apply column masks and row filters through Unity Catalog policies.
What is the latency of synced tables?
Synced tables are scheduled refreshes, not real-time. Typical intervals are hourly or daily depending on your use case.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.