Back to Tutorials
beginner 10 min

Getting Started with Memoid

Set up your first memory-enabled AI application in under 10 minutes. Learn to install the SDK, store memories, and search them.

Prerequisites

  • A Memoid account (free tier available)
  • Basic understanding of REST APIs
  • cURL or any HTTP client

In this tutorial, you’ll learn how to set up Memoid and add memory to your first AI application.

Step 1: Create an Account

First, sign up for a free Memoid account at memoid.dev/register.

Once logged in, navigate to the Dashboard and create your first project.

Step 2: Get Your API Key

In your project settings, you’ll find your API key. Copy it — you’ll need it for the next steps.

# Your API key will look something like this:
mem_sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keep it safe! Never commit your API key to version control.

Step 3: Add Your First Memory

Store a memory from a conversation using the REST API:

curl -X POST https://api.memoid.dev/v1/memories 
  -H "Authorization: Bearer your-api-key" 
  -H "Content-Type: application/json" 
  -d '{
    "messages": [
      {"role": "user", "content": "My name is Alex and I love hiking"},
      {"role": "assistant", "content": "Nice to meet you, Alex! Hiking is great exercise."}
    ],
    "user_id": "user_123"
  }'

# Response:
# {
#   "memories": [
#     "User's name is Alex",
#     "User loves hiking"
#   ]
# }

Step 4: Search Memories

Search for relevant memories using natural language:

curl -X POST https://api.memoid.dev/v1/search 
  -H "Authorization: Bearer your-api-key" 
  -H "Content-Type: application/json" 
  -d '{
    "query": "What are the user'''s hobbies?",
    "user_id": "user_123",
    "limit": 5
  }'

# Response:
# [
#   {"memory": "User loves hiking", "score": 0.92}
# ]

Step 5: Use Memories in Your App

Here’s how you can integrate memories with any AI provider. First, fetch relevant memories:

# Get memories for context
MEMORIES=$(curl -s -X POST https://api.memoid.dev/v1/search 
  -H "Authorization: Bearer $MEMOID_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"query": "user preferences", "user_id": "user_123"}')

# Use the memories as context in your AI prompts

Then include those memories as context in your AI chat completions.

Next Steps

Congratulations! You’ve added memory to your AI application. Here’s what to explore next:

Need Help?