Skip to main content

LF AI & Data Sandbox Project

Postgres-native.Vector-native.Python-native.

An open lakehouse engine — a shared catalog, ACID upserts, SQL, incremental compute, vector search and a Python SDK, in Rust, over your object storage.

psql
$ psql "postgresql://lakesoul@localhost:5432/default"

default=> CREATE TABLE orders (
default(>   id bigint primary key,
default(>   region text,
default(>   amount numeric(20,4)
default(> );
CREATE TABLE

default=> INSERT INTO orders VALUES (1, 'APAC', 42.00)
default->   ON CONFLICT (id) DO UPDATE
default->   SET region = EXCLUDED.region, amount = EXCLUDED.amount;
INSERT 0 1

default=> SELECT region, sum(amount) FROM orders GROUP BY 1;
 region |  sum
--------+-------
 APAC   | 42.00
(1 row)

Four things it does

One engine for SQL, incremental compute, search and AI — not four systems stitched together.

SQL

Postgres-native

CREATE TABLE, INSERT ... ON CONFLICT and queries run in the engine. psql, JDBC and pg_catalog work, including psql \d; no sidecar, no CDC pipeline.

Incremental

Efficient incremental SQL

With incremental SQL enabled, INSERT ... SELECT updates its target from the commit log: only changed rows are written, and the result matches a full recompute.

ANN

Vector-native

pgvector-compatible SQL over IVF + RaBitQ indexes on object storage. Structured filters and ANN in one plan, with BM25 full-text search beside it.

Python

Python-native

The SDK reads object storage directly through Rust IO. Daft, Ray, PyTorch and Pandas — no gateway in the path, no second copy of the data.

Federated query

Query a remote database where it lives, join it with LakeSoul tables, and read or write it through the same PostgreSQL endpoint.

Define a foreign table

CREATE EXTENSION adbc_fdw;

CREATE SERVER app_source
FOREIGN DATA WRAPPER adbc_fdw
OPTIONS (
driver 'postgresql',
uri 'postgresql://source:5432/app'
);

CREATE FOREIGN TABLE remote_orders (
id bigint, region text, amount numeric(20,4)
)
SERVER app_source
OPTIONS (schema_name 'public', table_name 'orders');

Foreign tables, pushdown and writes

Join remote and local data

SELECT u.id, u.name, sum(o.amount) AS total
FROM local_users u
JOIN remote_orders o USING (id)
GROUP BY 1, 2;
PostgreSQLMySQLSQLiteDuckDBBigQuerySnowflakeTrinoS3 files

Incremental SQL

Maintain a derived table from the source commit log. Each run reads only new commits and writes only the rows that changed; the result matches a full recompute.

Run it as INSERT ... SELECT

SET lakesoul.ivm.enabled = on;

INSERT INTO daily_revenue
SELECT date_trunc('day', ts) AS day,
region,
sum(amount)
FROM orders
GROUP BY 1, 2;

How incremental SQL works

Replay-safe state

The engine keeps a cursor per target, folds the source commit log into the query, and writes target deltas. Retries replay the same window and skip rows already written.

commit-log cursorpartition-awarereplay-safejoins, aggregates, windows

PostgreSQL subscriptions

Consume PostgreSQL or MySQL changes into a LakeSoul CDC table. The endpoint manages the snapshot, the changes and the subscriber process.

Define it from psql

CREATE SUBSCRIPTION users_from_app
CONNECTION 'postgresql://user:pass@source:5432/app'
PUBLICATION app_pub
WITH (
source_table = 'public.users',
target_table = 'users',
snapshot = 'managed'
);

Set up the source publication and target table

Managed end to end

The endpoint validates the source and the CDC target, takes a managed snapshot with one atomic handoff, then streams changes in batches. ENABLE, DISABLE and DROP control the supervised local process.

managed snapshotlogical replicationatomic handoffsupervised process

Authentication and Permissions

Clients connect with a username and password. Each connection is scoped to the permissions granted to that user, so teams and agents see only the data they are allowed to use.

Scope each workload

Run separate compute clusters for different teams or agents against the same catalog. A connection sees only the namespaces and tables granted to its user.

username / passwordper-user permissionsworkload isolation

How it differs

A table format only describes file layout. A database ships an engine but owns your storage. LakeSoul is neither: it is the whole engine, and your data stays in your object storage.

A table format

Only file layout. No catalog, no execution engine, no indexes, no incremental state.

A database

Ships an engine, but the storage is its own. You move data in and operate its cluster.

LakeSoul

The catalog, the format, the engine and the indexes — storage stays yours.

Your data stays in your object storage, in open files. What you run on top is the whole engine, not just a compute layer.

catalogexecution enginevector + full-text indexesyour object storage

Architecture

Clients on top, multiple compute clusters in the middle, your storage at the bottom.

psycopg · JDBC · RAGPython SDK · Daft · Ray · PyTorch
Compute cluster ASubscriptions · FDW
Compute cluster BIncremental SQL
Compute cluster CBI Query · ANN
Object storage (S3 / OSS / HDFS)PostgreSQL metadata

Run it

Start the PostgreSQL endpoint, or install the Python SDK and read the same tables.

PostgreSQL endpoint

cargo run -p postgres-lakesoul -- --port 5433 \
--warehouse-prefix file:///tmp/lakesoul/warehouse

psql -h 127.0.0.1 -p 5433 -U lakesoul_test -d default

Full setup: metadata database and endpoint

Python SDK

from lakesoul import LakeSoulCatalog

catalog = LakeSoulCatalog.from_env()
scan = catalog.scan("orders").select("id", "amount")
table = scan.to_arrow_table()

Python quick start

Build with us

LakeSoul is an open source project under LF AI & Data. The Rust engine, the PostgreSQL front end and the Python SDK are all in the same repository.