ts-v3.0.1

mem0ai/mem0ts-v3.0.1Apr 20, 2026by whysosaket

AI Summary

Patch release fixing telemetry version reporting to match actual package version.

Key Highlights

  • Fixed telemetry client_version drifting from actual package version
  • Injects SDK version into telemetry at build time via esbuild define
  • No code changes required - drop-in replacement for 3.0.0
  • Telemetry events now report correct client_version after upgrade

Full Release Notes

## Mem0 Node SDK (v3.0.1)

**Release date:** 2026-04-20
**Package:** [`mem0ai`](https://www.npmjs.com/package/mem0ai) on npm
**npm tag:** `ts-v3.0.1`

## Summary

Patch release that fixes telemetry's reported `client_version` drifting from the actual package version. Both telemetry clients (`MemoryClient` and OSS `Memory`) now always report the installed package version, driven by `package.json` at build time.

## Bug Fixes

- **Telemetry:** Inject SDK version into telemetry at build time via esbuild's `define`, replacing the two hardcoded `let version = "..."` strings in `mem0-ts/src/client/telemetry.ts` and `mem0-ts/src/oss/src/utils/telemetry.ts`. Previously these were set to `2.1.36` and `2.1.34` respectively, while the published package was on `3.x` — every telemetry event was reporting the wrong version. The placeholder is substituted with a string literal at bundle time, so there is no extra runtime I/O and no `require("./package.json")` in the shipped bundle. ([#4897](https://github.com/mem0ai/mem0/pull/4897))

## Internal

- Added `mem0-ts/src/global.d.ts` declaring the `__MEM0_SDK_VERSION__` ambient constant used by the telemetry modules.
- `mem0-ts/tsup.config.ts` now reads `pkg.version` and passes `{ __MEM0_SDK_VERSION__: JSON.stringify(pkg.version) }` to `define` for both `client` and `oss` builds.
- `mem0-ts/jest.setup.ts` exposes the same value on `globalThis` so `ts-jest` test runs continue to resolve the symbol.

## Upgrade

```bash
npm install mem0ai@3.0.1
# or
pnpm add mem0ai@3.0.1
# or
yarn add mem0ai@3.0.1
```

No code changes required — this release is a drop-in replacement for `3.0.0`. After upgrading, telemetry events will report `client_version: "3.0.1"` (and future bumps to `package.json` will flow through automatically with no further source edits).

## Full Changeset

- `fix(ts-sdk): inject SDK version into telemetry at build time`
- `chore(release): bump TS SDK to 3.0.1`

**Diff:** https://github.com/mem0ai/mem0/compare/ts-v3.0.0...ts-v3.0.1