Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

Added New Param, output_format (#2639)

Saket Aryan6e9f8cf21807
diff --git a/docs/changelog.mdx b/docs/changelog.mdx
index 0309c68b2..ca6fe9a9e 100644
--- a/docs/changelog.mdx
+++ b/docs/changelog.mdx
@@ -209,6 +209,12 @@ mode: "wide"
<Tab title="TypeScript">
+<Update label="2025-05-06" description="v2.1.24">
+**New Features:**
+- **Client:** Added new param `output_format` to match Python SDK.
+- **Client:** Added new enum `OutputFormat` for `v1.0` and `v1.1`
+</Update>
+
<Update label="2025-05-05" description="v2.1.23">
**New Features:**
- **Client:** Updated `deleteUsers` to use `v2` API.
diff --git a/docs/features/graph-memory.mdx b/docs/features/graph-memory.mdx
index a8c057bc9..458a86897 100644
--- a/docs/features/graph-memory.mdx
+++ b/docs/features/graph-memory.mdx
@@ -61,8 +61,8 @@ import { MemoryClient } from "mem0";
const client = new MemoryClient({
apiKey: "your-api-key",
- orgId: "your-org-id",
- projectId: "your-project-id"
+ org_id: "your-org-id",
+ project_id: "your-project-id"
});
const messages = [
@@ -74,10 +74,10 @@ const messages = [
// Enable graph memory when adding
await client.add({
messages,
- userId: "joseph",
+ user_id: "joseph",
version: "v1",
- enableGraph: true,
- outputFormat: "v1.1"
+ enable_graph: true,
+ output_format: "v1.1"
});
```
@@ -142,9 +142,9 @@ print(results)
// Search with graph memory enabled
const results = await client.search({
query: "what is my name?",
- userId: "joseph",
- enableGraph: true,
- outputFormat: "v1.1"
+ user_id: "joseph",
+ enable_graph: true,
+ output_format: "v1.1"
});
console.log(results);
@@ -211,9 +211,9 @@ print(memories)
```javascript JavaScript
// Get all memories with graph context
const memories = await client.getAll({
- userId: "joseph",
- enableGraph: true,
- outputFormat: "v1.1"
+ user_id: "joseph",
+ enable_graph: true,
+ output_format: "v1.1"
});
console.log(memories);
diff --git a/mem0-ts/package.json b/mem0-ts/package.json
index 2a726b3b9..3e554e534 100644
--- a/mem0-ts/package.json
+++ b/mem0-ts/package.json
@@ -1,6 +1,6 @@
{
"name": "mem0ai",
- "version": "2.1.23",
+ "version": "2.1.24",
"description": "The Memory Layer For Your AI Apps",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/mem0-ts/src/client/mem0.types.ts b/mem0-ts/src/client/mem0.types.ts
index 88c5f7cb4..ebbbe4cba 100644
--- a/mem0-ts/src/client/mem0.types.ts
+++ b/mem0-ts/src/client/mem0.types.ts
@@ -22,12 +22,18 @@ export interface MemoryOptions {
custom_categories?: custom_categories[];
custom_instructions?: string;
timestamp?: number;
+ output_format?: string | OutputFormat;
}
export interface ProjectOptions {
fields?: string[];
}
+export enum OutputFormat {
+ V1 = "v1.0",
+ V1_1 = "v1.1",
+}
+
export enum API_VERSION {
V1 = "v1",
V2 = "v2",