Skip to main content
Baidu VectorDB is an enterprise-level distributed vector database service developed by Baidu Intelligent Cloud. It is powered by Baidu’s proprietary “Mochow” vector database kernel, providing high performance, availability, and security for vector search.

Installation

Usage

Config

Here are the parameters available for configuring Baidu VectorDB: For the TypeScript OSS SDK, use the camelCase equivalents:
  • databaseName
  • tableName
  • embeddingModelDims
  • metricType
For OSS TS usage, endpoint, account, apiKey, databaseName, tableName, and embeddingModelDims are required unless you inject a prebuilt client. metricType defaults to L2, matching the Python SDK.

Distance Metrics

The following distance metrics are supported:
  • L2: Euclidean distance (default)
  • IP: Inner product
  • COSINE: Cosine similarity

Index Configuration

The vector index is automatically configured with the following HNSW parameters:
  • m: 16 (number of connections per element)
  • efconstruction: 200 (size of the dynamic candidate list)
  • auto_build: true (automatically build index)
  • auto_build_index_policy: Incremental build with 10000 rows increment
The TypeScript provider also creates a BM25 inverted index over a textLemmatized column so keywordSearch() runs against a real full-text index. Mem0 lemmatizes the query before it reaches the vector store, so only the lemmatized form of each memory is indexed. If you point tableName at a table created before this index existed, keywordSearch() returns null and search falls back to vector similarity alone; recreate the table to enable it.