Logo IconGuided Mind
v2.4
Memory

Long Memory — API Setup

Generate API keys and integrate with long memory endpoints.

The API Setup tab provides your authentication credentials and endpoint reference for integrating long memory into your application.

API Key

Your API key authenticates all requests to the long memory API. Keys are prefixed with mk_ to distinguish them from RAG project keys.

Key management:

  • View key — Display your current API key (shown only once during creation)
  • Copy key — Copy to clipboard for immediate use
  • Regenerate — Create a new key and invalidate the previous one

Security: Store your API key in environment variables or a secrets manager. Never commit keys to version control or expose them in client-side code.

Authentication

All requests require the X-Memory-Api-Key header:

X-Memory-Api-Key: mk_your_key_here

Endpoints

Store Memory

Store a new long-term memory record.

curl -X POST https://api.guidedmind.ai/api/v1/memory/long/store \
-H "Content-Type: application/json" \
-H "X-Memory-Api-Key: mk_your_key_here" \
-d '{
  "user_id": "user-456",
  "role": "user",
  "content": "I prefer the Professional plan at $199/month",
  "session_id": "session-789",
  "metadata": {"category": "pricing_preference"}
}'

Response:

{
  "record_id": "mem_abc123",
  "user_id": "user-456",
  "status": "stored"
}

Search Memories

Perform semantic search across stored memories.

curl -X POST https://api.guidedmind.ai/api/v1/memory/long/search \
-H "Content-Type: application/json" \
-H "X-Memory-Api-Key: mk_your_key_here" \
-d '{
  "query": "What plan does the user prefer?",
  "external_user_id": "user-456",
  "limit": 10,
  "offset": 0,
  "threshold": 0.7
}'

Response:

{
  "results": [
    {
      "record_id": "mem_abc123",
      "content": "I prefer the Professional plan at $199/month",
      "score": 0.92,
      "metadata": {"category": "pricing_preference"},
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}

Search Parameters

ParameterTypeDefaultDescription
querystringrequiredSearch query string — semantically matched against stored memories
external_user_idstringrequiredFilter results to a specific user
limitinteger20Maximum results to return
offsetinteger0Pagination offset
thresholdfloat0.7Minimum similarity score — higher values return fewer, more relevant results

Error Responses

StatusMeaning
401Invalid or missing API key
404Project not found or disabled
429Rate limit exceeded
500Internal server error

SDK Installation

pip install guidedmind-rag-sdk-python

Next Steps

Your long memory project is ready. Start storing and searching persistent conversation memory in your AI agent.