diff options
| author | Dhravya Shah <[email protected]> | 2025-10-20 18:14:47 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-20 18:14:47 -0700 |
| commit | d9a9ce00f8f7a9c175f01bc6de69777c789e9178 (patch) | |
| tree | bbfe4d0c637c336fcb2049a0f035bfaca04af93b | |
| parent | add conversationId functionality to map to customId in ingestion (#499) (diff) | |
| parent | fix(tools): update the docs for conversational (diff) | |
| download | supermemory-d9a9ce00f8f7a9c175f01bc6de69777c789e9178.tar.xz supermemory-d9a9ce00f8f7a9c175f01bc6de69777c789e9178.zip | |
Merge pull request #501 from supermemoryai/10-19-fix_tools_update_the_docs_for_conversational
fix(tools): update the docs for conversational
| -rw-r--r-- | packages/tools/README.md | 26 | ||||
| -rw-r--r-- | packages/tools/package.json | 2 |
2 files changed, 24 insertions, 4 deletions
diff --git a/packages/tools/README.md b/packages/tools/README.md index 2b3f51d9..aae102f3 100644 --- a/packages/tools/README.md +++ b/packages/tools/README.md @@ -62,9 +62,6 @@ const addTool = addMemoryTool(process.env.SUPERMEMORY_API_KEY!, { #### AI SDK Middleware with Supermemory -> [!CAUTION] -> `withSupermemory` is in beta - - `withSupermemory` will take advantage supermemory profile v4 endpoint personalized based on container tag - Make sure you have `SUPERMEMORY_API_KEY` in env @@ -83,6 +80,27 @@ const result = await generateText({ console.log(result.text) ``` +#### Conversation Grouping + +Use the `conversationId` option to group messages into a single document for contextual memory generation: + +```typescript +import { generateText } from "ai" +import { withSupermemory } from "@supermemory/tools/ai-sdk" +import { openai } from "@ai-sdk/openai" + +const modelWithMemory = withSupermemory(openai("gpt-5"), "user_id_life", { + conversationId: "conversation-456" +}) + +const result = await generateText({ + model: modelWithMemory, + messages: [{ role: "user", content: "where do i live?" }], +}) + +console.log(result.text) +``` + #### Verbose Mode Enable verbose logging to see detailed information about memory search and transformation: @@ -280,12 +298,14 @@ The `withSupermemory` middleware accepts additional configuration options: ```typescript interface WithSupermemoryOptions { + conversationId?: string verbose?: boolean mode?: "profile" | "query" | "full" addMemory?: "always" | "never" } ``` +- **conversationId**: Optional conversation ID to group messages into a single document for contextual memory generation - **verbose**: Enable detailed logging of memory search and injection process (default: false) - **mode**: Memory search mode - "profile" (default), "query", or "full" - **addMemory**: Automatic memory storage mode - "always" or "never" (default: "never") diff --git a/packages/tools/package.json b/packages/tools/package.json index 536d7c1c..9d820ddc 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,7 +1,7 @@ { "name": "@supermemory/tools", "type": "module", - "version": "1.2.13", + "version": "1.2.15", "description": "Memory tools for AI SDK and OpenAI function calling with supermemory", "scripts": { "build": "tsdown", |