Merge pull request #501 from supermemoryai/10-19-fix_tools_update_the_docs_for_conversational

fix(tools): update the docs for conversational
This commit is contained in:
Dhravya Shah 2025-10-20 18:14:47 -07:00 • committed by GitHub
commit d9a9ce00f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 4 deletions

View file

@ -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")

View file

@ -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",