diff options
| author | Dhravya Shah <[email protected]> | 2025-08-26 15:33:51 -0700 |
|---|---|---|
| committer | Dhravya Shah <[email protected]> | 2025-08-26 15:33:51 -0700 |
| commit | c0c57a9fe957bbb44ab86faa6b3fec76e7991df4 (patch) | |
| tree | 56e675af4083bd9797f7f5c78b3f25ca41670ae7 | |
| parent | fix: redeploy (diff) | |
| download | supermemory-c0c57a9fe957bbb44ab86faa6b3fec76e7991df4.tar.xz supermemory-c0c57a9fe957bbb44ab86faa6b3fec76e7991df4.zip | |
includeFullDoc: true in search endpoint
| -rw-r--r-- | packages/ai-sdk/package.json | 2 | ||||
| -rw-r--r-- | 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 { |