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.
| Language | SDK version | Engine version | Platforms | Guide |
|---|---|---|---|---|
| Python | pylibseekdb 1.4.1 | 1.4.1.0 | Linux x86_64 and ARM64, macOS ARM64, Windows x64 | PyPI |
| Node.js (JavaScript/TypeScript) | @oceanbase/seekdb-node 1.4.1 | 1.4.1.0 | Linux x86_64 and ARM64, macOS ARM64, Windows x64 | npm |
| Go | seekdb-go v1.4.1 | 1.4.1.0 | Linux x86_64 and ARM64, macOS ARM64, Windows x64 | Go quickstart |
| Rust | seekdb 1.4.1 | 1.4.1.0 | Linux x86_64 and ARM64, macOS Intel and ARM64, Windows x64 (MSVC, preview) | Rust quickstart |
| Swift | seekdb-swift 1.4.1 | 1.4.1.0 | iOS 18 or later, ARM64 device and simulator | Swift 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.
- Deploy embedded seekdb with pyseekdb
- Deploy embedded seekdb with Node.js
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.
Environment requirements
- Node.js 22 or later
- Linux on x86_64 or ARM64 with glibc 2.28 or later
- macOS 15.0 or later on ARM64
- Windows 10 or later on x86_64
Install the Node.js binding
In your Node.js project, install the binding for V1.4.1 and the mysql2 client. npm installs the native runtime for your platform as an optional dependency.
npm install --include=optional @oceanbase/seekdb-node@1.4.1 mysql2
Start seekdb and verify the engine version
Save the following code as example.mjs. For the first run, use a new data directory. The example closes the SQL connection before closing the seekdb handle.
import { seekdb } from "@oceanbase/seekdb-node";
import mysql from "mysql2/promise";
const db = await seekdb.open("./seekdb-v1.4.1");
try {
const endpoint = db.connectionOptions();
const address = endpoint.transport === "tcp"
? { host: endpoint.host, port: endpoint.port }
: { socketPath: endpoint.unixSocket };
const connection = await mysql.createConnection({ ...address, user: endpoint.user });
try {
const [[{ version }]] = await connection.query("SELECT VERSION() AS version");
console.log(version);
} finally {
await connection.end();
}
} finally {
db.close();
}
Run node example.mjs. The output for V1.4.1 is 5.7.25-OceanBase seekdb-v1.4.1.0.
Next steps
To try hybrid search, add database: "test" to the MySQL connection options and run the hybrid search SQL.
To migrate 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.