@mastra/pg 1.20.0-alpha.3 → 1.20.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/CHANGELOG.md +102 -0
- package/dist/docs/SKILL.md +9 -7
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-storage-overview.md +14 -13
- package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md} +1 -1
- package/dist/docs/references/integrations-databases-neon.md +220 -0
- package/dist/docs/references/{reference-storage-postgresql.md → integrations-databases-postgresql.md} +1 -1
- package/dist/docs/references/reference-rag-chunking-and-embedding.md +182 -0
- package/dist/docs/references/{guides-rag-overview.md → reference-rag-overview.md} +2 -2
- package/dist/docs/references/{guides-rag-retrieval.md → reference-rag-retrieval.md} +1 -1
- package/dist/docs/references/{guides-rag-vector-databases.md → reference-rag-vector-databases.md} +1 -1
- package/dist/docs/references/reference-storage-composite.md +4 -4
- package/dist/docs/references/reference-storage-retention.md +4 -4
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +1 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -63,11 +63,11 @@ This example shows the essentials. Initialize a document and create chunks, then
|
|
|
63
63
|
|
|
64
64
|
## Document processing
|
|
65
65
|
|
|
66
|
-
The basic building block of RAG is document processing. Documents can be chunked using strategies (recursive, sliding window, etc.) and enriched with metadata. See the [chunking and embedding doc](https://mastra.ai/
|
|
66
|
+
The basic building block of RAG is document processing. Documents can be chunked using strategies (recursive, sliding window, etc.) and enriched with metadata. See the [chunking and embedding doc](https://mastra.ai/reference/rag/chunking-and-embedding).
|
|
67
67
|
|
|
68
68
|
## Vector storage
|
|
69
69
|
|
|
70
|
-
Mastra supports multiple vector stores for embedding persistence and similarity search, including pgvector, OracleDB, Pinecone, Qdrant, and MongoDB. See the [vector database doc](https://mastra.ai/
|
|
70
|
+
Mastra supports multiple vector stores for embedding persistence and similarity search, including pgvector, OracleDB, Pinecone, Qdrant, and MongoDB. See the [vector database doc](https://mastra.ai/reference/rag/vector-databases).
|
|
71
71
|
|
|
72
72
|
## More resources
|
|
73
73
|
|
|
@@ -534,4 +534,4 @@ The re-ranked results combine vector similarity with semantic understanding to i
|
|
|
534
534
|
|
|
535
535
|
For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
|
|
536
536
|
|
|
537
|
-
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/
|
|
537
|
+
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/reference/rag/graph-rag-guide) documentation.
|
package/dist/docs/references/{guides-rag-vector-databases.md → reference-rag-vector-databases.md}
RENAMED
|
@@ -407,7 +407,7 @@ await store.createIndex({
|
|
|
407
407
|
|
|
408
408
|
The dimension size must match the output dimension of your chosen embedding model. Common dimension sizes are:
|
|
409
409
|
|
|
410
|
-
-
|
|
410
|
+
- OpenAI `text-embedding-3-small`: 1536 dimensions (or custom, e.g., 256)
|
|
411
411
|
- `Cohere embed-multilingual-v3`: 1024 dimensions
|
|
412
412
|
- `VoyageAI voyage-3.5`: 1024 dimensions (or custom: 256, 512, 1024, 2048)
|
|
413
413
|
- `Google gemini-embedding-001`: 768 dimensions (or custom)
|
|
@@ -338,7 +338,7 @@ const storage = new MastraCompositeStore({
|
|
|
338
338
|
|
|
339
339
|
Observability data can quickly overwhelm general-purpose databases in production. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day.
|
|
340
340
|
|
|
341
|
-
**[ClickHouse](https://mastra.ai/
|
|
341
|
+
**[ClickHouse](https://mastra.ai/integrations/databases/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
|
|
342
342
|
|
|
343
343
|
```typescript
|
|
344
344
|
import { MastraCompositeStore } from '@mastra/core/storage'
|
|
@@ -360,7 +360,7 @@ const storage = new MastraCompositeStore({
|
|
|
360
360
|
})
|
|
361
361
|
```
|
|
362
362
|
|
|
363
|
-
> **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/
|
|
363
|
+
> **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for details.
|
|
364
364
|
|
|
365
365
|
### Replicated ClickHouse for multi-replica clusters
|
|
366
366
|
|
|
@@ -392,6 +392,6 @@ const storage = new MastraCompositeStore({
|
|
|
392
392
|
})
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/
|
|
395
|
+
Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for the full config shape and operator notes.
|
|
396
396
|
|
|
397
|
-
> **
|
|
397
|
+
> **Note:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
|
|
@@ -8,7 +8,7 @@ Storage grows without bound by default. Retention is an opt-in, age-based cleanu
|
|
|
8
8
|
|
|
9
9
|
Retention covers **growth tables** only: tables that accumulate rows unbounded as a side effect of normal operation (conversation history, telemetry, job and run records, schedule fire history, event feeds). User-authored artifacts and config (agents, skills, workspaces, prompt blocks, datasets, schedule definitions, channel installations, and so on) grow with user intent and are edited or deleted explicitly, so they're not valid retention keys.
|
|
10
10
|
|
|
11
|
-
The reference implementations are [libSQL](https://mastra.ai/
|
|
11
|
+
The reference implementations are [libSQL](https://mastra.ai/integrations/databases/libsql), [PostgreSQL](https://mastra.ai/integrations/databases/postgresql), and [MongoDB](https://mastra.ai/integrations/databases/mongodb). Other adapters keep rows forever until they implement retention.
|
|
12
12
|
|
|
13
13
|
## Usage example
|
|
14
14
|
|
|
@@ -238,11 +238,11 @@ Handing that free space back to the OS is a separate concern that Mastra doesn't
|
|
|
238
238
|
|
|
239
239
|
For MongoDB, deleted documents are reused by future insertions. To reclaim disk space, run [`db.runCommand({ compact: "collection_name" })`](https://www.mongodb.com/docs/manual/reference/command/compact/) during a maintenance window.
|
|
240
240
|
|
|
241
|
-
> **LibSQL and Turso:** [Turso Cloud](https://mastra.ai/
|
|
241
|
+
> **LibSQL and Turso:** [Turso Cloud](https://mastra.ai/integrations/databases/libsql) manages storage compaction for you, so there's nothing to reclaim manually. This applies only to self-hosted libSQL files.
|
|
242
242
|
|
|
243
243
|
## Related
|
|
244
244
|
|
|
245
|
-
- [libSQL storage](https://mastra.ai/
|
|
246
|
-
- [PostgreSQL storage](https://mastra.ai/
|
|
245
|
+
- [libSQL storage](https://mastra.ai/integrations/databases/libsql)
|
|
246
|
+
- [PostgreSQL storage](https://mastra.ai/integrations/databases/postgresql)
|
|
247
247
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
248
248
|
- [Storage overview](https://mastra.ai/reference/storage/overview)
|
package/dist/index.cjs
CHANGED
|
@@ -8728,6 +8728,7 @@ function dedupeMessagesForSave(messages) {
|
|
|
8728
8728
|
return Array.from(deduped.values());
|
|
8729
8729
|
}
|
|
8730
8730
|
var MemoryPG = class MemoryPG extends _mastra_core_storage.MemoryStorage {
|
|
8731
|
+
supportsPartialThreadUpdate = true;
|
|
8731
8732
|
supportsObservationalMemory = true;
|
|
8732
8733
|
/**
|
|
8733
8734
|
* Retention-eligible tables. `threads`, `messages`, and `resources` all anchor
|