SQL analytics, built in
ZeroDB Lakehouse
DuckDB SQL analytics over your ZeroDB data — no separate ETL pipeline, no data warehouse to stand up and pay for.
Query your agent’s memory and vector data with real SQL, not just vector search. Ingest records, then run SELECT statements directly against the Parquet files behind your project — results come back in milliseconds.
https://api.ainative.studio/api/v1/projects/{project_id}/database/lakehouse
curl -X POST https://api.ainative.studio/api/v1/projects/{project_id}/database/lakehouse/query \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT count(*) AS rows, avg(sog) AS avg_speed FROM ais",
"max_rows": 500
}'What is Lakehouse?
A query-in-place analytics layer built on DuckDB that runs read-only SQL directly against the Parquet data already stored in your ZeroDB project — built for AI-native apps that need to analyze, not just retrieve.
No separate warehouse
Your Parquet files already live in ZeroDB object storage. Lakehouse queries them in place — nothing to export or sync.
Real SQL, not just vectors
SELECT and WITH statements with joins, aggregates, and window functions — ask questions vector search alone can’t answer.
Tenant-isolated by design
Every query is physically scoped to your project’s own tenant path — one project can never see another’s data.
Immediate consistency
Ingested records are flushed right away, so a query right after an ingest call sees the new rows.
Three real API calls
Ingest, query, inspect
A realistic flow against the live endpoints, using the sample data from the Lakehouse API reference — an ais (vessel tracking) logical table.
1Ingest records into a logical table
Write 1–5,000 JSON records per call to POST /api/v1/projects/{project_id}/database/lakehouse/ingest. Data is flushed immediately, so it is queryable right away.
curl -X POST https://api.ainative.studio/api/v1/projects/{project_id}/database/lakehouse/ingest \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"sensor_type": "ais",
"records": [
{"mmsi": "123456789", "sog": 12.4, "lat": 36.97, "lon": -122.03},
{"mmsi": "987654321", "sog": 8.1, "lat": 36.95, "lon": -122.01}
]
}'
# {"records_written": 2, "sensor_type": "ais", "project_id": "..."}2Query it with real SQL
POST a single SELECT or WITH statement to POST /api/v1/projects/{project_id}/database/lakehouse/query. DuckDB executes it against the Parquet files directly — DDL, DML, raw filesystem paths, and multi-statement queries are rejected.
curl -X POST https://api.ainative.studio/api/v1/projects/{project_id}/database/lakehouse/query \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT count(*) AS rows, avg(sog) AS avg_speed FROM ais",
"max_rows": 500
}'
# {
# "columns": ["rows", "avg_speed"],
# "rows": [[2, 10.25]],
# "row_count": 1,
# "execution_time_ms": 42.7,
# "truncated": false
# }3Check usage and tables
GET /api/v1/projects/{project_id}/database/lakehouse/tables lists every logical table, and GET /api/v1/projects/{project_id}/database/lakehouse/stats returns aggregate storage usage across the whole project.
curl https://api.ainative.studio/api/v1/projects/{project_id}/database/lakehouse/tables \
-H "X-API-Key: your-api-key"
# [
# {
# "name": "ais",
# "format": "parquet",
# "file_count": 12,
# "total_bytes": 4194304,
# "last_modified": "2026-07-17T09:12:00Z"
# }
# ]Key facts
What you need to know before you build against Lakehouse.
60 requests per minute, per project
Query and ingest share one rate limit per project. Exceeding it returns 429 with a Retry-After header.
Tenant-isolated storage
Reads are physically scoped to tenant={project_id}/... in object storage, and project ownership is verified on every request.
DuckDB SQL dialect
SELECT and WITH statements only — no DDL/DML, no raw filesystem paths or read_parquet() calls, single statement per request.
All six endpoints
Full request/response schemas, auth details, and error codes for every endpoint are documented on the Lakehouse API reference.
Ready to query your data?
Run your first Lakehouse query in under a minute
No ETL job to schedule, no warehouse to provision — just SQL against data you’ve already stored.