RocketChat/Rocket.Chat · error · Error

error-ai-not-enabled

Error message

error-ai-not-enabled

What it means

Thrown by the AI search service's answer() method when answer generation cannot run: the workspace lacks the intelligent-search license module, or AI_Intelligent_Search_Enabled / AI_Intelligent_Search_Answer_Enabled is not exactly true, or no search pipeline is configured. It is a plain Error whose message is the machine-readable code 'error-ai-not-enabled'.

Source

Thrown at apps/meteor/server/services/ai-search/service.ts:390

			pipelineFilters,
			limit,
			fetch: fetchWithSsrfValidation,
			logger,
		});

		return this.normalizeIntelligentResults(json, userId, limit);
	}

	async answer({ query, messages }: { query: string; messages: AISearchAnswerMessage[] }): Promise<AISearchAnswerResult> {
		const hasIntelligentSearchLicense = await License.hasModule(AI_LICENSE_MODULE);
		const intelligentSearchEnabled = settings.get<boolean>('AI_Intelligent_Search_Enabled');
		const answerGenerationEnabled = settings.get<boolean>('AI_Intelligent_Search_Answer_Enabled');
		const pipelineConfig = this.getPipelineConfig();
		const provider = this.getAnswerProviderConfig();
		const systemPromptSetting = settings.get<string>('AI_Intelligent_Search_Answer_System_Prompt');

		if (!hasIntelligentSearchLicense || intelligentSearchEnabled !== true || answerGenerationEnabled !== true || !pipelineConfig) {
			throw new Error('error-ai-not-enabled');
		}

		if (!provider) {
			throw new Error('error-ai-provider-not-configured');
		}

		const systemPrompt = asString(systemPromptSetting);

		const sanitizedMessages: SearchAnswerMessage[] = messages.map(({ text, username, roomName, ts, score }) => ({
			text,
			username,
			roomName,
			ts,
			score,
		}));

		return generateOpenAICompatibleSearchAnswer({
			query,

View on GitHub (pinned to 2a7de45707)

Solutions

  1. Install/activate an Enterprise license that includes the AI intelligent-search module
  2. Enable both settings: AI_Intelligent_Search_Enabled and AI_Intelligent_Search_Answer_Enabled
  3. Configure the search pipeline (getPipelineConfig must return a config) and retry
Defensive patterns

Strategy: try-catch

Validate before calling

const enabled = await License.hasModule(AI_LICENSE_MODULE)
  && settings.get('AI_Intelligent_Search_Enabled') === true
  && settings.get('AI_Intelligent_Search_Answer_Enabled') === true
  && Boolean(getPipelineConfig());
if (!enabled) { /* hide answer UI */ }

Type guard

function aiAnswerAvailable(cfg: { licensed: boolean; searchEnabled: boolean; answerEnabled: boolean; pipeline: unknown }): boolean {
  return cfg.licensed && cfg.searchEnabled && cfg.answerEnabled && Boolean(cfg.pipeline);
}

Try / catch

try { await aiSearch.answer({ query, messages }); } catch (e) { if (e.message === 'error-ai-not-enabled') { /* degrade to plain search results */ } else throw e; }

Prevention

When it happens

Trigger: Calling aiSearch.answer(...) on Community/Enterprise without the AI license; license present but the two admin toggles left off; pipeline configuration (getPipelineConfig()) missing so there is nothing to source candidate messages from.

Common situations: Enabling an AI app on a workspace whose license does not include intelligent search; toggling the feature off mid-session while clients keep calling answer; fresh installs where the AI settings were never configured.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@2a7de45707 (2026-08-18). Data as JSON: /api/errors/c9d70c4c85d77546. Report an issue: GitHub.