@mastra/upstash 1.5.4 → 1.5.5-alpha.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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +2 -2
- package/dist/docs/references/integrations-databases-upstash.md +1 -1
- package/dist/docs/references/reference-rag-retrieval.md +24 -13
- package/dist/docs/references/reference-vectors-upstash.md +1 -1
- package/dist/index.cjs +12 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -24
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/docs/SKILL.md
CHANGED
|
@@ -34,7 +34,7 @@ const agent = new Agent({
|
|
|
34
34
|
id: 'personal-assistant',
|
|
35
35
|
name: 'PersonalAssistant',
|
|
36
36
|
instructions: 'You are a helpful personal assistant.',
|
|
37
|
-
model: 'openai/gpt-
|
|
37
|
+
model: 'openai/gpt-6.1-sol',
|
|
38
38
|
memory: new Memory({
|
|
39
39
|
options: {
|
|
40
40
|
workingMemory: {
|
|
@@ -418,7 +418,7 @@ const response = await agent.generate('What do you know about me?', {
|
|
|
418
418
|
|
|
419
419
|
## Opt in to state signals (experimental)
|
|
420
420
|
|
|
421
|
-
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/
|
|
421
|
+
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/signals/state-signals) instead by setting `useStateSignals: true`:
|
|
422
422
|
|
|
423
423
|
```typescript
|
|
424
424
|
const memory = new Memory({
|
|
@@ -107,7 +107,7 @@ export const upstashAgent = new Agent({
|
|
|
107
107
|
name: 'Upstash Agent',
|
|
108
108
|
instructions:
|
|
109
109
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
110
|
-
model: 'openai/gpt-
|
|
110
|
+
model: 'openai/gpt-6.1-sol',
|
|
111
111
|
memory: new Memory({
|
|
112
112
|
storage: new UpstashStore({
|
|
113
113
|
id: 'upstash-agent-storage',
|
|
@@ -382,11 +382,12 @@ Vector store prompts define query patterns and filtering capabilities for each v
|
|
|
382
382
|
|
|
383
383
|
```ts
|
|
384
384
|
import { MONGODB_PROMPT } from '@mastra/mongodb'
|
|
385
|
+
import { Agent } from '@mastra/core/agent'
|
|
385
386
|
|
|
386
387
|
export const ragAgent = new Agent({
|
|
387
388
|
id: 'rag-agent',
|
|
388
389
|
name: 'RAG Agent',
|
|
389
|
-
model: 'openai/gpt-
|
|
390
|
+
model: 'openai/gpt-6.1-sol',
|
|
390
391
|
instructions: `
|
|
391
392
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
392
393
|
${MONGODB_PROMPT}
|
|
@@ -403,7 +404,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
|
|
|
403
404
|
export const ragAgent = new Agent({
|
|
404
405
|
id: 'rag-agent',
|
|
405
406
|
name: 'RAG Agent',
|
|
406
|
-
model: 'openai/gpt-
|
|
407
|
+
model: 'openai/gpt-6.1-sol',
|
|
407
408
|
instructions: `
|
|
408
409
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
409
410
|
${PGVECTOR_PROMPT}
|
|
@@ -416,11 +417,12 @@ export const ragAgent = new Agent({
|
|
|
416
417
|
|
|
417
418
|
```ts
|
|
418
419
|
import { PINECONE_PROMPT } from '@mastra/pinecone'
|
|
420
|
+
import { Agent } from '@mastra/core/agent'
|
|
419
421
|
|
|
420
422
|
export const ragAgent = new Agent({
|
|
421
423
|
id: 'rag-agent',
|
|
422
424
|
name: 'RAG Agent',
|
|
423
|
-
model: 'openai/gpt-
|
|
425
|
+
model: 'openai/gpt-6.1-sol',
|
|
424
426
|
instructions: `
|
|
425
427
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
426
428
|
${PINECONE_PROMPT}
|
|
@@ -433,11 +435,12 @@ export const ragAgent = new Agent({
|
|
|
433
435
|
|
|
434
436
|
```ts
|
|
435
437
|
import { QDRANT_PROMPT } from '@mastra/qdrant'
|
|
438
|
+
import { Agent } from '@mastra/core/agent'
|
|
436
439
|
|
|
437
440
|
export const ragAgent = new Agent({
|
|
438
441
|
id: 'rag-agent',
|
|
439
442
|
name: 'RAG Agent',
|
|
440
|
-
model: 'openai/gpt-
|
|
443
|
+
model: 'openai/gpt-6.1-sol',
|
|
441
444
|
instructions: `
|
|
442
445
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
443
446
|
${QDRANT_PROMPT}
|
|
@@ -450,11 +453,12 @@ export const ragAgent = new Agent({
|
|
|
450
453
|
|
|
451
454
|
```ts
|
|
452
455
|
import { CHROMA_PROMPT } from '@mastra/chroma'
|
|
456
|
+
import { Agent } from '@mastra/core/agent'
|
|
453
457
|
|
|
454
458
|
export const ragAgent = new Agent({
|
|
455
459
|
id: 'rag-agent',
|
|
456
460
|
name: 'RAG Agent',
|
|
457
|
-
model: 'openai/gpt-
|
|
461
|
+
model: 'openai/gpt-6.1-sol',
|
|
458
462
|
instructions: `
|
|
459
463
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
460
464
|
${CHROMA_PROMPT}
|
|
@@ -467,11 +471,12 @@ export const ragAgent = new Agent({
|
|
|
467
471
|
|
|
468
472
|
```ts
|
|
469
473
|
import { ASTRA_PROMPT } from '@mastra/astra'
|
|
474
|
+
import { Agent } from '@mastra/core/agent'
|
|
470
475
|
|
|
471
476
|
export const ragAgent = new Agent({
|
|
472
477
|
id: 'rag-agent',
|
|
473
478
|
name: 'RAG Agent',
|
|
474
|
-
model: 'openai/gpt-
|
|
479
|
+
model: 'openai/gpt-6.1-sol',
|
|
475
480
|
instructions: `
|
|
476
481
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
477
482
|
${ASTRA_PROMPT}
|
|
@@ -484,11 +489,12 @@ export const ragAgent = new Agent({
|
|
|
484
489
|
|
|
485
490
|
```ts
|
|
486
491
|
import { LIBSQL_PROMPT } from '@mastra/libsql'
|
|
492
|
+
import { Agent } from '@mastra/core/agent'
|
|
487
493
|
|
|
488
494
|
export const ragAgent = new Agent({
|
|
489
495
|
id: 'rag-agent',
|
|
490
496
|
name: 'RAG Agent',
|
|
491
|
-
model: 'openai/gpt-
|
|
497
|
+
model: 'openai/gpt-6.1-sol',
|
|
492
498
|
instructions: `
|
|
493
499
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
494
500
|
${LIBSQL_PROMPT}
|
|
@@ -501,11 +507,12 @@ export const ragAgent = new Agent({
|
|
|
501
507
|
|
|
502
508
|
```ts
|
|
503
509
|
import { UPSTASH_PROMPT } from '@mastra/upstash'
|
|
510
|
+
import { Agent } from '@mastra/core/agent'
|
|
504
511
|
|
|
505
512
|
export const ragAgent = new Agent({
|
|
506
513
|
id: 'rag-agent',
|
|
507
514
|
name: 'RAG Agent',
|
|
508
|
-
model: 'openai/gpt-
|
|
515
|
+
model: 'openai/gpt-6.1-sol',
|
|
509
516
|
instructions: `
|
|
510
517
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
511
518
|
${UPSTASH_PROMPT}
|
|
@@ -518,11 +525,12 @@ export const ragAgent = new Agent({
|
|
|
518
525
|
|
|
519
526
|
```ts
|
|
520
527
|
import { VECTORIZE_PROMPT } from '@mastra/vectorize'
|
|
528
|
+
import { Agent } from '@mastra/core/agent'
|
|
521
529
|
|
|
522
530
|
export const ragAgent = new Agent({
|
|
523
531
|
id: 'rag-agent',
|
|
524
532
|
name: 'RAG Agent',
|
|
525
|
-
model: 'openai/gpt-
|
|
533
|
+
model: 'openai/gpt-6.1-sol',
|
|
526
534
|
instructions: `
|
|
527
535
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
528
536
|
${VECTORIZE_PROMPT}
|
|
@@ -535,11 +543,12 @@ export const ragAgent = new Agent({
|
|
|
535
543
|
|
|
536
544
|
```ts
|
|
537
545
|
import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
|
|
546
|
+
import { Agent } from '@mastra/core/agent'
|
|
538
547
|
|
|
539
548
|
export const ragAgent = new Agent({
|
|
540
549
|
id: 'rag-agent',
|
|
541
550
|
name: 'RAG Agent',
|
|
542
|
-
model: 'openai/gpt-
|
|
551
|
+
model: 'openai/gpt-6.1-sol',
|
|
543
552
|
instructions: `
|
|
544
553
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
545
554
|
${OPENSEARCH_PROMPT}
|
|
@@ -552,11 +561,12 @@ export const ragAgent = new Agent({
|
|
|
552
561
|
|
|
553
562
|
```ts
|
|
554
563
|
import { ORACLEDB_PROMPT } from '@mastra/oracledb'
|
|
564
|
+
import { Agent } from '@mastra/core/agent'
|
|
555
565
|
|
|
556
566
|
export const ragAgent = new Agent({
|
|
557
567
|
id: 'rag-agent',
|
|
558
568
|
name: 'RAG Agent',
|
|
559
|
-
model: 'openai/gpt-
|
|
569
|
+
model: 'openai/gpt-6.1-sol',
|
|
560
570
|
instructions: `
|
|
561
571
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
562
572
|
${ORACLEDB_PROMPT}
|
|
@@ -569,11 +579,12 @@ export const ragAgent = new Agent({
|
|
|
569
579
|
|
|
570
580
|
```ts
|
|
571
581
|
import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
|
|
582
|
+
import { Agent } from '@mastra/core/agent'
|
|
572
583
|
|
|
573
584
|
export const ragAgent = new Agent({
|
|
574
585
|
id: 'rag-agent',
|
|
575
586
|
name: 'RAG Agent',
|
|
576
|
-
model: 'openai/gpt-
|
|
587
|
+
model: 'openai/gpt-6.1-sol',
|
|
577
588
|
instructions: `
|
|
578
589
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
579
590
|
${S3VECTORS_PROMPT}
|
|
@@ -605,7 +616,7 @@ const initialResults = await pgVector.query({
|
|
|
605
616
|
// Create a relevance scorer
|
|
606
617
|
const relevanceProvider = new MastraAgentRelevanceScorer(
|
|
607
618
|
'relevance-scorer',
|
|
608
|
-
'openai/gpt-
|
|
619
|
+
'openai/gpt-6.1-sol',
|
|
609
620
|
)
|
|
610
621
|
|
|
611
622
|
// Re-rank the results
|
|
@@ -275,7 +275,7 @@ export const upstashAgent = new Agent({
|
|
|
275
275
|
name: 'Upstash Agent',
|
|
276
276
|
instructions:
|
|
277
277
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
278
|
-
model: 'openai/gpt-
|
|
278
|
+
model: 'openai/gpt-6.1-sol',
|
|
279
279
|
memory: new Memory({
|
|
280
280
|
storage: new UpstashStore({
|
|
281
281
|
id: 'upstash-agent-storage',
|
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ let _mastra_core_evals = require("@mastra/core/evals");
|
|
|
8
8
|
let _mastra_core_vector = require("@mastra/core/vector");
|
|
9
9
|
let _upstash_vector = require("@upstash/vector");
|
|
10
10
|
let _mastra_core_vector_filter = require("@mastra/core/vector/filter");
|
|
11
|
-
|
|
11
|
+
// src/cache/index.ts
|
|
12
12
|
/**
|
|
13
13
|
* Upstash Redis implementation of MastraServerCache.
|
|
14
14
|
*
|
|
@@ -50,8 +50,7 @@ var UpstashServerCache = class extends _mastra_redis.RedisServerCache {
|
|
|
50
50
|
super({ client }, redisOptions);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
//#region src/storage/domains/utils.ts
|
|
53
|
+
// src/storage/domains/utils.ts
|
|
55
54
|
function getKey(tableName, keys) {
|
|
56
55
|
return `${tableName}:${Object.entries(keys).filter(([_, value]) => value !== void 0).map(([key, value]) => `${key}:${value}`).join(":")}`;
|
|
57
56
|
}
|
|
@@ -79,8 +78,7 @@ function processRecord(tableName, record) {
|
|
|
79
78
|
processedRecord
|
|
80
79
|
};
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
//#region src/storage/db/index.ts
|
|
81
|
+
// src/storage/db/index.ts
|
|
84
82
|
/**
|
|
85
83
|
* Resolves UpstashDomainConfig to a Redis client.
|
|
86
84
|
* Handles creating a new Redis client if url/token are provided.
|
|
@@ -166,8 +164,7 @@ var UpstashDB = class {
|
|
|
166
164
|
}
|
|
167
165
|
}
|
|
168
166
|
};
|
|
169
|
-
|
|
170
|
-
//#region src/storage/domains/background-tasks/index.ts
|
|
167
|
+
// src/storage/domains/background-tasks/index.ts
|
|
171
168
|
function toStorageRecord(task) {
|
|
172
169
|
return {
|
|
173
170
|
id: task.id,
|
|
@@ -351,8 +348,7 @@ var BackgroundTasksUpstash = class extends _mastra_core_storage.BackgroundTasksS
|
|
|
351
348
|
return total;
|
|
352
349
|
}
|
|
353
350
|
};
|
|
354
|
-
|
|
355
|
-
//#region src/storage/domains/run-fencing.ts
|
|
351
|
+
// src/storage/domains/run-fencing.ts
|
|
356
352
|
function runClaimKey(claims, runId) {
|
|
357
353
|
return `${claims}:run_id:${runId}`;
|
|
358
354
|
}
|
|
@@ -584,8 +580,7 @@ function writeBatch(client, check) {
|
|
|
584
580
|
async function assertRunFence(client, check) {
|
|
585
581
|
if (check) await new FencedWriteBatch(client, check).exec();
|
|
586
582
|
}
|
|
587
|
-
|
|
588
|
-
//#region src/storage/domains/memory/index.ts
|
|
583
|
+
// src/storage/domains/memory/index.ts
|
|
589
584
|
function getThreadMessagesKey(threadId) {
|
|
590
585
|
return `thread:${threadId}:messages`;
|
|
591
586
|
}
|
|
@@ -1598,8 +1593,7 @@ var StoreMemoryUpstash = class extends _mastra_core_storage.MemoryStorage {
|
|
|
1598
1593
|
}
|
|
1599
1594
|
}
|
|
1600
1595
|
};
|
|
1601
|
-
|
|
1602
|
-
//#region src/storage/domains/scores/index.ts
|
|
1596
|
+
// src/storage/domains/scores/index.ts
|
|
1603
1597
|
/**
|
|
1604
1598
|
* Upstash-specific score row transformation.
|
|
1605
1599
|
* Uses default options (no timestamp conversion).
|
|
@@ -1878,8 +1872,7 @@ var ScoresUpstash = class extends _mastra_core_storage.ScoresStorage {
|
|
|
1878
1872
|
};
|
|
1879
1873
|
}
|
|
1880
1874
|
};
|
|
1881
|
-
|
|
1882
|
-
//#region src/storage/domains/workflows/index.ts
|
|
1875
|
+
// src/storage/domains/workflows/index.ts
|
|
1883
1876
|
var WorkflowsUpstash = class extends _mastra_core_storage.WorkflowsStorage {
|
|
1884
1877
|
client;
|
|
1885
1878
|
#db;
|
|
@@ -2370,8 +2363,7 @@ var WorkflowsUpstash = class extends _mastra_core_storage.WorkflowsStorage {
|
|
|
2370
2363
|
}
|
|
2371
2364
|
}
|
|
2372
2365
|
};
|
|
2373
|
-
|
|
2374
|
-
//#region src/storage/index.ts
|
|
2366
|
+
// src/storage/index.ts
|
|
2375
2367
|
/**
|
|
2376
2368
|
* Type guard for pre-configured client config
|
|
2377
2369
|
*/
|
|
@@ -2427,8 +2419,7 @@ var UpstashStore = class extends _mastra_core_storage.MastraCompositeStore {
|
|
|
2427
2419
|
}
|
|
2428
2420
|
async close() {}
|
|
2429
2421
|
};
|
|
2430
|
-
|
|
2431
|
-
//#region src/vector/filter.ts
|
|
2422
|
+
// src/vector/filter.ts
|
|
2432
2423
|
var UpstashFilterTranslator = class extends _mastra_core_vector_filter.BaseFilterTranslator {
|
|
2433
2424
|
getSupportedOperators() {
|
|
2434
2425
|
return {
|
|
@@ -2574,8 +2565,7 @@ var UpstashFilterTranslator = class extends _mastra_core_vector_filter.BaseFilte
|
|
|
2574
2565
|
return `(${(Array.isArray(conditions) ? conditions.map((c) => this.translateNode(c)) : [this.translateNode(conditions)]).join(` ${operator} `)})`;
|
|
2575
2566
|
}
|
|
2576
2567
|
};
|
|
2577
|
-
|
|
2578
|
-
//#region src/vector/index.ts
|
|
2568
|
+
// src/vector/index.ts
|
|
2579
2569
|
var UpstashVector = class extends _mastra_core_vector.MastraVector {
|
|
2580
2570
|
client;
|
|
2581
2571
|
/**
|
|
@@ -2931,8 +2921,7 @@ var UpstashVector = class extends _mastra_core_vector.MastraVector {
|
|
|
2931
2921
|
}
|
|
2932
2922
|
}
|
|
2933
2923
|
};
|
|
2934
|
-
|
|
2935
|
-
//#region src/vector/prompt.ts
|
|
2924
|
+
// src/vector/prompt.ts
|
|
2936
2925
|
/**
|
|
2937
2926
|
* Vector store specific prompt that details supported operators and examples.
|
|
2938
2927
|
* This prompt helps users construct valid filters for Upstash Vector.
|
|
@@ -3010,7 +2999,6 @@ Example Complex Query:
|
|
|
3010
2999
|
]}
|
|
3011
3000
|
]
|
|
3012
3001
|
}`;
|
|
3013
|
-
//#endregion
|
|
3014
3002
|
exports.BackgroundTasksUpstash = BackgroundTasksUpstash;
|
|
3015
3003
|
Object.defineProperty(exports, "RedisServerCache", {
|
|
3016
3004
|
enumerable: true,
|