This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from openai import OpenAI | |
| client = OpenAI( | |
| api_key="openai-sdk", | |
| base_url="https://api.supermemory.ai/v3/https://api.openai.com/v1/", | |
| default_headers={ | |
| "x-supermemory-api-key": "supermemory_api_key", | |
| "x-sm-user-id": "user_id_life" | |
| } | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bun | |
| /** | |
| * Multi-Step Agent with Memory Example | |
| * | |
| * This example demonstrates how to build a multi-step agent using withSupermemory | |
| * with AI SDK's agentic workflow capabilities (maxSteps, stopWhen, tool calling). | |
| * | |
| * The agent can: | |
| * - Access user's past memories automatically via withSupermemory middleware | |
| * - Break down complex tasks into multiple reasoning steps |