mem0ai/mem0 · error · ImportError

The 'groq' library is required. Please install it using 'pip

Error message

The 'groq' library is required. Please install it using 'pip install groq'.

What it means

Error "The 'groq' library is required. Please install it using 'pip install groq'." thrown in mem0ai/mem0.

Source

Thrown at mem0/llms/groq.py:9

import json
import logging
import os
from typing import Dict, List, Optional, Union

try:
    from groq import Groq
except ImportError:
    raise ImportError("The 'groq' library is required. Please install it using 'pip install groq'.")

from mem0.configs.llms.base import BaseLlmConfig
from mem0.llms.base import LLMBase
from mem0.memory.utils import extract_json

logger = logging.getLogger(__name__)


class GroqLLM(LLMBase):
    def __init__(self, config: Optional[BaseLlmConfig] = None):
        super().__init__(config)

        if not self.config.model:
            self.config.model = "llama-3.3-70b-versatile"

        api_key = self.config.api_key or os.getenv("GROQ_API_KEY")
        self.client = Groq(api_key=api_key)

View on GitHub (pinned to 001c235229)

Solutions

  1. Install the dependency: pip install groq.

When it happens

Trigger: Thrown at mem0/llms/groq.py:9 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/7b4c30bcc81fd421. Report an issue: GitHub.