
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@supermemory/tools
Advanced tools
Memory tools for AI SDK and OpenAI function calling with supermemory
Memory tools for AI SDK and OpenAI function calling with supermemory.
This package provides supermemory tools for both AI SDK and OpenAI function calling through dedicated submodule exports, each with function-based architectures optimized for their respective use cases.
npm install @supermemory/tools
# or
bun add @supermemory/tools
# or
pnpm add @supermemory/tools
# or
yarn add @supermemory/tools
The package provides two submodule imports:
@supermemory/tools/ai-sdk
- For use with the AI SDK framework@supermemory/tools/openai
- For use with OpenAI's function callingimport { supermemoryTools, searchMemoriesTool, addMemoryTool } from "@supermemory/tools/ai-sdk"
import { createOpenAI } from "@ai-sdk/openai"
import { generateText } from "ai"
const openai = createOpenAI({
apiKey: process.env.OPENAI_API_KEY!,
})
// Create all tools
const tools = supermemoryTools(process.env.SUPERMEMORY_API_KEY!, {
projectId: "your-project-id",
})
// Use with AI SDK
const result = await generateText({
model: openai("gpt-4"),
messages: [
{
role: "user",
content: "What do you remember about my preferences?",
},
],
tools,
})
// Or create individual tools
const searchTool = searchMemoriesTool(process.env.SUPERMEMORY_API_KEY!, {
projectId: "your-project-id",
})
const addTool = addMemoryTool(process.env.SUPERMEMORY_API_KEY!, {
projectId: "your-project-id",
})
import { supermemoryTools, getToolDefinitions, createToolCallExecutor } from "@supermemory/tools/openai"
import OpenAI from "openai"
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY!,
})
// Get tool definitions for OpenAI
const toolDefinitions = getToolDefinitions()
// Create tool executor
const executeToolCall = createToolCallExecutor(process.env.SUPERMEMORY_API_KEY!, {
projectId: "your-project-id",
})
// Use with OpenAI Chat Completions
const completion = await client.chat.completions.create({
model: "gpt-4",
messages: [
{
role: "user",
content: "What do you remember about my preferences?",
},
],
tools: toolDefinitions,
})
// Execute tool calls if any
if (completion.choices[0]?.message.tool_calls) {
for (const toolCall of completion.choices[0].message.tool_calls) {
const result = await executeToolCall(toolCall)
console.log(result)
}
}
// Or create individual function-based tools
const tools = supermemoryTools(process.env.SUPERMEMORY_API_KEY!, {
projectId: "your-project-id",
})
const searchResult = await tools.searchMemories({
informationToGet: "user preferences",
limit: 10,
})
const addResult = await tools.addMemory({
memory: "User prefers dark roast coffee",
})
Both modules accept the same configuration interface:
interface SupermemoryToolsConfig {
baseUrl?: string
containerTags?: string[]
projectId?: string
}
Searches through stored memories based on a query string.
Parameters:
informationToGet
(string): Terms to search forincludeFullDocs
(boolean, optional): Whether to include full document content (default: true)limit
(number, optional): Maximum number of results (default: 10)Adds a new memory to the system.
Parameters:
memory
(string): The content to rememberSUPERMEMORY_API_KEY=your_supermemory_api_key
SUPERMEMORY_BASE_URL=https://your-custom-url # optional
FAQs
Memory tools for AI SDK and OpenAI function calling with supermemory
The npm package @supermemory/tools receives a total of 289 weekly downloads. As such, @supermemory/tools popularity was classified as not popular.
We found that @supermemory/tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.