From c0c57a9fe957bbb44ab86faa6b3fec76e7991df4 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 26 Aug 2025 15:33:51 -0700 Subject: [PATCH] includeFullDoc: true in search endpoint --- packages/ai-sdk/package.json | 2 +- packages/ai-sdk/src/tools.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/ai-sdk/package.json b/packages/ai-sdk/package.json index 43de702d..322aa1bc 100644 --- a/packages/ai-sdk/package.json +++ b/packages/ai-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@supermemory/ai-sdk", - "version": "1.0.3", + "version": "1.0.4", "scripts": { "build": "tsdown", "dev": "tsdown --watch", diff --git a/packages/ai-sdk/src/tools.ts b/packages/ai-sdk/src/tools.ts index fd78940c..652beffd 100644 --- a/packages/ai-sdk/src/tools.ts +++ b/packages/ai-sdk/src/tools.ts @@ -35,14 +35,27 @@ export function supermemoryTools( informationToGet: z .string() .describe("Terms to search for in the user's memories"), + includeFullDocs: z + .boolean() + .optional() + .default(true) + .describe( + "Whether to include the full document content in the response. Defaults to true for better AI context.", + ), + limit: z + .number() + .optional() + .default(10) + .describe("Maximum number of results to return"), }), - execute: async ({ informationToGet }) => { + execute: async ({ informationToGet, includeFullDocs = true, limit = 10 }) => { try { const response = await client.search.execute({ q: informationToGet, containerTags, - limit: 10, + limit, chunkThreshold: 0.6, + includeFullDocs, }) return {