@mhalder/qdrant-mcp-server 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -69
- package/CONTRIBUTING.md +81 -92
- package/README.md +97 -634
- package/examples/README.md +63 -253
- package/examples/basic/README.md +18 -72
- package/examples/filters/README.md +55 -155
- package/examples/knowledge-base/README.md +36 -98
- package/examples/rate-limiting/README.md +81 -290
- package/package.json +1 -1
- package/docs/test_report.md +0 -259
package/examples/README.md
CHANGED
|
@@ -1,315 +1,125 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Examples
|
|
2
2
|
|
|
3
|
-
Practical examples demonstrating
|
|
3
|
+
Practical examples demonstrating Qdrant MCP Server usage.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Prerequisites
|
|
6
6
|
|
|
7
|
-
Before running
|
|
7
|
+
Before running examples:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
```bash
|
|
10
|
+
# Start services
|
|
11
|
+
docker compose up -d
|
|
12
|
+
|
|
13
|
+
# Pull embedding model
|
|
14
|
+
docker exec ollama ollama pull nomic-embed-text
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Configure MCP server as described in [main README](../README.md).
|
|
13
18
|
|
|
14
19
|
## Available Examples
|
|
15
20
|
|
|
16
21
|
### 🎯 [Basic Usage](./basic/)
|
|
17
22
|
|
|
18
|
-
**Start here
|
|
19
|
-
|
|
20
|
-
Learn fundamental operations:
|
|
23
|
+
**Start here** - fundamental operations
|
|
21
24
|
|
|
22
25
|
- Creating collections
|
|
23
26
|
- Adding documents
|
|
24
|
-
-
|
|
25
|
-
-
|
|
27
|
+
- Semantic search
|
|
28
|
+
- Resource management
|
|
26
29
|
|
|
27
|
-
**Time:** 5-10 minutes
|
|
28
|
-
**Difficulty:** Beginner
|
|
30
|
+
**Time:** 5-10 minutes | **Difficulty:** Beginner
|
|
29
31
|
|
|
30
32
|
---
|
|
31
33
|
|
|
32
34
|
### ⚡ [Rate Limiting](./rate-limiting/)
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Topics covered:
|
|
36
|
+
Automatic rate limit handling for batch operations
|
|
37
37
|
|
|
38
|
-
- Configuring rate limits
|
|
38
|
+
- Configuring provider rate limits
|
|
39
39
|
- Batch document processing
|
|
40
|
-
- Exponential backoff retry
|
|
40
|
+
- Exponential backoff retry
|
|
41
41
|
- Monitoring and troubleshooting
|
|
42
42
|
|
|
43
|
-
**Use cases:**
|
|
43
|
+
**Use cases:** High-volume ingestion, free tier optimization, production reliability
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
- Free tier optimization
|
|
47
|
-
- Production reliability
|
|
48
|
-
- Batch operations
|
|
49
|
-
|
|
50
|
-
**Time:** 10-15 minutes
|
|
51
|
-
**Difficulty:** Beginner to Intermediate
|
|
45
|
+
**Time:** 10-15 minutes | **Difficulty:** Beginner to Intermediate
|
|
52
46
|
|
|
53
47
|
---
|
|
54
48
|
|
|
55
49
|
### 📚 [Knowledge Base](./knowledge-base/)
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Topics covered:
|
|
51
|
+
Searchable documentation system with metadata
|
|
60
52
|
|
|
61
53
|
- Structuring documents with rich metadata
|
|
62
|
-
- Organizing
|
|
54
|
+
- Organizing by team, topic, difficulty
|
|
63
55
|
- Filtering searches by categories
|
|
64
|
-
- Scaling and maintenance
|
|
65
|
-
|
|
66
|
-
**Use cases:**
|
|
56
|
+
- Scaling and maintenance
|
|
67
57
|
|
|
68
|
-
|
|
69
|
-
- Help centers
|
|
70
|
-
- Internal wikis
|
|
71
|
-
- Educational content
|
|
58
|
+
**Use cases:** Company docs, help centers, internal wikis, education
|
|
72
59
|
|
|
73
|
-
**Time:** 15-20 minutes
|
|
74
|
-
**Difficulty:** Intermediate
|
|
60
|
+
**Time:** 15-20 minutes | **Difficulty:** Intermediate
|
|
75
61
|
|
|
76
62
|
---
|
|
77
63
|
|
|
78
64
|
### 🔍 [Advanced Filtering](./filters/)
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Learn to:
|
|
83
|
-
|
|
84
|
-
- Combine multiple filter conditions (AND, OR, NOT)
|
|
85
|
-
- Filter by categories, prices, ratings, and availability
|
|
86
|
-
- Use range filters for numeric values
|
|
87
|
-
- Build sophisticated e-commerce searches
|
|
88
|
-
|
|
89
|
-
**Use cases:**
|
|
90
|
-
|
|
91
|
-
- Product catalogs
|
|
92
|
-
- Inventory management
|
|
93
|
-
- Content filtering
|
|
94
|
-
- Access control
|
|
95
|
-
|
|
96
|
-
**Time:** 20-30 minutes
|
|
97
|
-
**Difficulty:** Intermediate to Advanced
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Example Structure
|
|
102
|
-
|
|
103
|
-
Each example includes:
|
|
104
|
-
|
|
105
|
-
- **README.md** - Step-by-step tutorial with commands
|
|
106
|
-
- **Sample data** - Documents with metadata to copy/paste
|
|
107
|
-
- **Search examples** - Real queries you can try
|
|
108
|
-
- **Best practices** - Tips and recommendations
|
|
109
|
-
|
|
110
|
-
## How to Use These Examples
|
|
66
|
+
Complex search filters with boolean logic
|
|
111
67
|
|
|
112
|
-
|
|
68
|
+
- Multiple filter conditions (AND, OR, NOT)
|
|
69
|
+
- Filtering by categories, ratings, availability
|
|
70
|
+
- Range filters for numeric values
|
|
71
|
+
- E-commerce search patterns
|
|
113
72
|
|
|
114
|
-
|
|
73
|
+
**Use cases:** Product catalogs, inventory, content filtering, access control
|
|
115
74
|
|
|
116
|
-
|
|
117
|
-
Create a collection named "test"
|
|
118
|
-
Add documents...
|
|
119
|
-
Search for...
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Option 2: Understand the Concepts
|
|
123
|
-
|
|
124
|
-
Read through examples to understand:
|
|
125
|
-
|
|
126
|
-
- Metadata design patterns
|
|
127
|
-
- Filter syntax and structure
|
|
128
|
-
- Search result ranking
|
|
129
|
-
- Collection organization
|
|
130
|
-
|
|
131
|
-
### Option 3: Adapt for Your Use Case
|
|
132
|
-
|
|
133
|
-
Use examples as templates:
|
|
134
|
-
|
|
135
|
-
1. Start with the closest matching example
|
|
136
|
-
2. Modify metadata structure for your data
|
|
137
|
-
3. Adjust search queries for your needs
|
|
138
|
-
4. Scale up with your own documents
|
|
75
|
+
**Time:** 20-30 minutes | **Difficulty:** Intermediate to Advanced
|
|
139
76
|
|
|
140
77
|
## Learning Path
|
|
141
78
|
|
|
142
79
|
```
|
|
143
|
-
|
|
144
|
-
│ Basic │ Start here - core operations
|
|
145
|
-
└──────┬──────┘
|
|
146
|
-
│
|
|
147
|
-
├──────────┐
|
|
148
|
-
│ ▼
|
|
149
|
-
│ ┌─────────────┐
|
|
150
|
-
│ │ Rate │ Learn automatic rate limit handling
|
|
151
|
-
│ │ Limiting │ (especially for batch operations)
|
|
152
|
-
│ └─────────────┘
|
|
153
|
-
│
|
|
154
|
-
▼
|
|
155
|
-
┌─────────────┐
|
|
156
|
-
│ Knowledge │ Add structure with metadata
|
|
157
|
-
│ Base │
|
|
158
|
-
└──────┬──────┘
|
|
159
|
-
│
|
|
160
|
-
▼
|
|
161
|
-
┌─────────────┐
|
|
162
|
-
│ Advanced │ Master complex filtering
|
|
163
|
-
│ Filtering │
|
|
164
|
-
└─────────────┘
|
|
80
|
+
Basic → Rate Limiting → Knowledge Base → Advanced Filtering
|
|
165
81
|
```
|
|
166
82
|
|
|
167
83
|
## Common Patterns
|
|
168
84
|
|
|
169
|
-
|
|
85
|
+
| Pattern | Metadata Structure | Use Case |
|
|
86
|
+
| -------------------- | -------------------------------------------------- | --------------------- |
|
|
87
|
+
| Content Organization | `category`, `topic`, `author`, `date` | Blogs, docs, articles |
|
|
88
|
+
| E-commerce | `category`, `price`, `rating`, `in_stock`, `brand` | Product catalogs |
|
|
89
|
+
| Access Control | `visibility`, `department`, `sensitivity` | Enterprise knowledge |
|
|
90
|
+
| Temporal Data | `created_at`, `updated_at`, `status`, `version` | Versioned content |
|
|
170
91
|
|
|
171
|
-
|
|
172
|
-
metadata: {
|
|
173
|
-
"category": "type",
|
|
174
|
-
"topic": "subject",
|
|
175
|
-
"author": "creator",
|
|
176
|
-
"date": "2024-01-15"
|
|
177
|
-
}
|
|
178
|
-
```
|
|
92
|
+
## Tips
|
|
179
93
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
metadata: {
|
|
186
|
-
"category": "electronics",
|
|
187
|
-
"price": 99.99,
|
|
188
|
-
"rating": 4.5,
|
|
189
|
-
"in_stock": true,
|
|
190
|
-
"brand": "BrandName"
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Good for: Product catalogs, inventory systems
|
|
195
|
-
|
|
196
|
-
### Pattern 3: Access Control
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
metadata: {
|
|
200
|
-
"visibility": "internal",
|
|
201
|
-
"department": "engineering",
|
|
202
|
-
"sensitivity": "confidential"
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Good for: Enterprise knowledge bases, secure documents
|
|
207
|
-
|
|
208
|
-
### Pattern 4: Temporal Data
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
metadata: {
|
|
212
|
-
"created_at": "2024-01-15",
|
|
213
|
-
"updated_at": "2024-03-20",
|
|
214
|
-
"status": "published",
|
|
215
|
-
"version": "2.1"
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Good for: Versioned content, time-series data
|
|
220
|
-
|
|
221
|
-
## Tips for All Examples
|
|
222
|
-
|
|
223
|
-
### 1. Start Small
|
|
224
|
-
|
|
225
|
-
Test with 5-10 documents before scaling to thousands.
|
|
226
|
-
|
|
227
|
-
### 2. Design Metadata First
|
|
228
|
-
|
|
229
|
-
Plan your metadata structure before adding documents:
|
|
230
|
-
|
|
231
|
-
- What fields do you need?
|
|
232
|
-
- What will you filter by?
|
|
233
|
-
- What types (string, number, boolean)?
|
|
234
|
-
|
|
235
|
-
### 3. Use Consistent IDs
|
|
236
|
-
|
|
237
|
-
Choose an ID scheme:
|
|
238
|
-
|
|
239
|
-
- Sequential: `1`, `2`, `3`
|
|
240
|
-
- Prefixed: `doc-001`, `doc-002`
|
|
241
|
-
- Semantic: `eng-api-auth`, `sales-pricing`
|
|
242
|
-
- UUIDs: Generated automatically
|
|
243
|
-
|
|
244
|
-
### 4. Test Searches
|
|
245
|
-
|
|
246
|
-
Try various queries to validate:
|
|
247
|
-
|
|
248
|
-
- Semantic matching works correctly
|
|
249
|
-
- Filters return expected results
|
|
250
|
-
- Result ranking makes sense
|
|
251
|
-
|
|
252
|
-
### 5. Clean Up
|
|
253
|
-
|
|
254
|
-
Delete test collections when done:
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
Delete collection "collection-name"
|
|
258
|
-
```
|
|
94
|
+
1. **Start Small** - Test with 5-10 documents before scaling
|
|
95
|
+
2. **Design Metadata First** - Plan fields, types, and filters
|
|
96
|
+
3. **Use Consistent IDs** - Choose a scheme (sequential, prefixed, semantic, UUIDs)
|
|
97
|
+
4. **Test Searches** - Validate semantic matching and filters
|
|
98
|
+
5. **Clean Up** - Delete test collections when done
|
|
259
99
|
|
|
260
100
|
## Troubleshooting
|
|
261
101
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
- Check collection has documents: `Get info about "collection-name"`
|
|
272
|
-
- Verify filter syntax matches metadata exactly
|
|
273
|
-
- Try search without filters first
|
|
274
|
-
|
|
275
|
-
### Unexpected Results
|
|
276
|
-
|
|
277
|
-
- Check document metadata structure
|
|
278
|
-
- Validate filter conditions
|
|
279
|
-
- Review semantic similarity scores
|
|
280
|
-
|
|
281
|
-
### Error Messages
|
|
282
|
-
|
|
283
|
-
- **"Collection not found"**: Create the collection first
|
|
284
|
-
- **"Bad Request"**: Check filter JSON syntax
|
|
285
|
-
- **"API error"**: Verify your embedding provider API key and credits
|
|
102
|
+
| Issue | Solution |
|
|
103
|
+
| ---------------------- | --------------------------------------------------- |
|
|
104
|
+
| Collection exists | `Delete collection "name"` then recreate |
|
|
105
|
+
| No search results | Check collection has documents, try without filters |
|
|
106
|
+
| Unexpected results | Validate metadata and filter syntax |
|
|
107
|
+
| "Collection not found" | Create collection first |
|
|
108
|
+
| "Bad Request" | Check filter JSON syntax |
|
|
109
|
+
| API errors | Verify provider API key and credits |
|
|
286
110
|
|
|
287
111
|
## Next Steps
|
|
288
112
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
3. **Check out advanced features** - Quantization, hybrid search (future)
|
|
294
|
-
4. **Join the community** - Contribute examples and improvements
|
|
295
|
-
|
|
296
|
-
## Contributing
|
|
297
|
-
|
|
298
|
-
Have a great example to share? Please open a PR!
|
|
299
|
-
|
|
300
|
-
We're especially interested in:
|
|
301
|
-
|
|
302
|
-
- Domain-specific use cases (legal, medical, finance)
|
|
303
|
-
- Integration examples (RAG pipelines, chatbots)
|
|
304
|
-
- Performance optimization patterns
|
|
305
|
-
- Novel metadata structures
|
|
113
|
+
1. Review [main README](../README.md) for full tool documentation
|
|
114
|
+
2. Apply patterns to your own use cases
|
|
115
|
+
3. Explore advanced features and configurations
|
|
116
|
+
4. Share your examples via [CONTRIBUTING.md](../CONTRIBUTING.md)
|
|
306
117
|
|
|
307
118
|
## Additional Resources
|
|
308
119
|
|
|
309
120
|
- [Qdrant Documentation](https://qdrant.tech/documentation/)
|
|
310
|
-
- [OpenAI Embeddings
|
|
311
|
-
- [Cohere Embeddings
|
|
312
|
-
- [Voyage AI
|
|
313
|
-
- [Ollama
|
|
121
|
+
- [OpenAI Embeddings](https://platform.openai.com/docs/guides/embeddings)
|
|
122
|
+
- [Cohere Embeddings](https://docs.cohere.com/docs/embeddings)
|
|
123
|
+
- [Voyage AI](https://docs.voyageai.com/)
|
|
124
|
+
- [Ollama](https://ollama.ai/docs)
|
|
314
125
|
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
315
|
-
- [Main Project README](../README.md)
|
package/examples/basic/README.md
CHANGED
|
@@ -1,94 +1,39 @@
|
|
|
1
|
-
# Basic Usage
|
|
1
|
+
# Basic Usage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Learn fundamental operations: create collections, add documents, search, and manage resources.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Time:** 5-10 minutes | **Difficulty:** Beginner
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Adding documents with metadata
|
|
9
|
-
- Performing semantic search
|
|
10
|
-
- Cleaning up resources
|
|
11
|
-
|
|
12
|
-
## Prerequisites
|
|
13
|
-
|
|
14
|
-
- Qdrant and Ollama running via Docker Compose
|
|
15
|
-
- Ollama model pulled (nomic-embed-text)
|
|
16
|
-
- Qdrant MCP Server configured
|
|
17
|
-
- Claude Code or another MCP client
|
|
18
|
-
|
|
19
|
-
**Optional**: Configure OpenAI, Cohere, or Voyage AI if not using Ollama (default)
|
|
20
|
-
|
|
21
|
-
## Example Workflow
|
|
22
|
-
|
|
23
|
-
### 1. Create a Collection
|
|
7
|
+
## Workflow
|
|
24
8
|
|
|
25
9
|
```
|
|
10
|
+
# 1. Create collection
|
|
26
11
|
Create a collection named "basic-example"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This creates a new vector collection with default settings (Cosine distance, 768 dimensions for Ollama's nomic-embed-text model).
|
|
30
12
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
13
|
+
# 2. Add documents (auto-embedded with Ollama)
|
|
34
14
|
Add these documents to basic-example:
|
|
35
15
|
- id: 1, text: "The quick brown fox jumps over the lazy dog"
|
|
36
16
|
- id: 2, text: "Machine learning is a subset of artificial intelligence"
|
|
37
17
|
- id: 3, text: "Python is a popular programming language"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Documents are automatically embedded using Ollama (or your configured alternative provider).
|
|
41
|
-
|
|
42
|
-
### 3. Search for Similar Documents
|
|
43
18
|
|
|
44
|
-
|
|
19
|
+
# 3. Search
|
|
45
20
|
Search basic-example for "AI and computer programs"
|
|
46
|
-
|
|
21
|
+
# Expected: Doc 2 ranks highest (ML/AI), Doc 3 lower (programming)
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- Document 2 (ML/AI) should rank highest
|
|
51
|
-
- Document 3 (Python/programming) may appear with lower score
|
|
52
|
-
|
|
53
|
-
### 4. Get Collection Information
|
|
54
|
-
|
|
55
|
-
```
|
|
23
|
+
# 4. Get info
|
|
56
24
|
Get info about "basic-example" collection
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
|
|
61
|
-
- Vector dimensions
|
|
62
|
-
- Number of documents
|
|
63
|
-
- Distance metric used
|
|
64
25
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```
|
|
26
|
+
# 5. List all
|
|
68
27
|
List all collections
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Shows all available collections in your Qdrant instance.
|
|
72
28
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```
|
|
29
|
+
# 6. Delete documents (optional)
|
|
76
30
|
Delete documents [1, 3] from basic-example
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Removes specific documents by ID.
|
|
80
31
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
```
|
|
32
|
+
# 7. Clean up
|
|
84
33
|
Delete collection "basic-example"
|
|
85
34
|
```
|
|
86
35
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
## Try It Yourself
|
|
90
|
-
|
|
91
|
-
Copy these commands into Claude Code:
|
|
36
|
+
## Try It
|
|
92
37
|
|
|
93
38
|
```
|
|
94
39
|
Create a collection named "my-first-collection"
|
|
@@ -100,12 +45,13 @@ Add these documents to my-first-collection:
|
|
|
100
45
|
|
|
101
46
|
Search my-first-collection for "healthy drinks"
|
|
102
47
|
|
|
103
|
-
Get info about "my-first-collection" collection
|
|
104
|
-
|
|
105
48
|
Delete collection "my-first-collection"
|
|
106
49
|
```
|
|
107
50
|
|
|
108
51
|
## Next Steps
|
|
109
52
|
|
|
110
|
-
|
|
111
|
-
|
|
53
|
+
Continue learning with these examples:
|
|
54
|
+
|
|
55
|
+
- **[Knowledge Base](../knowledge-base/)** - Metadata and content organization
|
|
56
|
+
- **[Advanced Filtering](../filters/)** - Complex search queries
|
|
57
|
+
- **[Rate Limiting](../rate-limiting/)** - Batch processing patterns
|