Skip to main content

Vector Search

ZeroDB provides vector storage and semantic search with free embeddings — no OpenAI key required.

Store Vectors

curl -X POST https://api.ainative.studio/api/v1/public/zerodb/vectors \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"texts": ["ZeroDB is fast", "Semantic search is powerful"],
"metadata": [
{"source": "docs", "category": "product"},
{"source": "docs", "category": "feature"}
]
}'

Embeddings are generated automatically using TEI (HuggingFace Text Embeddings Inference) at zero cost.

Search by Meaning

curl -X POST https://api.ainative.studio/api/v1/public/zerodb/vectors/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "fast database for AI",
"limit": 5,
"min_score": 0.7
}'

Response:

{
"results": [
{
"id": "vec_abc...",
"text": "ZeroDB is fast",
"score": 0.94,
"metadata": {"source": "docs", "category": "product"}
}
]
}

LangChain Integration

from langchain_zerodb import ZeroDBVectorStore

store = ZeroDBVectorStore(
api_key="your-api-key",
project_id="your-project-id",
)

# Add documents (embeddings generated free)
store.add_texts(["ZeroDB is fast", "Semantic search"])

# Search by meaning
results = store.similarity_search("fast database", k=5)

LlamaIndex Integration

from llama_index_zerodb import ZeroDBVectorStore
from llama_index.core import VectorStoreIndex

store = ZeroDBVectorStore(
api_key="your-api-key",
project_id="your-project-id",
)

index = VectorStoreIndex.from_vector_store(store)
response = index.as_query_engine().query("What is ZeroDB?")

Embeddings

ZeroDB generates embeddings automatically using TEI with BAAI/bge models:

  • Model: BAAI/bge-base-en-v1.5
  • Dimensions: 768
  • Latency: ~16ms per embedding
  • Cost: Free at all tiers

You can also bring your own embeddings by passing a vector field instead of text.

Endpoints

MethodPathDescription
POST/zerodb/vectorsUpsert vectors with text or raw embeddings
POST/zerodb/vectors/searchSemantic similarity search
GET/zerodb/vectorsList vectors with pagination
DELETE/zerodb/vectors/{id}Delete a vector by ID
GET/zerodb/vectors/statsVector count and storage stats