Skip to main content

ApexBase



PyPI Python License

ApexBase is a high-performance embedded HTAP database with a Rust core and a Python-first API.

Install it, choose persistent .apex files or a true process-local in-memory database, run analytical SQL, import/export DataFrames, and optionally expose persistent data through PostgreSQL Wire or Arrow Flight. No separate database service is required.

Why ApexBase

What you need What ApexBase gives you
Fast local analytics Columnar storage, shared scan/selection operators, vectorized execution, SQL aggregations, joins, CTEs, windows, and indexes
Low-friction Python workflows ApexClient, apexbase.execute, Pandas / Polars / PyArrow conversion, file table functions, and local or in-memory storage
One engine for mixed workloads HTAP design: fast writes, point lookups, analytical scans, transactions, and MVCC
Search built in Full-text search, vector TopK, Float16/BFloat16/Int8/UInt8/1Bit/TurboQuant storage, and exact reranking from a retained source vector
Tool compatibility PostgreSQL Wire for database clients and Arrow Flight for fast columnar transfer

Install

pip install apexbase

Build from source:

python -m pip install maturin
maturin develop --release

30-Second Example: FTS + SQL + Vector Search In One Local File

from apexbase import ApexClient

with ApexClient("./rag-data") as client:
    client.execute("""
        CREATE TABLE articles (
            title TEXT,
            body TEXT,
            category TEXT,
            views INT,
            embedding FLOAT16_VECTOR
        )
    """)
    client.use_table("articles")

    client.store([
        {
            "title": "Rust-powered local analytics",
            "body": "A columnar embedded database for fast SQL and search.",
            "category": "database",
            "views": 4200,
            "embedding": [0.10, 0.82, 0.20],
        },
        {
            "title": "Hybrid retrieval for RAG",
            "body": "Combine full-text recall, SQL filters, and semantic vector ranking.",
            "category": "ai",
            "views": 6100,
            "embedding": [0.16, 0.74, 0.58],
        },
        {
            "title": "SQLite migration notes",
            "body": "Move local applications to an analytical embedded store.",
            "category": "database",
            "views": 2600,
            "embedding": [0.80, 0.12, 0.10],
        },
    ])

    client.execute("CREATE FTS INDEX ON articles(title, body)")

    # FTS recall + structured SQL guardrails + pgvector-style semantic rerank.
    df = client.execute("""
        SELECT
            title,
            category,
            views,
            cosine_distance(embedding, [0.12, 0.78, 0.25]) AS semantic_dist
        FROM articles
        WHERE MATCH('database')
          AND category = 'database'
          AND views > 3000
        ORDER BY semantic_dist
        LIMIT 5
    """).to_pandas()

    print(df)

ApexBase gives you pgvector-style semantic search, SQL filters, and full-text search in the same embedded database file. It is the kind of stack you would otherwise assemble from SQLite/DuckDB + FTS + pgvector, but without a server process or a separate search/vector service; results still convert directly to Pandas, Polars, or Arrow.

For scratch work, tests, and short-lived analytics, use the same API without creating database, catalog, WAL, delta, or index files:

from apexbase import ApexClient

with ApexClient(":memory:") as client:
    client.execute("CREATE TABLE metrics (name TEXT, value DOUBLE)")
    client.execute("INSERT INTO metrics VALUES ('latency_ms', 2.4)")
    print(client.execute("SELECT AVG(value) AS average FROM metrics").scalar())

For the smallest SQL-only scripts, apexbase.execute(...) uses one lazily created process-local in-memory connection shared by later module-level calls.

Performance At A Glance

The latest retained complete public snapshot uses 1,000,000 tabular rows and 1,000,000 vectors x 128 dimensions on Apple arm64 with Python 3.12.

Area Snapshot
Public coverage 102 tabular metrics, 6 exact-vector metrics, and 8 ApexBase quantized-vector precision rows
Comparable results ApexBase wins 111 / 114 rows with a direct competitor in the retained complete snapshot
Exact vector search All 6 single/batch Float32 TopK rows beat the compared engines and match brute-force exact top-k row sets
Reproducibility Fixed data sizes, 2 warmups, 5 timed iterations, dependency metadata, and a retained JSON report

Benchmarks are workload-sensitive. The default benchmark command tracks this public scoreboard; extended diagnostics live in benchmarks/bench_vs_sqlite_duckdb_extended.py. See the full reproducible setup in the Performance documentation.

Starting with 1.33, filtered grouped queries can use a shared physical scan protocol across persisted base data and delta/overlay state. The protocol keeps predicate selection, grouping, HAVING, and ordered TopK as composable operators with a generic fallback for unsupported or inexact predicate forms. See Scan & Physical Execution.

Documentation

Start here: https://birchkwok.github.io/apexbase/

Goal Page
Get running quickly Installation and Quick Start
Understand the model Core Concepts
Use the Python API Python Client Guide and API Reference
Write SQL SQL Guide
Import files and DataFrames Data Import
Use database tools or Arrow clients Server Protocols
Search text or vectors Full-Text Search, Float16 Vectors, and Vector Quantization
Embed from Rust Rust Embedded API

Interfaces

# Embedded Python
python -c "from apexbase import ApexClient; print(ApexClient)"

# PostgreSQL Wire + Arrow Flight together
apexbase-serve --dir ./data

# Individual protocol servers
apexbase-server --dir ./data --port 5432
apexbase-flight --dir ./data --port 50051

Lance Interop

from apexbase import ApexClient

with ApexClient("./data") as client:
    client.use_table("articles")
    client.to_lance("./articles.lance")

with ApexClient("./imported") as client:
    client.from_lance("./articles.lance", table_name="articles")

Lance conversion uses Arrow tables as the handoff path. This keeps the in-process conversion lean and Arrow-native, while each format still writes its own on-disk layout.

License

Apache-2.0

Metadata

Release files for apexbase 1.34.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apexbase 1.34.0
File Size Uploaded
apexbase-1.34.0.tar.gz 1.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for apexbase 1.34.0
File
apexbase-1.34.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
apexbase-1.34.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
apexbase-1.34.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
apexbase-1.34.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
apexbase-1.34.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
apexbase-1.34.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
apexbase-1.34.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
apexbase-1.34.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
apexbase-1.34.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
apexbase-1.34.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
apexbase-1.34.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
apexbase-1.34.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
apexbase-1.34.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
apexbase-1.34.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
apexbase-1.34.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details

Total release size: 165.5 MB

Release files / apexbase-1.34.0.tar.gz

Download URL apexbase-1.34.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
fc52ace59e8c4c55f260fb0ef34fc6db7e7588d897dfb04cce063147095e8617
BLAKE2b-256 checksum
How to use checksums
044a9db22cbd9c1fe675f8fa6eacd62c57744d78df99e89b8ebdaf03cdaa01d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp313-cp313-win_amd64.whl

Download URL apexbase-1.34.0-cp313-cp313-win_amd64.whl
Size 11.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
07a83b203328a936355303b71668eab11bf40725c3597a94e8d2ee1b7a6a0909
BLAKE2b-256 checksum
How to use checksums
e969341d97974d9e240c43853437d4ec1ced478b3b6d73571c818af087742cc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL apexbase-1.34.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.2 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
51e7c16205dc7b837e69262f8c4f515b7b50395ae4642f8639bb9c858518edd4
BLAKE2b-256 checksum
How to use checksums
3409154f6f2bfcd35328fcc01214a0bd8f65173be7bb8d2176ae494d402defaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL apexbase-1.34.0-cp313-cp313-macosx_11_0_arm64.whl
Size 10.0 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2772185fb481ae386f24dfb5febbfa051fd34ff3bec5b9a58550125975973d3a
BLAKE2b-256 checksum
How to use checksums
cff0ae8896f429a5465fc336d9aa15b30aff205b7b2a6deb3f5668203814b09e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp312-cp312-win_amd64.whl

Download URL apexbase-1.34.0-cp312-cp312-win_amd64.whl
Size 11.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d0d1a011d48ed8cd4270e4b6b8143a86ff58b7771c8009fe3f8eb01b25ee0cc6
BLAKE2b-256 checksum
How to use checksums
99c7b5eba14d4043b9ff5b68b4ac050e26d8022b93196e5d83e5326aa2d07b28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL apexbase-1.34.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1c44824335f5222940b9197204ca8a6b33588c290fb968a801bbbc3b0c3d4a27
BLAKE2b-256 checksum
How to use checksums
74c253e05b3735a5ec415d92da8186e51455c759a06fe02c52e09753154d2282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL apexbase-1.34.0-cp312-cp312-macosx_11_0_arm64.whl
Size 10.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc31c1107bbfa7eb6252f530a17d472233f8f6de37ebbf4f501421226e058fa7
BLAKE2b-256 checksum
How to use checksums
2e27acc92033dbadd73e3365b57101d30aa0c2395e875acab4faa199fc7c76d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp311-cp311-win_amd64.whl

Download URL apexbase-1.34.0-cp311-cp311-win_amd64.whl
Size 11.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
61fb3edd570d1b8b3c5a495c55cc7d8ec8886dbf562f204a8ee7672425054054
BLAKE2b-256 checksum
How to use checksums
e007105c4af974a38b457d6703a368eb441dbe7690dacb8666d9c735908963c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL apexbase-1.34.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bab9359e9b22e4bf996c60ca1745fafe918a9068c7ded1e243f4fbb9b26c1f14
BLAKE2b-256 checksum
How to use checksums
155c7409e4daef1e4cc8c0bd142eb0f26dd0d61f35964c04352d31c1dfabc30f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL apexbase-1.34.0-cp311-cp311-macosx_11_0_arm64.whl
Size 10.0 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
79afc3d7327bfbc615d2ecb98244ee95f794ee3f11d4026c9f3aa5c644718269
BLAKE2b-256 checksum
How to use checksums
a6f0bfbb17ee3f17a3af9d7d424c87b8ef3682dcf1cfacd13c1fe77c213d08b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp310-cp310-win_amd64.whl

Download URL apexbase-1.34.0-cp310-cp310-win_amd64.whl
Size 11.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1ecee0ab59f1f77e8be27f064e53c54e421e2c3ef75054d55f1621fb284fc635
BLAKE2b-256 checksum
How to use checksums
5caba744e79ba035002891bd2b6512a00125aec35955daeb219ecdcd12bc51ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL apexbase-1.34.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4fe4751f321c89a2577b25aa7f8b39e821c7e1c95ee2f12ae0c40eee685ee180
BLAKE2b-256 checksum
How to use checksums
fda35dd417259ad5aeb9a13625f53cd73a9fb85f8c7d58076f4d073c57466af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL apexbase-1.34.0-cp310-cp310-macosx_11_0_arm64.whl
Size 10.0 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
60395e8516240332362ca633809ec39500bec2674febd25b4b793dde2e250ff1
BLAKE2b-256 checksum
How to use checksums
ae1442069a372e416977147d8da273e1f81e693576c7b3dbd66fbacc813e4886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp39-cp39-win_amd64.whl

Download URL apexbase-1.34.0-cp39-cp39-win_amd64.whl
Size 11.6 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
b08dc90bca86a41c98a737d03bceff34e62c54c20873e4752346f396407629ee
BLAKE2b-256 checksum
How to use checksums
7b7b1ea35defd65f4d6e36affa1a99af3e7ede1a8172669329b14d6741688836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL apexbase-1.34.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7dc56a70213ba1de7323da8ad5e956997a60827249ee928aa693fe2430184751
BLAKE2b-256 checksum
How to use checksums
3db2838b0a704e1eb3795f5e9fdc8941c1154ed181beae157c1a0762dc261340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / apexbase-1.34.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL apexbase-1.34.0-cp39-cp39-macosx_11_0_arm64.whl
Size 10.0 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cba320d9b99408cb7bee73f056d4a73fe2c57fb719cbd0aa20aaed7f44578bdd
BLAKE2b-256 checksum
How to use checksums
e24231c505169080b1a8ecaf35571c25d194563c859db50747061fc4451a7e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

1.34.0 This release

16 release files

1.9.0

16 release files

1.8.0

16 release files

1.7.0

16 release files

1.6.0

16 release files

1.5.0

16 release files

1.4.0

16 release files

1.3.0

16 release files

1.2.0

16 release files

1.1.0

16 release files

1.0.0

16 release files

0.3.0

16 release files

0.2.3

16 release files

0.2.2

12 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page