Supermemory

Supermemory

Supermemory는 AI 애플리케이션에 지속적이고 스스로 성장하는 메모리를 추가하는 장기 메모리 플랫폼이에요. AI SDK용 Supermemory 프로바이더는 인간의 뇌처럼 동작하는 메모리를 갖춘 AI 애플리케이션을 만들 수 있게 해줘요:

  • 영구 메모리: 상호작용마다 성장하는 장기 저장소
  • 시맨틱 검색: 자연어 쿼리로 관련 메모리 찾기
  • 자동 메모리 관리: AI가 관련 정보를 자동으로 저장하고 검색
  • 쉬운 통합: 기존 AI SDK 애플리케이션과 간단한 설정
  • 메모리 라우터: 언어 모델 프로바이더와 직접 통합
  • 무료 티어 제공: 무료 API 키로 시작하기

Supermemory의 기능에 대해 더 알아보려면 Supermemory Documentation을 참고하세요.

출처: 문서

본문

설정

Supermemory 프로바이더는 @supermemory/tools 모듈에서 사용할 수 있어요. 다음과 같이 설치할 수 있어요:

npm install @supermemory/tools

프로바이더 인스턴스

Supermemory API 키는 https://console.supermemory.ai에서 무료로 얻을 수 있어요.

Supermemory를 AI 애플리케이션과 통합하는 방법은 두 가지가 있어요:

1. Supermemory Tools 사용

기존 AI SDK 설정과 함께 Supermemory 도구를 import 해서 사용해요:

import { supermemoryTools } from '@supermemory/tools/ai-sdk';

2. Memory Router 사용

언어 모델 프로바이더와 직접 통합하려면 Memory Router를 사용해요:

import { createAnthropic } from '@ai-sdk/anthropic';

const supermemoryRouter = createAnthropic({
  baseUrl: 'https://api.supermemory.ai/v3/https://api.anthropic.com/v1',
  apiKey: 'your-...ey',
  headers: {
    'x-supermemory-api-key': 'supermemory-api-key',
    'x-sm-conversation-id': 'conversation-id',
  },
});

예시

AI SDK와 함께 Supermemory를 사용하는 예시들이에요:

generateText with Tools

import { generateText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import { supermemoryTools } from '@supermemory/tools/ai-sdk';

const openai = createOpenAI({
  apiKey: 'YOUR_...EY',
});

const { text } = await generateText({
  model: openai('gpt-5-mini'),
  prompt: 'Remember that my name is Alice',
  tools: supermemoryTools('YOUR_SUPERMEMORY_KEY'),
});

console.log(text);

streamText with Automatic Memory

import { streamText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import { supermemoryTools } from '@supermemory/tools/ai-sdk';

const openai = createOpenAI({
  apiKey: 'YOUR_...EY',
});

const result = streamText({
  model: openai('gpt-5'),
  prompt: 'What are my dietary preferences?',
  tools: supermemoryTools('YOUR_SUPERMEMORY_KEY'),
});

// The AI will automatically call searchMemories tool
// Example tool call:
// searchMemories({ informationToGet: "dietary preferences and restrictions" })
// OR
// addMemory({ memory: "User is allergic to peanuts" })

for await (const chunk of result.textStream) {
  console.log(chunk);
}

Memory Router 사용

import { streamText } from 'ai';
import { createAnthropic } from '@ai-sdk/anthropic';

const supermemoryRouter = createAnthropic({
  baseUrl: 'https://api.supermemory.ai/v3/https://api.anthropic.com/v1',
  apiKey: 'your-...ey',
  headers: {
    'x-supermemory-api-key': 'supermemory-api-key',
    'x-sm-conversation-id': 'conversation-id',
  },
});

const result = streamText({
  model: supermemoryRouter('claude-3-sonnet'),
  messages: [
    { role: 'user', content: 'Hello! Remember that I love TypeScript.' },
  ],
});

이 기능들과 고급 설정 옵션에 대한 자세한 내용은 Supermemory Documentation을 방문하세요.

추가 자료

더 알아보기 (Learn more)