@mastra/vectorize 0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260720232722 → 0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260730204150

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  # @mastra/vectorize
2
2
 
3
- ## 0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260720232722
3
+ ## 0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260730204150
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`ec857fc`](https://github.com/mastra-ai/mastra/commit/ec857fc79c264b53b38e16478c789b7177f2ad59), [`1426af2`](https://github.com/mastra-ai/mastra/commit/1426af24975879c000d13ac75673f630fcc970c1), [`a40adeb`](https://github.com/mastra-ai/mastra/commit/a40adeb222b961a56a58af56a106106525721b74), [`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`e1f2fae`](https://github.com/mastra-ai/mastra/commit/e1f2faebaf048c3d4c2e2c01d293767c195d5794), [`63aa799`](https://github.com/mastra-ai/mastra/commit/63aa799c6b44eacc7806cda6846b7c5bbee06b37), [`b7e79c3`](https://github.com/mastra-ai/mastra/commit/b7e79c3c02ac5cd415db34ba0975ceafc1464333), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`8b20926`](https://github.com/mastra-ai/mastra/commit/8b20926cd59e2ba3d66458e062fa0e6e2ada3e68), [`975295d`](https://github.com/mastra-ai/mastra/commit/975295d418552f0d46a59edfef4c3ee555f9930a), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`4cfdd64`](https://github.com/mastra-ai/mastra/commit/4cfdd645794feaea0c4ea711e70ecdfbef0c5b8e), [`b75d749`](https://github.com/mastra-ai/mastra/commit/b75d749621ff5d17e86bcb4ee809d301fb4f7cf3), [`821648b`](https://github.com/mastra-ai/mastra/commit/821648bf2871ef840100c7bacbecf676010bd12a), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`74faf8b`](https://github.com/mastra-ai/mastra/commit/74faf8bd9c1018f2492653c06b1e25fc8300e9e6), [`1fadac4`](https://github.com/mastra-ai/mastra/commit/1fadac44537caeefe81f9f775ae2f2f3d94e9069), [`cf24430`](https://github.com/mastra-ai/mastra/commit/cf24430226a6ecb104bc1d54d6e401defd7cb53f), [`73db8db`](https://github.com/mastra-ai/mastra/commit/73db8db90d69ab6153c7942749f624db0d96952d), [`76b7181`](https://github.com/mastra-ai/mastra/commit/76b71810366e6d90b9d3973149d1c7ba3659ffb9), [`792ec9a`](https://github.com/mastra-ai/mastra/commit/792ec9a0869bab8274cf5e0ed2840738737a1607), [`712b864`](https://github.com/mastra-ai/mastra/commit/712b864aa1ed12b14c54390ec17b69de163c37f7), [`85e4fb5`](https://github.com/mastra-ai/mastra/commit/85e4fb50087a81c74df3a762f53b56373db0b912), [`0c0e8d7`](https://github.com/mastra-ai/mastra/commit/0c0e8d7becd4d1445c656b78d5d845f606c1ff9d), [`8f7a5de`](https://github.com/mastra-ai/mastra/commit/8f7a5dedc246cdc938bb65516703cf9b27b03756), [`11f6cd9`](https://github.com/mastra-ai/mastra/commit/11f6cd96fe42582403416608beb212cc1a2cc79e), [`ef03c0c`](https://github.com/mastra-ai/mastra/commit/ef03c0cfc62367a458e4cc56462e2148b35681c5), [`4fb4d88`](https://github.com/mastra-ai/mastra/commit/4fb4d881bc107acee13890ad4d78661016c510ed), [`9f7c67a`](https://github.com/mastra-ai/mastra/commit/9f7c67abeeb52c41c51a9b5edee60b62afe7cd8d), [`3b65e68`](https://github.com/mastra-ai/mastra/commit/3b65e68d7f1c771c7a70eea42d83fefdd28cad88), [`4eba27a`](https://github.com/mastra-ai/mastra/commit/4eba27adcf60f991df0e62f94b3e75b4e67f3b4b), [`c701be3`](https://github.com/mastra-ai/mastra/commit/c701be32d7d9aa94a66da8c6cc38dcac6856f464), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb), [`a8799bb`](https://github.com/mastra-ai/mastra/commit/a8799bb8e44f4a60d01e4e2acd3448ff80bf14f8), [`e3868e2`](https://github.com/mastra-ai/mastra/commit/e3868e22babfffd0133771669ca724501c2dd58e), [`c0bec73`](https://github.com/mastra-ai/mastra/commit/c0bec732c93d1a22ae5e51ed66cf8cacca8bd6a6)]:
8
- - @mastra/core@0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260720232722
7
+ - Updated dependencies [[`c5e56ff`](https://github.com/mastra-ai/mastra/commit/c5e56ff3bcabdf062708f2d48744fec304df6792), [`7f4e26d`](https://github.com/mastra-ai/mastra/commit/7f4e26dd57bd9b23c278ea21235ab823a3810a6c), [`322daa6`](https://github.com/mastra-ai/mastra/commit/322daa6d90552909204044790d850958f6745fed), [`cadaa13`](https://github.com/mastra-ai/mastra/commit/cadaa1372e1077c8e85eb64c5499ba8803caa323), [`b582f7f`](https://github.com/mastra-ai/mastra/commit/b582f7fa2f9c1f87d19efc63d344fbe5dda2608c), [`06000d7`](https://github.com/mastra-ai/mastra/commit/06000d73712911572e913b8a83339270296d0a22), [`cf24430`](https://github.com/mastra-ai/mastra/commit/cf24430226a6ecb104bc1d54d6e401defd7cb53f), [`4e35a56`](https://github.com/mastra-ai/mastra/commit/4e35a56cdf8d74a5ff6d5eda01f2c1deaf6cc7be), [`3de0188`](https://github.com/mastra-ai/mastra/commit/3de0188bfaf9a9c09c95fe322b53838cf52c70b6), [`b582f7f`](https://github.com/mastra-ai/mastra/commit/b582f7fa2f9c1f87d19efc63d344fbe5dda2608c)]:
8
+ - @mastra/core@0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260730204150
9
9
 
10
10
  ## 1.1.0
11
11
 
@@ -3,7 +3,7 @@ name: mastra-vectorize
3
3
  description: Documentation for @mastra/vectorize. Use when working with @mastra/vectorize APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/vectorize"
6
- version: "0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260720232722"
6
+ version: "0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260730204150"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260720232722",
2
+ "version": "0.0.0-fix-thread-subscription-multi-instance-redis-streams-20260730204150",
3
3
  "package": "@mastra/vectorize",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -160,15 +160,15 @@ When creating the tool, pay special attention to the tool's name and description
160
160
 
161
161
  This is particularly useful when:
162
162
 
163
- - Your agent needs to dynamically decide what information to retrieve
163
+ - Your agent needs to decide at runtime what information to retrieve
164
164
  - The retrieval process requires complex decision-making
165
165
  - You want the agent to combine multiple retrieval strategies based on context
166
166
 
167
167
  #### Database-Specific Configurations
168
168
 
169
- The Vector Query Tool supports database-specific configurations that enable you to leverage unique features and optimizations of different vector stores.
169
+ The Vector Query Tool supports database-specific configurations that enable you to use unique features and optimizations of different vector stores.
170
170
 
171
- > **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering—not for database connection setup.
171
+ > **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering, not for database connection setup.
172
172
  >
173
173
  > Connection credentials (URLs, auth tokens) are configured when you instantiate the vector store class (e.g., `new LibSQLVector({ url: '...' })`).
174
174
 
@@ -235,7 +235,7 @@ const lanceQueryTool = createVectorQueryTool({
235
235
  - **pgVector optimization**: Control search accuracy and speed with ef/probes parameters
236
236
  - **Quality filtering**: Set minimum similarity thresholds to improve result relevance
237
237
  - **LanceDB tables**: Separate data into tables for better organization and performance
238
- - **Runtime flexibility**: Override configurations dynamically based on context
238
+ - **Runtime flexibility**: Override configurations at runtime based on context
239
239
 
240
240
  **Common Use Cases:**
241
241
 
@@ -274,7 +274,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
274
274
  export const ragAgent = new Agent({
275
275
  id: 'rag-agent',
276
276
  name: 'RAG Agent',
277
- model: 'openai/gpt-5.5',
277
+ model: 'openai/gpt-5.6-sol',
278
278
  instructions: `
279
279
  Process queries using the provided context. Structure responses to be concise and relevant.
280
280
  ${PGVECTOR_PROMPT}
@@ -291,7 +291,7 @@ import { PINECONE_PROMPT } from '@mastra/pinecone'
291
291
  export const ragAgent = new Agent({
292
292
  id: 'rag-agent',
293
293
  name: 'RAG Agent',
294
- model: 'openai/gpt-5.5',
294
+ model: 'openai/gpt-5.6-sol',
295
295
  instructions: `
296
296
  Process queries using the provided context. Structure responses to be concise and relevant.
297
297
  ${PINECONE_PROMPT}
@@ -308,7 +308,7 @@ import { QDRANT_PROMPT } from '@mastra/qdrant'
308
308
  export const ragAgent = new Agent({
309
309
  id: 'rag-agent',
310
310
  name: 'RAG Agent',
311
- model: 'openai/gpt-5.5',
311
+ model: 'openai/gpt-5.6-sol',
312
312
  instructions: `
313
313
  Process queries using the provided context. Structure responses to be concise and relevant.
314
314
  ${QDRANT_PROMPT}
@@ -325,7 +325,7 @@ import { CHROMA_PROMPT } from '@mastra/chroma'
325
325
  export const ragAgent = new Agent({
326
326
  id: 'rag-agent',
327
327
  name: 'RAG Agent',
328
- model: 'openai/gpt-5.5',
328
+ model: 'openai/gpt-5.6-sol',
329
329
  instructions: `
330
330
  Process queries using the provided context. Structure responses to be concise and relevant.
331
331
  ${CHROMA_PROMPT}
@@ -342,7 +342,7 @@ import { ASTRA_PROMPT } from '@mastra/astra'
342
342
  export const ragAgent = new Agent({
343
343
  id: 'rag-agent',
344
344
  name: 'RAG Agent',
345
- model: 'openai/gpt-5.5',
345
+ model: 'openai/gpt-5.6-sol',
346
346
  instructions: `
347
347
  Process queries using the provided context. Structure responses to be concise and relevant.
348
348
  ${ASTRA_PROMPT}
@@ -359,7 +359,7 @@ import { LIBSQL_PROMPT } from '@mastra/libsql'
359
359
  export const ragAgent = new Agent({
360
360
  id: 'rag-agent',
361
361
  name: 'RAG Agent',
362
- model: 'openai/gpt-5.5',
362
+ model: 'openai/gpt-5.6-sol',
363
363
  instructions: `
364
364
  Process queries using the provided context. Structure responses to be concise and relevant.
365
365
  ${LIBSQL_PROMPT}
@@ -376,7 +376,7 @@ import { UPSTASH_PROMPT } from '@mastra/upstash'
376
376
  export const ragAgent = new Agent({
377
377
  id: 'rag-agent',
378
378
  name: 'RAG Agent',
379
- model: 'openai/gpt-5.5',
379
+ model: 'openai/gpt-5.6-sol',
380
380
  instructions: `
381
381
  Process queries using the provided context. Structure responses to be concise and relevant.
382
382
  ${UPSTASH_PROMPT}
@@ -393,7 +393,7 @@ import { VECTORIZE_PROMPT } from '@mastra/vectorize'
393
393
  export const ragAgent = new Agent({
394
394
  id: 'rag-agent',
395
395
  name: 'RAG Agent',
396
- model: 'openai/gpt-5.5',
396
+ model: 'openai/gpt-5.6-sol',
397
397
  instructions: `
398
398
  Process queries using the provided context. Structure responses to be concise and relevant.
399
399
  ${VECTORIZE_PROMPT}
@@ -410,7 +410,7 @@ import { MONGODB_PROMPT } from '@mastra/mongodb'
410
410
  export const ragAgent = new Agent({
411
411
  id: 'rag-agent',
412
412
  name: 'RAG Agent',
413
- model: 'openai/gpt-5.5',
413
+ model: 'openai/gpt-5.6-sol',
414
414
  instructions: `
415
415
  Process queries using the provided context. Structure responses to be concise and relevant.
416
416
  ${MONGODB_PROMPT}
@@ -427,7 +427,7 @@ import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
427
427
  export const ragAgent = new Agent({
428
428
  id: 'rag-agent',
429
429
  name: 'RAG Agent',
430
- model: 'openai/gpt-5.5',
430
+ model: 'openai/gpt-5.6-sol',
431
431
  instructions: `
432
432
  Process queries using the provided context. Structure responses to be concise and relevant.
433
433
  ${OPENSEARCH_PROMPT}
@@ -444,7 +444,7 @@ import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
444
444
  export const ragAgent = new Agent({
445
445
  id: 'rag-agent',
446
446
  name: 'RAG Agent',
447
- model: 'openai/gpt-5.5',
447
+ model: 'openai/gpt-5.6-sol',
448
448
  instructions: `
449
449
  Process queries using the provided context. Structure responses to be concise and relevant.
450
450
  ${S3VECTORS_PROMPT}
@@ -455,10 +455,10 @@ export const ragAgent = new Agent({
455
455
 
456
456
  ### Re-ranking
457
457
 
458
- Initial vector similarity search can sometimes miss nuanced relevance. Re-ranking is a more computationally expensive process, but more accurate algorithm that improves results by:
458
+ Initial vector similarity search can sometimes miss detailed relevance. Re-ranking is a more computationally expensive process, but more accurate algorithm that improves results by:
459
459
 
460
460
  - Considering word order and exact matches
461
- - Applying more sophisticated relevance scoring
461
+ - Applying more advanced relevance scoring
462
462
  - Using a method called cross-attention between query and documents
463
463
 
464
464
  Here's how to use re-ranking:
@@ -476,7 +476,7 @@ const initialResults = await pgVector.query({
476
476
  // Create a relevance scorer
477
477
  const relevanceProvider = new MastraAgentRelevanceScorer(
478
478
  'relevance-scorer',
479
- 'openai/gpt-5.5',
479
+ 'openai/gpt-5.6-sol',
480
480
  )
481
481
 
482
482
  // Re-rank the results
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Storing embeddings in a vector database
4
4
 
5
- After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across various vector databases.
5
+ After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across vector databases.
6
6
 
7
7
  ## Supported databases
8
8
 
@@ -35,6 +35,23 @@ For detailed setup instructions and best practices, see the [official MongoDB At
35
35
 
36
36
  MongoDB works seamlessly with VoyageAI's embedding models, which are optimized for retrieval tasks. For complete examples and specialized models, see the [VoyageAI embeddings documentation](https://mastra.ai/models/embeddings) and [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb).
37
37
 
38
+ ### Hybrid Search (Vector + Full-Text)
39
+
40
+ MongoDB supports hybrid search that fuses vector similarity with BM25 full-text search using server-side `$rankFusion` (requires MongoDB >= 8.0; generally available from 8.1, and enabled on Atlas 8.0.x). This is useful when you want to combine semantic and keyword-based retrieval:
41
+
42
+ ```ts
43
+ await store.createSearchIndex({ indexName: 'myCollection', fields: ['text'] })
44
+ const results = await store.hybridQuery({
45
+ indexName: 'myCollection',
46
+ queryVector: embedding,
47
+ query: 'search terms',
48
+ paths: ['text'],
49
+ topK: 10,
50
+ })
51
+ ```
52
+
53
+ See the [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb) for details on `createSearchIndex()`, `textQuery()`, and `hybridQuery()`.
54
+
38
55
  **PgVector**:
39
56
 
40
57
  ```ts
@@ -554,7 +571,7 @@ The upsert operation:
554
571
 
555
572
  Vector stores support rich metadata (any JSON-serializable fields) for filtering and organization. Since metadata is stored with no fixed schema, use consistent field naming to avoid unexpected query results.
556
573
 
557
- > **Warning:** Metadata is crucial for vector storage - without it, you'd only have numerical embeddings with no way to return the original text or filter results. Always store at least the source text as metadata.
574
+ > **Warning:** Metadata is important for vector storage. Without it, you'd only have numerical embeddings with no way to return the original text or filter results. Always store at least the source text as metadata.
558
575
 
559
576
  ```ts
560
577
  // Store embeddings with rich metadata for better organization and filtering