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.

feat(ts-sdk): add support for keyword arguments in add and search methods (#3895)

Saket Aryan90a7b1afa013
diff --git a/docs/changelog.mdx b/docs/changelog.mdx
index 149788636..369813d0c 100644
--- a/docs/changelog.mdx
+++ b/docs/changelog.mdx
@@ -682,6 +682,13 @@ mode: "wide"
<Tab title="TypeScript">
+<Update label="2025-12-30" description="v2.2.1">
+
+**Improvements:**
+- **Client:** Added support for keyword arguments in `add` and `search` methods, allowing additional properties beyond defined options for experimental features
+
+</Update>
+
<Update label="2025-12-29" description="v2.2.0">
**New Features:**
diff --git a/docs/core-concepts/memory-operations/add.mdx b/docs/core-concepts/memory-operations/add.mdx
index e20086327..0dcfcad32 100644
--- a/docs/core-concepts/memory-operations/add.mdx
+++ b/docs/core-concepts/memory-operations/add.mdx
@@ -83,8 +83,7 @@ const messages = [
{ role: "assistant", content: "Great! I’ll remember that for future suggestions." }
];
-await client.add({
- messages,
+await client.add(messages, {
user_id: "alice",
version: "v2",
});
diff --git a/mem0-ts/package.json b/mem0-ts/package.json
index 7f47def4f..32d9323bf 100644
--- a/mem0-ts/package.json
+++ b/mem0-ts/package.json
@@ -1,6 +1,6 @@
{
"name": "mem0ai",
- "version": "2.2.0",
+ "version": "2.2.1",
"description": "The Memory Layer For Your AI Apps",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/mem0-ts/src/client/mem0.ts b/mem0-ts/src/client/mem0.ts
index a17355aa5..a57e3b0c5 100644
--- a/mem0-ts/src/client/mem0.ts
+++ b/mem0-ts/src/client/mem0.ts
@@ -213,7 +213,7 @@ export default class MemoryClient {
async add(
messages: Array<Message>,
- options: MemoryOptions = {},
+ options: MemoryOptions & Record<string, any> = {},
): Promise<Array<Memory>> {
if (this.telemetryId === "") await this.ping();
this._validateOrgProject();
@@ -339,7 +339,10 @@ export default class MemoryClient {
}
}
- async search(query: string, options?: SearchOptions): Promise<Array<Memory>> {
+ async search(
+ query: string,
+ options?: SearchOptions & Record<string, any>,
+ ): Promise<Array<Memory>> {
if (this.telemetryId === "") await this.ping();
this._validateOrgProject();
const payloadKeys = Object.keys(options || {});