원클릭으로
weaviate-connection
Connect to local Weaviate vector database and verify connection health
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Connect to local Weaviate vector database and verify connection health
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create, view, update, and delete Weaviate collections with schema management (for local Weaviate)
Upload and process data into local Weaviate collections with support for single objects, batch uploads, and multi-modal content
Set up and manage a local Weaviate instance using Docker
Search and retrieve data from local Weaviate using semantic search, filters, RAG, and hybrid queries
| name | weaviate-connection |
| description | Connect to local Weaviate vector database and verify connection health |
| version | 2.0.0 |
| author | Scott Askinosie |
| dependencies | ["weaviate-local-setup"] |
This skill helps you connect to a local Weaviate database instance running in Docker and verify the connection is healthy.
This skill is designed for LOCAL Weaviate instances only. Claude Desktop and Claude Web have network restrictions that prevent connections to external services like Weaviate Cloud.
To use these skills, you must run Weaviate locally using Docker. See the weaviate-local-setup skill first.
Establish and test connections to local Weaviate vector databases running on localhost.
BEFORE proceeding, Claude should verify:
Python environment is set up (from weaviate-local-setup skill)
.venv/Weaviate Docker container is running
docker ps | grep weaviateEnvironment file exists
.env file is presentimport subprocess
import sys
import os
from pathlib import Path
def check_prerequisites():
"""Check all prerequisites before connecting to Weaviate"""
print("🔍 Checking prerequisites...\n")
all_checks_passed = True
# Check 1: Virtual environment
venv_path = Path(".venv")
if venv_path.exists():
print("✅ Virtual environment found")
else:
print("⚠️ No virtual environment found")
print(" Creating virtual environment...")
subprocess.run([sys.executable, "-m", "venv", ".venv"])
print("✅ Virtual environment created")
# Check 2: Dependencies
try:
import weaviate
from dotenv import load_dotenv
print("✅ Python dependencies installed")
except ImportError:
print("⚠️ Missing dependencies")
print(" Installing weaviate-client and python-dotenv...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q",
"weaviate-client", "python-dotenv"])
print("✅ Dependencies installed")
# Check 3: Docker container
result = subprocess.run(["docker", "ps"], capture_output=True, text=True)
if "weaviate" in result.stdout:
print("✅ Weaviate Docker container is running")
else:
print("❌ Weaviate Docker container not found")
print(" Please start Weaviate first:")
print(" cd weaviate-local-setup && docker-compose up -d")
all_checks_passed = False
# Check 4: .env file
if Path(".env").exists():
print("✅ .env file found")
else:
print("⚠️ .env file not found")
print(" Creating .env from template...")
if Path(".env.example").exists():
import shutil
shutil.copy(".env.example", ".env")
print("✅ .env file created")
print(" Please edit .env and add your API keys if needed")
else:
print("❌ No .env.example found")
all_checks_passed = False
print("\n" + "="*50)
if all_checks_passed:
print("✅ All prerequisites met! Ready to connect.")
else:
print("❌ Some prerequisites missing. Please resolve them first.")
print("="*50 + "\n")
return all_checks_passed
# Run the check
if __name__ == "__main__":
check_prerequisites()
Claude should run this check automatically when this skill is loaded.
pip install weaviate-client)weaviate-local-setup skill)Before connecting, verify Weaviate Docker container is running:
# Check if Weaviate is running
docker ps | grep weaviate
# If not running, start it with docker-compose
cd weaviate-local-setup
docker-compose up -d
# Verify Weaviate is ready
curl http://localhost:8080/v1/.well-known/ready
pip install weaviate-client python-dotenv
Update your .env file for local connection:
# .env file
WEAVIATE_URL=localhost:8080
WEAVIATE_API_KEY= # Leave empty for local instances
# Optional: Only needed if using these vectorizers
OPENAI_API_KEY=your-openai-key
COHERE_API_KEY=your-cohere-key
Basic Connection (Recommended):
import weaviate
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Connect to local Weaviate
client = weaviate.connect_to_local(
host="localhost",
port=8080,
grpc_port=50051
)
# Test the connection
try:
# Check if client is ready
if client.is_ready():
print("✅ Connected to local Weaviate successfully!")
# Get cluster metadata
meta = client.get_meta()
print(f"📦 Weaviate version: {meta.get('version', 'unknown')}")
# List collections
collections = client.collections.list_all()
print(f"\n📚 Found {len(collections)} collections:")
for name, config in collections.items():
print(f" - {name}")
else:
print("❌ Connection failed - Weaviate not ready")
except Exception as e:
print(f"❌ Error connecting to Weaviate: {str(e)}")
print("\n💡 Make sure Weaviate is running:")
print(" docker ps | grep weaviate")
finally:
# Always close the connection
client.close()
Connection with API Headers (for OpenAI/Cohere vectorizers):
import weaviate
import os
from dotenv import load_dotenv
load_dotenv()
# Connect with API key headers
client = weaviate.connect_to_local(
host="localhost",
port=8080,
grpc_port=50051,
headers={
"X-OpenAI-Api-Key": os.getenv("OPENAI_API_KEY"), # Optional
"X-Cohere-Api-Key": os.getenv("COHERE_API_KEY") # Optional
}
)
try:
if client.is_ready():
print("✅ Connected to local Weaviate with API headers!")
except Exception as e:
print(f"❌ Error: {str(e)}")
finally:
client.close()
After connecting, check:
client.is_ready())client.get_meta())client.collections.list_all()).env filedocker ps to verify Weaviate is runningSolution: Weaviate Docker container is not running
# Check if container is running
docker ps | grep weaviate
# Start Weaviate
cd weaviate-local-setup
docker-compose up -d
# Wait 10-15 seconds for startup, then verify
curl http://localhost:8080/v1/.well-known/ready
Solution: Another service is using port 8080
# Find what's using port 8080
lsof -i :8080
# Either stop that service, or modify docker-compose.yml to use a different port
# Change ports: - "8081:8080" in docker-compose.yml
Solution: Start Docker Desktop application
Solution: Install the client library
pip install weaviate-client
# .env file for LOCAL Weaviate
WEAVIATE_URL=localhost:8080
WEAVIATE_API_KEY= # Leave empty for local
# Optional vectorizer API keys
OPENAI_API_KEY=your-openai-key
COHERE_API_KEY=your-cohere-key
ANTHROPIC_API_KEY=your-anthropic-key
Save this as test_connection.py:
import weaviate
# Connect to local Weaviate
client = weaviate.connect_to_local()
try:
if client.is_ready():
print("✅ Connected successfully!")
meta = client.get_meta()
print(f"📦 Version: {meta.get('version')}")
else:
print("❌ Not ready")
except Exception as e:
print(f"❌ Error: {e}")
finally:
client.close()
Run it:
python test_connection.py
After establishing connection: