CocoIndex installation

Add the CocoIndex Rust SDK to a Cargo project, choose its feature flags, and install the cocoindex CLI for Rust projects.

Version
v 1.0.14
Last reviewed
Nov 4, 2026
ExperimentalThe Rust SDK is experimental. It is outside CocoIndex's compatibility promise: any release, including a minor one, may change or remove its API. It is not yet published on crates.io.

Install Rust

Install Rust with rustup. The SDK needs Rust 1.91.1 or later (edition 2024).

Add the SDK to your crate

The cocoindex crate is not on crates.io yet. Depend on it from the GitHub repository:

Cargo.toml
[dependencies]
cocoindex = { git = "https://github.com/cocoindex-io/cocoindex" }
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", features = ["full"] }

To work against a local checkout of the repository instead, use a path dependency on rust/sdk/cocoindex:

Cargo.toml
[dependencies]
cocoindex = { path = "../cocoindex/rust/sdk/cocoindex" }

The crate builds the CocoIndex engine from source, so the first build takes a few minutes.

Feature flags

The default build has the core API: apps, functions, memoization, mounting, context, and the LocalFS source and target. Connectors and operations are behind Cargo features, so a crate builds only what it uses. Turn on the ones you need:

Cargo.toml
[dependencies]
cocoindex = { git = "https://github.com/cocoindex-io/cocoindex", features = [
    "postgres",
    "text",
    "fastembed",
    "fs_live",
] }
FeatureWhat it adds
fs_liveLive LocalFS directory watching (fs::DirWalker::live)
textText splitting and language detection (ops::text)
code_matchStructural code matching over tree-sitter ASTs (ops::code)
fastembedLocal sentence-transformer text embeddings (ops::sentence_transformers) and CLIP image embeddings (ops::image); pulls in the ONNX runtime
embed_apiRemote embeddings and transcription over an OpenAI-compatible HTTP API (ops::api)
chrono, rust_decimalMemoization keys for chrono and rust_decimal values; connector features turn these on as needed
postgresPostgreSQL source and target
sqliteSQLite target
dorisApache Doris target
surrealdbSurrealDB target
surrealdb_memSurrealDB’s embedded in-memory engine (mem://), for tests
neo4jNeo4j target
falkordbFalkorDB target
lancedbLanceDB target (the build needs protoc)
qdrantQdrant target (the build needs protoc)
turbopufferTurbopuffer target
valkeyValkey / Redis vector-search target
zvecZvec target (the build downloads the prebuilt zvec C library)
bigqueryGoogle BigQuery target
snowflakeSnowflake target
kafkaKafka source and target
iggyApache Iggy source and target
amazon_s3Amazon S3 (and S3-compatible) source
azure_blobAzure Blob Storage source
google_driveGoogle Drive source
oci_object_storageOCI Object Storage source

Each connector page names the feature it needs.

Install the CLI

The cocoindex CLI for Rust projects builds your crate and runs its apps: ls, show, update, drop and init. It is not on crates.io yet. Build it from a checkout of the repository:

git clone https://github.com/cocoindex-io/cocoindex
cd cocoindex
cargo install --path rust/cli

The package is cocoindex_cli; the binary it installs is cocoindex. Start a new project with it:

cocoindex init my_project

The scaffold depends on the SDK through its git repository. See the CLI reference for every command.

System requirements

The Rust SDK is built and tested on:

  • macOS: arm64
  • Linux: x86_64 or arm64
  • Windows: x86_64