Every schema model has a backing store. Customer apps must define an Ablo schema. The schema is the contract between the SDK, agents, realtime subscriptions, and the Data Source endpoint. UseDocumentation Index
Fetch the complete documentation index at: https://docs.abloatai.com/llms.txt
Use this file to discover all available pages before exploring further.
defineSchema, model, and Zod the same way a Prisma project starts with a
schema.prisma.
By default, Ablo stores the rows for the models you declare. That makes Ablo the
managed state store for those resources, the same way Stripe stores Customer
and PaymentIntent objects that you create through Stripe’s API.
If you already have application tables and want those tables to remain
canonical, attach a Data Source. Then Ablo coordinates the write and calls your
app to commit it.
Your app can keep using its own DATABASE_URL. Store that value in your app or
backend environment, not in Ablo. The integration boundary is the HTTPS
endpoint your app exposes. The happy path uses the same server-side
ABLO_API_KEY to verify Ablo calls.
Use the SDK with an API key:
Ablo(...).
For the first production integration, prefer this shape:
Backing Modes
| Mode | Where rows live | What create/update/delete does | Use when |
|---|---|---|---|
| Ablo-managed | Ablo | Writes directly to Ablo’s managed state store, then returns the confirmed row and fans out realtime deltas. | New collaborative/agent state that can live in Ablo. |
| Data Source | Your app database | Sends a signed commit request to your route; your app writes its DB and returns canonical rows. | Existing app tables, regulated data, or teams that need their DB to stay canonical. |
ablo.<model>.create/update/delete are coordinated by Ablo, then confirmed rows
fan out to subscribers. Direct database writes outside Ablo need Data Source
events so connected humans and agents see the change.
When To Use A Data Source
Use a Data Source only when your existing application database remains the source of truth and Ablo should coordinate writes against it. If you are migrating an app where every button already calls a backend endpoint, read Integration Guide first, then Existing Python Backend for a concrete service-owned database example.What Ablo Gives You
When you add a Data Source in Ablo, you get:| Field | Purpose |
|---|---|
| Data Source endpoint | The public HTTPS endpoint in your app that Ablo calls. |
| API key | Stored in your app as ABLO_API_KEY; used by the SDK and the Data Source endpoint. |
| External-write feed | Optional events handler on the same Data Source endpoint. |
| Status | Last successful request, last error, and delivery attempts. |
- Expose one Data Source endpoint in your app.
- Store
ABLO_API_KEYin your app. - Verify signed HTTP calls before opening a database transaction.
- Keep your database credentials in your app.
- Write an outbox row when data changes outside Ablo.
Route
Commit Request
When Ablo calls your Data Source, it sends a signed JSON request:deltas only when your source already computes canonical change
events.
External Writes
If your app changes data outside Ablo, return those changes from anevents
handler so connected humans and agents stay current:
clientTxId lets Ablo drop SDK echoes that already produced a realtime update.
Events without clientTxId are treated as external writes.
Production Checklist
Before using a customer-owned database in production:- Keep
DATABASE_URLin the customer app or backend environment. - Use only the Data Source endpoint and
ABLO_API_KEYas the customer-facing integration boundary. - Verify signatures before opening a database transaction.
- Store
clientTxIdin an idempotency table before applying writes. - Return canonical rows after each commit.
- Write outbox events in the same transaction as non-Ablo writes.
- Dedupe outbox events by event
id. - Monitor last success, last error, retry count, event lag, and cursor.
Security
- Verify requests with
ABLO_API_KEY. - Keep database credentials in your app.
- Dedupe commits by
clientTxId. - Dedupe external events by event
id. - Use HTTPS in production.