Skip to main content
This page provides comprehensive examples of using Supermemory with the Vercel AI SDK, covering Memory Tools and User Profiles approaches.

Personal Assistant with Memory Tools

Build an AI assistant that remembers user preferences and past interactions:
Example conversation:
  • User: “I’m allergic to peanuts and I love Italian food”
  • AI: Uses addMemory tool “I’ve remembered that you’re allergic to peanuts and love Italian food!”
  • User: “Suggest a restaurant for dinner”
  • AI: Uses searchMemories tool “Based on what I know about you, I’d recommend an Italian restaurant that’s peanut-free…”

Customer Support with Context

Build a customer support system that remembers customer history:

Multi-User Learning Assistant

Build an assistant that learns from multiple users but keeps data separate:

Research Assistant with File Processing

Combine file upload with memory tools for research assistance:

Code Assistant with Project Memory

Create a coding assistant that remembers your codebase and preferences:

Advanced: Custom Tool Integration

Combine Supermemory tools with your own custom tools:

Environment Setup

For all examples, ensure you have these environment variables:
.env.local

Best Practices

Memory Tools

  • Use descriptive memory content for better search results
  • Include context in your system prompts about when to use each tool
  • Use project headers to separate different use cases
  • Implement error handling for tool failures

General Tips

  • Start with simple examples and gradually add complexity
  • Use the search functionality to avoid duplicate memories
  • Implement proper authentication for production use
  • Consider rate limiting for high-volume applications

Next Steps

Memory API

Advanced memory management with full API control

User Profiles

Automatic personalization with user profiles