Logo IconGuided Mind
v2.4
Memory

Short Memory Overview

Session-based conversation memory with automatic expiration for AI agents.

Short Memory provides session-based conversation context for your AI agents. It stores recent messages in Redis with automatic expiration, enabling multi-turn dialogues without manually managing conversation history.

How It Works

Short Memory acts as a temporary conversation buffer. When your agent interacts with a user, each exchange is stored against a unique session identifier. Messages expire automatically based on your configured TTL, keeping only the most relevant recent context.

Key Concepts

ConceptDescription
SessionA unique conversation identified by session_id — create one per user interaction or chat thread
TTL (Time to Live)How long messages persist after the last activity — ranges from 1 minute to 24 hours
Max MessagesHard cap on messages per session — oldest messages evicted when limit is reached
Role-based messagesEach message carries a role (user or assistant) to preserve conversation structure

Quick Start

# Add messages to a session
curl -X POST https://api.guidedmind.ai/api/v1/memory/short/messages \
-H "Content-Type: application/json" \
-H "X-Memory-Api-Key: mk_your_key_here" \
-d '{
  "session_id": "session-123",
  "messages": [
    {
      "role": "user",
      "content": "What are my recent orders?"
    }
  ]
}'

# Retrieve session messages
curl https://api.guidedmind.ai/api/v1/memory/short/messages/session-123 \
-H "X-Memory-Api-Key: mk_your_key_here"

When to Use Short Memory

  • Multi-turn chatbots — Maintain conversation context across exchanges
  • Task-based agents — Track progress within a single workflow session
  • Ephemeral interactions — When conversation history should not persist long-term
  • Token budget management — Control context window size with max messages cap

Next Steps

  • Settings — Configure project name, TTL, and message limits
  • API Setup — Generate API keys and review endpoint reference