$npx -y skills add saskinosie/weaviate-claude-skills --skill weaviate-collection-managerCreate, view, update, and delete Weaviate collections with schema management (for local Weaviate)
| 1 | # Weaviate Collection Manager Skill |
| 2 | |
| 3 | This skill helps you manage Weaviate collections on your **local Weaviate instance** - creating new ones, viewing existing schemas, and managing collection configurations. |
| 4 | |
| 5 | ## Important Note |
| 6 | |
| 7 | **This skill is designed for LOCAL Weaviate instances only.** Ensure you have Weaviate running locally in Docker before using this skill. |
| 8 | |
| 9 | ## Purpose |
| 10 | |
| 11 | Manage the structure and configuration of your local Weaviate vector database collections. |
| 12 | |
| 13 | ## When to Use This Skill |
| 14 | |
| 15 | - User wants to create a new collection |
| 16 | - User asks to list all collections |
| 17 | - User needs to view a collection's schema |
| 18 | - User wants to delete a collection |
| 19 | - User asks about collection configuration |
| 20 | |
| 21 | ## Prerequisites Check |
| 22 | |
| 23 | **Claude should verify these prerequisites before proceeding:** |
| 24 | |
| 25 | 1. ✅ **weaviate-local-setup** completed - Python environment and dependencies installed |
| 26 | 2. ✅ **weaviate-connection** completed - Successfully connected to Weaviate |
| 27 | 3. ✅ **Docker container running** - Weaviate is accessible at localhost:8080 |
| 28 | |
| 29 | **If any prerequisites are missing, Claude should:** |
| 30 | - Load the required prerequisite skill first |
| 31 | - Guide the user through the setup |
| 32 | - Then return to this skill |
| 33 | |
| 34 | ## Prerequisites |
| 35 | |
| 36 | - **Local Weaviate running in Docker** (see **weaviate-local-setup** skill) |
| 37 | - Active Weaviate connection (use **weaviate-connection** skill first) |
| 38 | - Python weaviate-client library installed |
| 39 | |
| 40 | ## Operations |
| 41 | |
| 42 | ### 1. List All Collections |
| 43 | |
| 44 | ```python |
| 45 | import weaviate |
| 46 | |
| 47 | # Assuming client is already connected |
| 48 | collections = client.collections.list_all() |
| 49 | |
| 50 | print(f"Found {len(collections)} collections:\n") |
| 51 | for name, config in collections.items(): |
| 52 | print(f"📦 {name}") |
| 53 | if hasattr(config, 'vectorizer_config'): |
| 54 | print(f" Vectorizer: {config.vectorizer_config}") |
| 55 | print() |
| 56 | ``` |
| 57 | |
| 58 | ### 2. View Collection Details |
| 59 | |
| 60 | ```python |
| 61 | # Get specific collection |
| 62 | collection = client.collections.get("YourCollectionName") |
| 63 | |
| 64 | # View configuration |
| 65 | config = collection.config.get() |
| 66 | |
| 67 | print(f"Collection: {config.name}") |
| 68 | print(f"Vectorizer: {config.vectorizer}") |
| 69 | print(f"\nProperties:") |
| 70 | for prop in config.properties: |
| 71 | print(f" - {prop.name} ({prop.data_type})") |
| 72 | ``` |
| 73 | |
| 74 | ### 3. Create a New Collection |
| 75 | |
| 76 | #### Simple Text Collection |
| 77 | ```python |
| 78 | from weaviate.classes.config import Configure, Property, DataType |
| 79 | |
| 80 | # Create collection with automatic vectorization |
| 81 | client.collections.create( |
| 82 | name="Articles", |
| 83 | description="Collection of article documents", |
| 84 | vectorizer_config=Configure.Vectorizer.text2vec_openai(), |
| 85 | properties=[ |
| 86 | Property( |
| 87 | name="title", |
| 88 | data_type=DataType.TEXT, |
| 89 | description="Article title" |
| 90 | ), |
| 91 | Property( |
| 92 | name="content", |
| 93 | data_type=DataType.TEXT, |
| 94 | description="Article content" |
| 95 | ), |
| 96 | Property( |
| 97 | name="author", |
| 98 | data_type=DataType.TEXT, |
| 99 | skip_vectorization=True # Don't vectorize author names |
| 100 | ), |
| 101 | Property( |
| 102 | name="publishDate", |
| 103 | data_type=DataType.DATE |
| 104 | ) |
| 105 | ] |
| 106 | ) |
| 107 | |
| 108 | print("✅ Collection 'Articles' created successfully!") |
| 109 | ``` |
| 110 | |
| 111 | #### Collection with Custom Vectors |
| 112 | ```python |
| 113 | # For when you bring your own vectors |
| 114 | client.collections.create( |
| 115 | name="CustomEmbeddings", |
| 116 | vectorizer_config=Configure.Vectorizer.none(), # No automatic vectorization |
| 117 | properties=[ |
| 118 | Property(name="text", data_type=DataType.TEXT), |
| 119 | Property(name="metadata", data_type=DataType.TEXT) |
| 120 | ] |
| 121 | ) |
| 122 | ``` |
| 123 | |
| 124 | #### Multi-modal Collection (Text + Images) |
| 125 | ```python |
| 126 | client.collections.create( |
| 127 | name="ProductCatalog", |
| 128 | vectorizer_config=Configure.Vectorizer.multi2vec_clip(), # CLIP for images+text |
| 129 | properties=[ |
| 130 | Property(name="name", data_type=DataType.TEXT), |
| 131 | Property(name="description", data_type=DataType.TEXT), |
| 132 | Property(name="image", data_type=DataType.BLOB), # Base64 encoded image |
| 133 | Property(name="price", data_type=DataType.NUMBER), |
| 134 | Property(name="category", data_type=DataType.TEXT) |
| 135 | ] |
| 136 | ) |
| 137 | ``` |
| 138 | |
| 139 | ### 4. Configure Collection Settings |
| 140 | |
| 141 | #### With Generative Module (for RAG) |
| 142 | ```python |
| 143 | from weaviate.classes.config import Configure |
| 144 | |
| 145 | client.collections.create( |
| 146 | name="KnowledgeBase", |
| 147 | vectorizer_config=Configure.Vectorizer.text2vec_openai(), |
| 148 | generative_config=Configure.Generative.openai(model="gpt-4"), # Enable RAG |
| 149 | properties=[ |
| 150 | Property(name="content", data_type=DataType.TEXT), |
| 151 | Property(name="source", data_type=DataType.TEXT) |
| 152 | ] |
| 153 | ) |
| 154 | ``` |
| 155 | |
| 156 | #### With Reranking |
| 157 | ```python |
| 158 | client.collections.create( |
| 159 | name="SearchableDocuments", |
| 160 | vectorizer_config=Configure.Vectorizer.text2vec_cohere(), |
| 161 | reranker_config=Configure.Reranker.cohere(), # Improve search relevance |
| 162 | properties=[ |