Skip to content

Instantly share code, notes, and snippets.

View MaheshtheDev's full-sized avatar
🎯
Building Stuff

Mahesh Sanikommu MaheshtheDev

🎯
Building Stuff
View GitHub Profile
@MaheshtheDev
MaheshtheDev / openai-supermemory-router.py
Created October 28, 2025 04:05
supermemory memory router usage with openai with image
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"
}
)
@MaheshtheDev
MaheshtheDev / supermemory-multi-step-agent-example.ts
Created October 21, 2025 23:33
This example demonstrates how to build a multi-step agent using withSupermemory with AI SDK's agentic workflow capabilities
#!/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