#!/bin/bash # SuperMemory - Chat with Memories Script # Usage: chat.sh "question" # Note: Uses search to retrieve relevant memories and presents them set -e QUESTION="$1" if [ -z "$QUESTION" ]; then echo "Error: No question provided" echo "Usage: chat.sh \"question\"" exit 1 fi API_KEY="${SUPERMEMORY_API_KEY}" if [ -z "$API_KEY" ]; then echo "Error: SUPERMEMORY_API_KEY environment variable not set" echo "Please set it with: export SUPERMEMORY_API_KEY=\"your-api-key\"" exit 1 fi # SuperMemory API search endpoint (used for chat-like queries) API_URL="https://api.supermemory.ai/v3/search" # Prepare the request DATA=$(cat </dev/null || echo "$RESPONSE"