Back to Registry View Author Profile
Official Verified
tos-vectors
Manage vector storage and similarity search using TOS Vectors service. Use when working with embeddings, semantic search, RAG systems, recommendation engines, or when the user mentions vector databases, similarity search, or TOS Vectors operations.
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/jneless/volcengine-tos-vectors-skillsOr
TOS Vectors Skill
Comprehensive skill for managing vector storage, indexing, and similarity search using the TOS Vectors service - a cloud-based vector database optimized for AI applications.
Quick Start
Initialize Client
import os
import tos
# Get credentials from environment
ak = os.getenv('TOS_ACCESS_KEY')
sk = os.getenv('TOS_SECRET_KEY')
account_id = os.getenv('TOS_ACCOUNT_ID')
# Configure endpoint and region
endpoint = 'https://tosvectors-cn-beijing.volces.com'
region = 'cn-beijing'
# Create client
client = tos.VectorClient(ak, sk, endpoint, region)
Basic Workflow
# 1. Create vector bucket (like a database)
client.create_vector_bucket('my-vectors')
# 2. Create vector index (like a table)
client.create_index(
account_id=account_id,
vector_bucket_name='my-vectors',
index_name='embeddings-768d',
data_type=tos.DataType.DataTypeFloat32,
dimension=768,
distance_metric=tos.DistanceMetricType.DistanceMetricCosine
)
# 3. Insert vectors
vectors = [
tos.models2.Vector(
key='doc-1',
data=tos.models2.VectorData(float32=[0.1] * 768),
metadata={'title': 'Document 1', 'category': 'tech'}
)
]
client.put_vectors(
vector_bucket_name='my-vectors',
account_id=account_id,
index_name='embeddings-768d',
vectors=vectors
)
# 4. Search similar vectors
query_vector = tos.models2.VectorData(float32=[0.1] * 768)
results = client.query_vectors(
vector_bucket_name='my-vectors',
account_id=account_id,
index_name='embeddings-768d',
query_vector=query_vector,
top_k=5,
return_distance=True,
return_metadata=True
)
Core Operations
Vector Bucket Management
Create Bucket
client.create_vector_bucket(bucket_name)
List Buckets
result = client.list_vector_buckets(max_results=100)
for bucket in result.vector_buckets:
print(bucket.vector_bucket_name)
Delete Bucket (must be empty)
client.delete_vector_bucket(bucket_name, account_id)
Vector Index Management
Create Index
client.create_index(
account_id=account_id,
vector_bucket_name=bucket_name,
index_name='my-index',
data_type=tos.DataType.DataTypeFloat32,
dimension=128,
distance_metric=tos.DistanceMetricType.DistanceMetricCosine
)
List Indexes
result = client.list_indexes(bucket_name, account_id)
for index in result.indexes:
print(f"{index.index_name}: {index.dimension}d")
Vector Data Operations
Insert Vectors (batch up to 500)
vectors = []
for i in range(100):
vector = tos.models2.Vector(
key=f'vec-{i}',
data=tos.models2.VectorData(float32=[...]),
metadata={'category': 'example'}
)
vectors.append(vector)
client.put_vectors(
vector_bucket_name=bucket_name,
account_id=account_id,
index_name=index_name,
vectors=vectors
)
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-jneless-volcengine-tos-vectors-skills": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.