@mastra/pg 1.35.0 → 1.36.0-alpha.0
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 +158 -2
- package/dist/docs/references/reference-processors-message-history-processor.md +1 -1
- package/dist/docs/references/reference-processors-semantic-recall-processor.md +1 -1
- package/dist/docs/references/reference-tools-vector-query-tool.md +3 -3
- package/dist/index.cjs +779 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +780 -58
- package/dist/index.js.map +1 -1
- package/dist/storage/db/index.d.ts +3 -3
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +87 -7
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/retention.d.ts +3 -1
- package/dist/storage/retention.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,6 +1,162 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.36.0-alpha.0",
|
|
3
3
|
"package": "@mastra/pg",
|
|
4
|
-
"exports": {
|
|
4
|
+
"exports": {
|
|
5
|
+
"AgentsPG": {
|
|
6
|
+
"types": "dist/storage/domains/agents/index.d.ts",
|
|
7
|
+
"implementation": "dist/index.js",
|
|
8
|
+
"line": 4366
|
|
9
|
+
},
|
|
10
|
+
"BackgroundTasksPG": {
|
|
11
|
+
"types": "dist/storage/domains/background-tasks/index.d.ts",
|
|
12
|
+
"implementation": "dist/index.js",
|
|
13
|
+
"line": 5297
|
|
14
|
+
},
|
|
15
|
+
"BlobsPG": {
|
|
16
|
+
"types": "dist/storage/domains/blobs/index.d.ts",
|
|
17
|
+
"implementation": "dist/index.js",
|
|
18
|
+
"line": 5688
|
|
19
|
+
},
|
|
20
|
+
"ChannelsPG": {
|
|
21
|
+
"types": "dist/storage/domains/channels/index.d.ts",
|
|
22
|
+
"implementation": "dist/index.js",
|
|
23
|
+
"line": 5790
|
|
24
|
+
},
|
|
25
|
+
"DatasetsPG": {
|
|
26
|
+
"types": "dist/storage/domains/datasets/index.d.ts",
|
|
27
|
+
"implementation": "dist/index.js",
|
|
28
|
+
"line": 6032
|
|
29
|
+
},
|
|
30
|
+
"ExperimentsPG": {
|
|
31
|
+
"types": "dist/storage/domains/experiments/index.d.ts",
|
|
32
|
+
"implementation": "dist/index.js",
|
|
33
|
+
"line": 7289
|
|
34
|
+
},
|
|
35
|
+
"FavoritesPG": {
|
|
36
|
+
"types": "dist/storage/domains/favorites/index.d.ts",
|
|
37
|
+
"implementation": "dist/index.js",
|
|
38
|
+
"line": 8261
|
|
39
|
+
},
|
|
40
|
+
"KnowledgePG": {
|
|
41
|
+
"types": "dist/storage/domains/knowledge/index.d.ts",
|
|
42
|
+
"implementation": "dist/index.js",
|
|
43
|
+
"line": 10139
|
|
44
|
+
},
|
|
45
|
+
"MCPClientsPG": {
|
|
46
|
+
"types": "dist/storage/domains/mcp-clients/index.d.ts",
|
|
47
|
+
"implementation": "dist/index.js",
|
|
48
|
+
"line": 10296
|
|
49
|
+
},
|
|
50
|
+
"MCPServersPG": {
|
|
51
|
+
"types": "dist/storage/domains/mcp-servers/index.d.ts",
|
|
52
|
+
"implementation": "dist/index.js",
|
|
53
|
+
"line": 10865
|
|
54
|
+
},
|
|
55
|
+
"MemoryPG": {
|
|
56
|
+
"types": "dist/storage/domains/memory/index.d.ts",
|
|
57
|
+
"implementation": "dist/index.js",
|
|
58
|
+
"line": 11653
|
|
59
|
+
},
|
|
60
|
+
"NotificationsPG": {
|
|
61
|
+
"types": "dist/storage/domains/notifications/index.d.ts",
|
|
62
|
+
"implementation": "dist/index.js",
|
|
63
|
+
"line": 14464
|
|
64
|
+
},
|
|
65
|
+
"ObservabilityPG": {
|
|
66
|
+
"types": "dist/storage/domains/observability/index.d.ts",
|
|
67
|
+
"implementation": "dist/index.js",
|
|
68
|
+
"line": 14886
|
|
69
|
+
},
|
|
70
|
+
"ObservabilityStoragePostgresVNext": {
|
|
71
|
+
"types": "dist/storage/domains/observability/v-next/index.d.ts",
|
|
72
|
+
"implementation": "dist/index.js",
|
|
73
|
+
"line": 21800
|
|
74
|
+
},
|
|
75
|
+
"PGVECTOR_PROMPT": {
|
|
76
|
+
"types": "dist/vector/prompt.d.ts",
|
|
77
|
+
"implementation": "dist/index.js",
|
|
78
|
+
"line": 28464
|
|
79
|
+
},
|
|
80
|
+
"PgFactoryStorage": {
|
|
81
|
+
"types": "dist/storage/factory-storage.d.ts",
|
|
82
|
+
"implementation": "dist/index.js",
|
|
83
|
+
"line": 27950
|
|
84
|
+
},
|
|
85
|
+
"PgVector": {
|
|
86
|
+
"types": "dist/vector/index.d.ts",
|
|
87
|
+
"implementation": "dist/index.js",
|
|
88
|
+
"line": 593
|
|
89
|
+
},
|
|
90
|
+
"PoolAdapter": {
|
|
91
|
+
"types": "dist/storage/client.d.ts",
|
|
92
|
+
"implementation": "dist/index.js",
|
|
93
|
+
"line": 2069
|
|
94
|
+
},
|
|
95
|
+
"PostgresStore": {
|
|
96
|
+
"types": "dist/storage/index.d.ts",
|
|
97
|
+
"implementation": "dist/index.js",
|
|
98
|
+
"line": 28165
|
|
99
|
+
},
|
|
100
|
+
"PostgresStoreVNext": {
|
|
101
|
+
"types": "dist/storage/index.d.ts",
|
|
102
|
+
"implementation": "dist/index.js",
|
|
103
|
+
"line": 28383
|
|
104
|
+
},
|
|
105
|
+
"PromptBlocksPG": {
|
|
106
|
+
"types": "dist/storage/domains/prompt-blocks/index.d.ts",
|
|
107
|
+
"implementation": "dist/index.js",
|
|
108
|
+
"line": 22242
|
|
109
|
+
},
|
|
110
|
+
"SchedulesPG": {
|
|
111
|
+
"types": "dist/storage/domains/schedules/index.d.ts",
|
|
112
|
+
"implementation": "dist/index.js",
|
|
113
|
+
"line": 22869
|
|
114
|
+
},
|
|
115
|
+
"ScorerDefinitionsPG": {
|
|
116
|
+
"types": "dist/storage/domains/scorer-definitions/index.d.ts",
|
|
117
|
+
"implementation": "dist/index.js",
|
|
118
|
+
"line": 23190
|
|
119
|
+
},
|
|
120
|
+
"ScoresPG": {
|
|
121
|
+
"types": "dist/storage/domains/scores/index.d.ts",
|
|
122
|
+
"implementation": "dist/index.js",
|
|
123
|
+
"line": 23813
|
|
124
|
+
},
|
|
125
|
+
"SkillsPG": {
|
|
126
|
+
"types": "dist/storage/domains/skills/index.d.ts",
|
|
127
|
+
"implementation": "dist/index.js",
|
|
128
|
+
"line": 24256
|
|
129
|
+
},
|
|
130
|
+
"ThreadStatePG": {
|
|
131
|
+
"types": "dist/storage/domains/thread-state/index.d.ts",
|
|
132
|
+
"implementation": "dist/index.js",
|
|
133
|
+
"line": 24947
|
|
134
|
+
},
|
|
135
|
+
"ToolProviderConnectionsPG": {
|
|
136
|
+
"types": "dist/storage/domains/tool-provider-connections/index.d.ts",
|
|
137
|
+
"implementation": "dist/index.js",
|
|
138
|
+
"line": 25121
|
|
139
|
+
},
|
|
140
|
+
"WorkflowDefinitionsPG": {
|
|
141
|
+
"types": "dist/storage/domains/workflow-definitions/index.d.ts",
|
|
142
|
+
"implementation": "dist/index.js",
|
|
143
|
+
"line": 25385
|
|
144
|
+
},
|
|
145
|
+
"WorkflowsPG": {
|
|
146
|
+
"types": "dist/storage/domains/workflows/index.d.ts",
|
|
147
|
+
"implementation": "dist/index.js",
|
|
148
|
+
"line": 25768
|
|
149
|
+
},
|
|
150
|
+
"WorkspacesPG": {
|
|
151
|
+
"types": "dist/storage/domains/workspaces/index.d.ts",
|
|
152
|
+
"implementation": "dist/index.js",
|
|
153
|
+
"line": 27050
|
|
154
|
+
},
|
|
155
|
+
"exportSchemas": {
|
|
156
|
+
"types": "dist/storage/index.d.ts",
|
|
157
|
+
"implementation": "dist/index.js",
|
|
158
|
+
"line": 28132
|
|
159
|
+
}
|
|
160
|
+
},
|
|
5
161
|
"modules": {}
|
|
6
162
|
}
|
|
@@ -33,7 +33,7 @@ const processor = new MessageHistory({
|
|
|
33
33
|
|
|
34
34
|
**processInput** (`(args: { messages: MastraDBMessage[]; messageList: MessageList; abort: (reason?: string) => never; tracingContext?: TracingContext; requestContext?: RequestContext }) => Promise<MessageList | MastraDBMessage[]>`): Fetches historical messages from storage and adds them to the message list
|
|
35
35
|
|
|
36
|
-
**processOutputResult** (`(args: { messages: MastraDBMessage[]; messageList: MessageList; abort: (reason?: string) => never; tracingContext?: TracingContext; requestContext?: RequestContext }) => Promise<MessageList>`): Persists new messages (user input and assistant response) to storage, excluding system messages
|
|
36
|
+
**processOutputResult** (`(args: { messages: MastraDBMessage[]; messageList: MessageList; abort: (reason?: string) => never; tracingContext?: TracingContext; requestContext?: RequestContext; result?: OutputResult }) => Promise<MessageList>`): Persists new messages (user input and assistant response) to storage, excluding system messages
|
|
37
37
|
|
|
38
38
|
## Extended usage example
|
|
39
39
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# SemanticRecall
|
|
6
6
|
|
|
7
|
-
The `SemanticRecall` is a **hybrid processor** that enables semantic search over conversation history using vector embeddings. On input, it performs semantic search to find relevant historical messages. On output, it creates embeddings for new messages to enable future semantic retrieval.
|
|
7
|
+
The `SemanticRecall` is a **hybrid processor** that enables semantic search over conversation history using vector embeddings. On input, it performs semantic search to find relevant historical messages. On output, it creates embeddings for new messages to enable future semantic retrieval. With a self-embedding vector store and no `embedder`, it sends the message text to the store, which creates the embeddings.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -88,14 +88,14 @@ The tool returns an object with:
|
|
|
88
88
|
```typescript
|
|
89
89
|
{
|
|
90
90
|
id: string; // Unique chunk/document identifier
|
|
91
|
-
metadata
|
|
92
|
-
vector: number[]; // Embedding vector
|
|
91
|
+
metadata?: any; // All metadata fields (document ID, etc.)
|
|
92
|
+
vector: number[]; // Embedding vector, or [] when unavailable
|
|
93
93
|
score: number; // Similarity score for this retrieval
|
|
94
94
|
document: string; // Full chunk/document text (if available)
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
`document` is only populated by vector stores whose `query()` returns document content, such as Chroma, Elasticsearch, LanceDB, and MongoDB. For other stores, such as PgVector, it's an empty string. Read the chunk text from `sources[i].metadata
|
|
98
|
+
`document` is only populated by vector stores whose `query()` returns document content, such as Chroma, Elasticsearch, LanceDB, and MongoDB. For other stores, such as PgVector, it's an empty string. Read the chunk text from `sources[i].metadata?.text` (or whichever metadata key you stored it under). `metadata` is `undefined` when the store returns no metadata for a result.
|
|
99
99
|
|
|
100
100
|
## Default tool description
|
|
101
101
|
|