alicloud-ai-search-dashvectorBuild vector retrieval with DashVector using the Python SDK. Use when creating collections, upserting docs, and running similarity search with filters in Claude Code/Codex.
Install via ClawdBot CLI:
clawdbot install cinience/alicloud-ai-search-dashvectorCategory: provider
Use DashVector to manage collections and perform vector similarity search with optional filters and sparse vectors.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashvector
DASHVECTOR_API_KEYDASHVECTOR_ENDPOINT (cluster endpoint)name (str)dimension (int)metric (str: cosine | dotproduct | euclidean)fields_schema (optional dict of field types)docs list of {id, vector, fields} or tuplessparse_vector and multi-vector collectionsvector or id (one required; if both empty, only filter is applied)topk (int)filter (SQL-like where clause)output_fields (list of field names)include_vector (bool)import os
import dashvector
from dashvector import Doc
client = dashvector.Client(
api_key=os.getenv("DASHVECTOR_API_KEY"),
endpoint=os.getenv("DASHVECTOR_ENDPOINT"),
)
# 1) Create a collection
ret = client.create(
name="docs",
dimension=768,
metric="cosine",
fields_schema={"title": str, "source": str, "chunk": int},
)
assert ret
# 2) Upsert docs
collection = client.get(name="docs")
ret = collection.upsert(
[
Doc(id="1", vector=[0.01] * 768, fields={"title": "Intro", "source": "kb", "chunk": 0}),
Doc(id="2", vector=[0.02] * 768, fields={"title": "FAQ", "source": "kb", "chunk": 1}),
]
)
assert ret
# 3) Query
ret = collection.query(
vector=[0.01] * 768,
topk=5,
filter="source = 'kb' AND chunk >= 0",
output_fields=["title", "source", "chunk"],
include_vector=False,
)
for doc in ret:
print(doc.id, doc.fields)
python skills/ai/search/alicloud-ai-search-dashvector/scripts/quickstart.py
Environment variables:
DASHVECTOR_API_KEYDASHVECTOR_ENDPOINTDASHVECTOR_COLLECTION (optional)DASHVECTOR_DIMENSION (optional)Optional args: --collection, --dimension, --topk, --filter.
upsert for idempotent ingestion.dimension aligned to your embedding model output size.sparse_vector={token_id: weight, ...} when upserting/querying.DASHVECTOR_API_KEYClient.create, Collection.upsert, Collection.queryreferences/sources.mdGenerated Mar 1, 2026
Enhance online shopping by using vector similarity search to recommend products based on user preferences and browsing history. Filters can refine recommendations by category or price range, improving personalization and conversion rates.
Implement a semantic search system for support articles, allowing agents to quickly find relevant information using vector embeddings. Filters can scope searches by product line or issue type, reducing resolution times.
Detect inappropriate or duplicate content by comparing vector embeddings of user-generated posts against a database of flagged items. Filters can target specific regions or content types, aiding in compliance and safety.
Enable fast retrieval of medical records or research papers based on semantic similarity, assisting clinicians in diagnosis and treatment planning. Filters ensure access controls and data privacy by restricting results to authorized datasets.
Identify suspicious transactions by searching for patterns in vectorized data from historical fraud cases. Filters can apply time ranges or transaction amounts, enhancing real-time monitoring and risk management.
Offer a cloud-based vector search service with tiered pricing based on usage, such as number of queries or data storage. This model provides recurring revenue and scalability for businesses needing AI-powered search capabilities.
Sell customized licenses for large organizations requiring on-premises or private cloud deployment of the vector search solution. This includes premium support and integration services, targeting high-value clients.
Monetize access to the vector search functionality through a pay-per-query API, allowing developers to integrate it into applications without managing infrastructure. This model attracts startups and small businesses with flexible pricing.
đŹ Integration Tip
Ensure environment variables for API key and endpoint are securely set before initializing the client, and align vector dimensions with your embedding model to avoid errors.
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Gemini CLI for one-shot Q&A, summaries, and generation.
Research any topic from the last 30 days on Reddit + X + Web, synthesize findings, and write copy-paste-ready prompts. Use when the user wants recent social/web research on a topic, asks "what are people saying about X", or wants to learn current best practices. Requires OPENAI_API_KEY and/or XAI_API_KEY for full Reddit+X access, falls back to web search.
Check Antigravity account quotas for Claude and Gemini models. Shows remaining quota and reset times with ban detection.
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates opencla...
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates openclaw.json. Use when the user mentions free AI, OpenRouter, model switching, rate limits, or wants to reduce AI costs.