Skip to content
Back to skills

Weaviate

ASecurity

Build vector search with Weaviate using v4 syntax, proper module configuration, and production-ready patterns.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentspythongodockerapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill weaviate --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Weaviate?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Weaviate
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-weaviate/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-weaviate)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Weaviate
slug: weaviate
version: 1.0.0
description: Build vector search with Weaviate using v4 syntax, proper module configuration, and production-ready patterns.
metadata: {"clawdbot":{"emoji":"πŸ”·","requires":{"bins":[]},"os":["linux","darwin","win32"]}}
---

## Critical: v4 Only (Dec 2024+)

v3 syntax is DEPRECATED. Before generating ANY Weaviate code:

1. **Verify client version** β€” must be `weaviate-client>=4.0`
2. **Use context managers** β€” `with weaviate.connect_to_*() as client:` or explicit `client.close()`
3. **New imports** β€” `from weaviate.classes.config import Configure, Property`

If you see v3 patterns (`weaviate.Client()`, `client.schema.create_class()`, `path=[...]` filters), **stop and rewrite**.

## Quick Reference

| Topic | File |
|-------|------|
| v3β†’v4 migration table | `v4-syntax.md` |
| Module configuration | `modules.md` |
| Batch, hybrid, HNSW | `operations.md` |

## v4 Syntax Essentials

```python
# Connection (ALWAYS close)
with weaviate.connect_to_local() as client:
    # Collections (not classes)
    collection = client.collections.get("Article")
    
    # Queries
    response = collection.query.hybrid("search term", alpha=0.7)
    
    # Vector access
    vector = obj.vector["default"]  # Dict, not List
    
    # Filters
    Filter.by_property("category").equal("tech")
```

## Scope

This skill covers:
- Schema design for RAG and semantic search
- Vectorizer and reranker module configuration
- Batch imports with error handling
- Hybrid search tuning (alpha parameter)
- HNSW index configuration for scale

## Core Rules

### 1. Always Verify Modules
Before using `text2vec-openai`, `generative-openai`, or rerankers, verify they're enabled:
```yaml
# docker-compose.yml
ENABLE_MODULES: 'text2vec-openai,generative-openai,reranker-cohere'
```

### 2. API Keys in Headers
```python
client = weaviate.connect_to_local(
    headers={"X-OpenAI-Api-Key": os.environ["OPENAI_API_KEY"]}
)
```

### 3. Batch with Context Manager
```python
with client.batch.dynamic() as batch:
    for item in data:
        batch.add_object(properties=item, collection="Name")
```

### 4. Hybrid Search Alpha
- `alpha=0` β†’ BM25 only (keyword)
- `alpha=1` β†’ Vector only (semantic)
- `alpha=0.5-0.75` β†’ Balanced (typical for RAG)

### 5. Apply Filters BEFORE Vector Search
Filters in `where` reduce the search space first β€” always filter before `near_text`/`near_vector`.

### 6. Named Vectors vs Single Vector
Choose one pattern per collection:
```python
# Single vector (simpler)
vectorizer_config=Configure.Vectorizer.text2vec_openai()

# Named vectors (multiple embeddings per object)
vector_config=[
    Configure.Vectors.text2vec_openai(name="content", source_properties=["body"]),
]
```

### 7. Debug Empty Results
Check in order: schema exists β†’ vectorizer ran β†’ distance threshold β†’ filter syntax.
Use `_additional { vector }` to verify vectors were generated.

Files in this skill

  • SKILL.md2.9 KB
  • _meta.json273 B
  • modules.md3 KB
  • operations.md3.8 KB
  • v4-syntax.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents β†’

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.