Skip to main content
Version: V1.4.1

Embedded mode

Python, Node.js, Go, and Rust bindings start a local seekdb process and connect using the MySQL protocol. The Swift SDK runs the engine inside an iOS app and exposes a Unix socket. In either mode, the application opens a local data directory.

Choose a binding​

The table lists the embedded SDKs for seekdb V1.4.1, their engine versions, and supported platforms.

LanguageSDK versionEngine versionPlatformsGuide
Pythonpylibseekdb 1.4.11.4.1.0Linux x86_64 and ARM64, macOS ARM64, Windows x64PyPI
Node.js (JavaScript/TypeScript)@oceanbase/seekdb-node 1.4.11.4.1.0Linux x86_64 and ARM64, macOS ARM64, Windows x64npm
Goseekdb-go v1.4.11.4.1.0Linux x86_64 and ARM64, macOS ARM64, Windows x64Go quickstart
Rustseekdb 1.4.11.4.1.0Linux x86_64 and ARM64, macOS Intel and ARM64, Windows x64 (MSVC, preview)Rust quickstart
Swiftseekdb-swift 1.4.11.4.1.0iOS 18 or later, ARM64 device and simulatorSwift quickstart

To run SQL directly in your browser, open the online SQL Shell.

For the Python Collection API, use pyseekdb. For direct SQL from Python, see the pylibseekdb usage guide. The tabs below cover pyseekdb and the Node.js SQL binding.

Before migrating to V1.4.1, start the target runtime with an empty directory and use SELECT VERSION() to confirm that the engine reports 1.4.1.0. Follow Upgrade embedded seekdb to move existing data.

Environment requirements​

  • Supported operating systems: Linux (glibc >= 2.28)

  • Supported Python versions:

    • Use seekdb via pyseekdb: Python 3.11 to 3.13

    • Use seekdb via Python: CPython 3.11 to 3.14

  • Supported system architectures: x86_64, aarch64

You can run the following command to check whether your environment meets the requirements.

python3 -c 'import sys;import platform; print(f"Python: {platform.python_implementation()} {platform.python_version()}, System: {platform.system()} {platform.machine()}, {platform.libc_ver()[0]}: {platform.libc_ver()[1]}");'

The following result is returned:

Python: CPython 3.11.13, System: Linux x86_64, glibc: 2.32

Deploy seekdb using pyseekdb​

Use pip to install, which automatically loads embedded seekdb. The specific commands are as follows.

pip install -U pyseekdb
# Or specify an installation source for faster installation
pip install -U pyseekdb -i https://pypi.tuna.tsinghua.edu.cn/simple

Considerations​

If you are prompted that the pip version is too low when deploying seekdb, upgrade pip first before installing.

pip install --upgrade pip

Next steps​

pyseekdb is OceanBase's Python client for seekdb. It exposes one API surface and supports two database connection modes: embedded seekdb and server-mode seekdb.

For a detailed introduction and usage, see pyseekdb.

To upgrade an existing embedded instance, see Upgrade embedded seekdb.

Hybrid search SQL​

Use this sample with the Node.js connection above or the Go, Swift, and Rust quickstarts. Save it as hybrid-search.sql. It inserts four documents, builds a vector index, and combines full-text and vector rankings with reciprocal rank fusion (RRF). The sample uses fixed three-dimensional vectors so you can run it without an embedding model.

-- Run these statements in the test database of a fresh SeekDB instance.
CREATE TABLE quickstart_docs (
id INT PRIMARY KEY,
body VARCHAR(200) NOT NULL,
embedding VECTOR(3) NOT NULL,
FULLTEXT INDEX idx_body (body)
) ORGANIZATION HEAP;

INSERT INTO quickstart_docs VALUES
(1, 'SeekDB hybrid search', '[0.98,0.02,0]'),
(2, 'SeekDB installation guide for local application development', '[0,1,0]'),
(3, 'Combine keyword queries with vector retrieval', '[1,0,0]'),
(4, 'Tomato soup recipe', '[0,0,1]');

CREATE VECTOR INDEX idx_embedding ON quickstart_docs (embedding)
WITH (distance=l2, type=hnsw, lib=vsag);

SELECT JSON_PRETTY(DBMS_HYBRID_SEARCH.SEARCH('quickstart_docs', '{
"query": {"query_string": {"fields": ["body"], "query": "seekdb"}},
"knn": {"field": "embedding", "k": 2, "query_vector": [1,0,0]},
"rank": {"rrf": {"rank_window_size": 3, "rank_constant": 60}},
"_source": ["id", "body"],
"size": 3
}')) AS results;

The keyword seekdb retrieves documents 1 and 2. The vector query retrieves 3 and 1. The fused result is 1, 3, 2. Document 1 ranks first because both searches find it.