@mastra/fastembed 0.10.7 → 1.0.0-beta.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 CHANGED
@@ -1,22 +1,20 @@
1
1
  # @mastra/fastembed
2
2
 
3
- ## 0.10.7
3
+ ## 1.0.0-beta.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
7
+ - Embed AI types to fix peerdeps mismatches ([`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808))
8
8
 
9
- ## 0.10.7-alpha.0
9
+ ## 1.0.0-beta.0
10
10
 
11
- ### Patch Changes
12
-
13
- - update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
11
+ ### Major Changes
14
12
 
15
- ## 0.10.6
13
+ - Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
16
14
 
17
- ### Patch Changes
15
+ - Upgraded to AI SDK v5 (specification version v2) for compatibility with @mastra/core. Default exports now use v2 specification. Legacy v1 exports available for backwards compatibility via `fastembed.smallLegacy` and `fastembed.baseLegacy`. ([#9349](https://github.com/mastra-ai/mastra/pull/9349))
18
16
 
19
- - Fix peerdependencies ([`eb7c1c8`](https://github.com/mastra-ai/mastra/commit/eb7c1c8c592d8fb16dfd250e337d9cdc73c8d5de))
17
+ - Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
20
18
 
21
19
  ## 0.10.5
22
20
 
package/README.md CHANGED
@@ -10,19 +10,58 @@ This package provides a FastEmbed embedding model integration for use with Mastr
10
10
  pnpm add @mastra/fastembed
11
11
  ```
12
12
 
13
+ ## AI SDK v2 Compatibility
14
+
15
+ This package supports AI SDK v5 (specification version v2). The default exports use v2, which is compatible with `@mastra/core` and AI SDK v5.
16
+
17
+ **Breaking Change:** Previous versions used AI SDK specification v1. If you need v1 compatibility for legacy code, use the `Legacy` exports.
18
+
13
19
  ## Usage
14
20
 
21
+ ### Default (AI SDK v2)
22
+
15
23
  ```typescript
16
24
  import { Memory } from '@mastra/memory';
17
25
  import { fastembed } from '@mastra/fastembed';
18
26
 
19
27
  const memory = new Memory({
20
28
  // ... other memory options
21
- embedder: fastembed,
29
+ embedder: fastembed, // Uses v2 specification
22
30
  });
23
31
 
24
32
  // Now you can use this memory instance with an Agent
25
33
  // const agent = new Agent({ memory, ... });
26
34
  ```
27
35
 
36
+ ### Available Models
37
+
38
+ ```typescript
39
+ import { fastembed } from '@mastra/fastembed';
40
+
41
+ // Default export (bge-small-en-v1.5 with v2 spec)
42
+ const embedder = fastembed;
43
+
44
+ // Named exports for v2 models
45
+ const small = fastembed.small; // bge-small-en-v1.5
46
+ const base = fastembed.base; // bge-base-en-v1.5
47
+
48
+ // Legacy v1 models (for backwards compatibility)
49
+ const smallLegacy = fastembed.smallLegacy; // bge-small-en-v1.5 (v1 spec)
50
+ const baseLegacy = fastembed.baseLegacy; // bge-base-en-v1.5 (v1 spec)
51
+ ```
52
+
53
+ ### Direct Usage with AI SDK v5
54
+
55
+ ```typescript
56
+ import { embed } from 'ai';
57
+ import { fastembed } from '@mastra/fastembed';
58
+
59
+ const result = await embed({
60
+ model: fastembed,
61
+ value: 'Text to embed',
62
+ });
63
+
64
+ console.log(result.embedding); // number[]
65
+ ```
66
+
28
67
  This package wraps the `fastembed-js` library to provide an embedding model compatible with the AI SDK and Mastra.