Zvec

From oyi77/1ai-skills · View interactive version

Zvec is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when zero-copy vector operations for efficient similarity search and embedding storage in agent memory systems. Use when working with zvec.

How to use this skill

Skill file

ZVec Skill

Alibaba's lightweight in-process vector database - "The SQLite of Vector Databases"

Overview

ZVec is an open-source, in-process vector database from Alibaba's Tongyi Lab. It's lightweight, blazing fast, and embeds directly into your application - no server needed. Built on Proxima (Alibaba's battle-tested vector search engine used in production across Taobao, Ele.me, and more).

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "I'll figure it out as I go" | A structured approach saves time and reduces errors. Follow the workflow in this skill rather than improvising. |

| "I already know this topic" | Familiarity breeds shortcuts. Use the checklist to verify you haven't missed critical steps. |

| "This doesn't apply to my situation" | The patterns here generalize across contexts. Adapt, don't skip โ€” the underlying principles hold. |

| "One more tool will fix it" | Adding complexity rarely solves process gaps. Master the core workflow first. |

When to Use

Trigger phrases:

Use this skill when you need:

Key Features

๐Ÿš€ Blazing Fast

๐Ÿ“ฆ Simple, Just Works

๐ŸŒ Runs Anywhere

๐Ÿ” Rich Query Support

Installation

# Python
pip install zvec

# Node.js
npm install @zvec/zvec

Usage Patterns

Python Example

import zvec

# Define collection schema
schema = zvec.CollectionSchema(
    name="example",
    vectors=zvec.VectorSchema("embedding", zvec.DataType.VECTOR_FP32, 384)
)

# Create collection
collection = zvec.create("my_vectors", schema)

# Add vectors
collection.add(
    ids=["doc1", "doc2"],
    vectors=[[0.1] * 384, [0.2] * 384],
    payloads=[{"text": "AI is great"}, {"text": "Vectors are useful"}]
)

# Search
results = collection.search(
    query_vector=[0.1] * 384,
    top_k=10,
    filter={"text": {"$contains": "AI"}}
)

Node.js Example

const zvec = require('@zvec/zvec');

const collection = await zvec.create('documents', { dimension: 384 });
await collection.add({ id: '1', vector: embedding, payload: { text: 'Hello' } });
const results = await collection.search({ vector: queryEmbedding, topK: 5 });

Index Types

| Type | Use Case | Latency | Accuracy |

|------|----------|---------|----------|

| Flat | Small datasets, exact results | Low | 100% |

| HNSW | Balanced speed/accuracy | Medium | ~95% |

| IVF | Large datasets | Fast | ~90% |

Integration with 1ai-skills

ZVec integrates perfectly with:

When to Choose ZVec vs RuVector

| Feature | ZVec | RuVector |

|---------|------|----------|

| Speed | โšกโšกโšกโšกโšก | โšกโšกโšก |

| Self-Learning | โŒ | โœ… GNN |

| Local LLM | โŒ | โœ… |

| Graph Queries | โŒ | โœ… Cypher |

| Complexity | Simple | Advanced |

| Size | Tiny | Full-featured |

Choose ZVec for: Simple, fast, lightweight vector storage

Choose RuVector for: Self-learning memory, graph queries, local LLMs

Files in This Skill

See Also

When NOT to Use

Common Rationalizations

| Rationalization | Reality |

|---|---|

| "I'll do this later" | Explain why this excuse is wrong for this skill |

| "This is simple, skip steps" | Even simple tasks benefit from process |

Red Flags

Verification

After completing this skill, confirm:

Process

  1. Analyze the task requirements
  2. Apply domain expertise
  3. Verify output quality
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.