rs-puff
A modern Rust client for Turbopuffer, the serverless vector database.
Development
This is a bit of an experiment in agent-based coding. I have a little Rust-based Turbopuffer project I'd started on, but the only existing client I see, the unofficial ragkit/turbopuffer-client looks unmaintained and untyped. All of the existing clients are open source, making this a pretty agent-tractable problem.
For dev setup, I had Claude write an AGENTS.md that specified where the docs are, and I manually cloned all of the other clients to other-clients/, which I .gitignore-d. Then I just had Claude Opus 4.5 rip it with those instructions.
Installation
Add to your Cargo.toml:
[]
= "0.1"
Quick Start
use ;
use HashMap;
async
Client Configuration
// From environment variable TURBOPUFFER_API_KEY
let client = from_env?;
// With explicit API key
let client = new;
// With specific region
let client = with_region;
// With custom base URL
let client = with_base_url;
Namespace Operations
let ns = client.namespace;
// Write/upsert documents
ns.write.await?;
// Query documents
ns.query.await?;
// Multi-query (batch multiple queries)
ns.multi_query.await?;
// Delete all documents
ns.delete_all.await?;
// Get namespace metadata
ns.metadata.await?;
// Get schema
ns.schema.await?;
// Hint cache warm
ns.hint_cache_warm.await?;
Filters
Filters use a tuple-based format that matches the Turbopuffer API:
use Filter;
// Comparison operators
eq // ["name", "Eq", "alice"]
not_eq // ["status", "NotEq", "deleted"]
lt // ["age", "Lt", 30]
lte // ["age", "Lte", 30]
gt // ["score", "Gt", 0.5]
gte // ["score", "Gte", 0.5]
// Set operators
r#in
not_in
contains
contains_any
// String operators
glob // Glob pattern matching
iglob // Case-insensitive glob
regex // Regex matching
// Logical operators
and
or
not
Ranking
use RankBy;
// Vector similarity (ANN)
vector
// Exact k-NN
vector_knn
// BM25 text search
bm25
// Attribute ordering
asc
desc
// Combine rankings
sum
product
Distance Metrics
use DistanceMetric;
CosineDistance
EuclideanSquared
Listing Namespaces
use NamespacesParams;
let response = client.namespaces.await?;
for ns in response.namespaces
Environment Variables
TURBOPUFFER_API_KEY- Your Turbopuffer API key (required forClient::from_env())TURBOPUFFER_REGION- Optional region (e.g.,gcp-us-east1)
License
MIT