Skip to content

Guides

Best Practices

Guidelines for production use.

Memory Content

  • Write memories as complete sentences — embedding quality is better with context
  • Include relevant metadata (domain, source, task type) for filtering
  • Use userId to scope memories per user within your tenant
  • Keep content under 8,000 characters — longer content is truncated before embedding

Provider Selection

  • Start with Gemini for free unlimited embeddings during development
  • Use OpenAI text-embedding-3-small at 1024d for production — best quality/cost balance
  • Use Cohere embed-v4.0 as a fallback — good quality at 1024d
  • Set your dimension to 1024 for maximum provider compatibility

Search Strategy

  • semantic — default for multi-tenant, uses vector similarity
  • Always include userId in search filters for user-scoped results
  • Use limit: 5-10 for most queries — more results add noise

Security

  • Never expose your MetaMemory API key in client-side code
  • Provider keys are encrypted at rest with AES-256-GCM
  • Each sign-in rotates your API key — update integrations after re-login
  • Use header passthrough (X-Provider-Key) for per-request key override in testing