$npx -y skills add saskinosie/weaviate-claude-skills --skill weaviate-local-setupSet up and manage a local Weaviate instance using Docker
| 1 | # Weaviate Local Setup Skill |
| 2 | |
| 3 | Run Weaviate locally using Docker for development, testing, and avoiding network restrictions in Claude Desktop/Web. |
| 4 | |
| 5 | ## Why Use Local Weaviate? |
| 6 | |
| 7 | **Benefits:** |
| 8 | - No network restrictions in Claude Desktop/Web |
| 9 | - Free (no cloud costs) |
| 10 | - Full control over data and configuration |
| 11 | - Fast development/testing cycles |
| 12 | - Works offline |
| 13 | - No API key management for cloud instances |
| 14 | |
| 15 | **Best for:** |
| 16 | - Development and testing |
| 17 | - Learning Weaviate |
| 18 | - Working in Claude Desktop with network restrictions |
| 19 | - Privacy-sensitive projects |
| 20 | |
| 21 | ## Prerequisites |
| 22 | |
| 23 | **Required:** |
| 24 | - Docker Desktop installed and running |
| 25 | - Available ports: 8080 (Weaviate), 8081 (optional for Weaviate Console) |
| 26 | - Python 3.8+ installed |
| 27 | |
| 28 | **Optional (for specific vectorizers):** |
| 29 | - OpenAI API key (for text2vec-openai) |
| 30 | - Cohere API key (for text2vec-cohere) |
| 31 | - Anthropic API key (for generative-anthropic) |
| 32 | |
| 33 | ## Python Environment Setup |
| 34 | |
| 35 | **IMPORTANT: Do this FIRST before using any Weaviate skills!** |
| 36 | |
| 37 | Claude will create a virtual environment and install dependencies to avoid conflicts with your system Python. |
| 38 | |
| 39 | ### Step 1: Create Virtual Environment |
| 40 | |
| 41 | ```bash |
| 42 | # Navigate to the weaviate-claude-skills directory |
| 43 | cd ~/Documents/weaviate-claude-skills |
| 44 | |
| 45 | # Create virtual environment |
| 46 | python3 -m venv .venv |
| 47 | |
| 48 | # Activate it |
| 49 | source .venv/bin/activate # macOS/Linux |
| 50 | # OR |
| 51 | .venv\Scripts\activate # Windows |
| 52 | ``` |
| 53 | |
| 54 | ### Step 2: Install Dependencies |
| 55 | |
| 56 | ```bash |
| 57 | # Install required packages |
| 58 | pip install weaviate-client python-dotenv |
| 59 | |
| 60 | # Optional: Install additional packages for specific vectorizers |
| 61 | pip install openai # If using OpenAI vectorizer |
| 62 | pip install cohere # If using Cohere vectorizer |
| 63 | ``` |
| 64 | |
| 65 | **Or install everything at once:** |
| 66 | ```bash |
| 67 | pip install -r requirements.txt |
| 68 | ``` |
| 69 | |
| 70 | ### Step 3: Verify Installation |
| 71 | |
| 72 | ```python |
| 73 | import subprocess |
| 74 | import sys |
| 75 | |
| 76 | # Check if dependencies are installed |
| 77 | try: |
| 78 | import weaviate |
| 79 | from dotenv import load_dotenv |
| 80 | print("✅ All required packages are installed!") |
| 81 | except ImportError as e: |
| 82 | print(f"❌ Missing package: {e}") |
| 83 | print("Installing dependencies...") |
| 84 | subprocess.check_call([sys.executable, "-m", "pip", "install", |
| 85 | "weaviate-client", "python-dotenv"]) |
| 86 | print("✅ Dependencies installed successfully!") |
| 87 | ``` |
| 88 | |
| 89 | ### When Using Claude |
| 90 | |
| 91 | **Claude will check and ensure dependencies are installed before running any Weaviate code.** |
| 92 | |
| 93 | If you see errors about missing packages, Claude will: |
| 94 | 1. Check if the virtual environment exists |
| 95 | 2. Create it if needed |
| 96 | 3. Install required dependencies |
| 97 | 4. Proceed with your request |
| 98 | |
| 99 | **Pro Tip:** Keep the virtual environment activated throughout your Claude session for best results. |
| 100 | |
| 101 | ## Quick Start |
| 102 | |
| 103 | ### Option 1: Basic Setup (No API Keys Required) |
| 104 | |
| 105 | Use Weaviate's built-in vectorizer (no external API needed): |
| 106 | |
| 107 | ```bash |
| 108 | # Start Weaviate with transformers (runs locally, no API key) |
| 109 | docker run -d \ |
| 110 | --name weaviate \ |
| 111 | -p 8080:8080 \ |
| 112 | -p 50051:50051 \ |
| 113 | -e QUERY_DEFAULTS_LIMIT=25 \ |
| 114 | -e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \ |
| 115 | -e PERSISTENCE_DATA_PATH='/var/lib/weaviate' \ |
| 116 | -e DEFAULT_VECTORIZER_MODULE='text2vec-transformers' \ |
| 117 | -e ENABLE_MODULES='text2vec-transformers' \ |
| 118 | -e TRANSFORMERS_INFERENCE_API='http://t2v-transformers:8080' \ |
| 119 | -e CLUSTER_HOSTNAME='node1' \ |
| 120 | semitechnologies/weaviate:1.28.1 |
| 121 | |
| 122 | # Start the transformers module |
| 123 | docker run -d \ |
| 124 | --name t2v-transformers \ |
| 125 | -e ENABLE_CUDA=0 \ |
| 126 | semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 |
| 127 | ``` |
| 128 | |
| 129 | **Connection:** |
| 130 | ``` |
| 131 | WEAVIATE_URL=localhost:8080 |
| 132 | WEAVIATE_API_KEY= # Leave empty for local |
| 133 | ``` |
| 134 | |
| 135 | ### Option 2: With OpenAI Vectorizer |
| 136 | |
| 137 | Use OpenAI embeddings (requires OpenAI API key): |
| 138 | |
| 139 | ```bash |
| 140 | docker run -d \ |
| 141 | --name weaviate \ |
| 142 | -p 8080:8080 \ |
| 143 | -p 50051:50051 \ |
| 144 | -e QUERY_DEFAULTS_LIMIT=25 \ |
| 145 | -e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \ |
| 146 | -e PERSISTENCE_DATA_PATH='/var/lib/weaviate' \ |
| 147 | -e DEFAULT_VECTORIZER_MODULE='text2vec-openai' \ |
| 148 | -e ENABLE_MODULES='text2vec-openai,generative-openai' \ |
| 149 | -e CLUSTER_HOSTNAME='node1' \ |
| 150 | semitechnologies/weaviate:1.28.1 |
| 151 | ``` |
| 152 | |
| 153 | **Connection (.env):** |
| 154 | ``` |
| 155 | WEAVIATE_URL=localhost:8080 |
| 156 | WEAVIATE_API_KEY= # Leave empty |
| 157 | OPENAI_API_KEY=your-openai-key-here |
| 158 | ``` |
| 159 | |
| 160 | ### Option 3: Docker Compose (Recommended for Production) |
| 161 | |
| 162 | See `docker-compose.yml` in this folder (created separately). |
| 163 | |
| 164 | ```bash |
| 165 | # Start Weaviate |
| 166 | docker-compose up -d |
| 167 | |
| 168 | # Check status |
| 169 | docker-compose ps |
| 170 | |
| 171 | # View logs |
| 172 | docker-compose logs -f weaviate |
| 173 | |
| 174 | # Stop Weaviate |
| 175 | docker-compose down |
| 176 | |
| 177 | # Stop and remove data |
| 178 | docker-compose down -v |
| 179 | ``` |
| 180 | |
| 181 | ## Docker Commands Reference |
| 182 | |
| 183 | ### Container Management |
| 184 | |
| 185 | ```bash |
| 186 | # Start Weaviate |
| 187 | docker start weaviate |
| 188 | |
| 189 | # Stop Weaviate |
| 190 | docker stop weaviate |
| 191 | |
| 192 | # Restart Weaviate |
| 193 | docker restart weaviate |
| 194 | |
| 195 | # Check if running |
| 196 | docker ps | grep weaviate |
| 197 | |
| 198 | # View logs |
| 199 | docker logs weaviate |
| 200 | |
| 201 | # Follow logs in real-time |
| 202 | docker logs -f weaviate |
| 203 | |
| 204 | # Remove container |