RocketChat/Rocket.Chat · error · Meteor.Error

error-ai-not-enabled

error-ai-not-enabled

Error message

error-ai-not-enabled

What it means

Returned by POST ai.search.answer when intelligent search is not fully operational: the workspace lacks the Intelligent Search license, the intelligentSearchEnabled setting is off, or no answer generation provider is configured. The check runs before any message lookup so unlicensed workspaces cannot use the endpoint to probe message data.

Source

Thrown at apps/meteor/server/api/v1/ai-search.ts:360

			intervalTimeInMS: 60000,
		},
		response: {
			200: searchAnswerResponseSchema,
			400: validateBadRequestErrorResponse,
			401: validateUnauthorizedErrorResponse,
		},
	},
	async function action() {
		const { query, messages } = this.bodyParams;

		// gate before any DB work so users cannot drive message lookups for an unlicensed feature
		const aiSearchStatus = await AISearch.status();
		if (
			!aiSearchStatus.hasIntelligentSearchLicense ||
			!aiSearchStatus.intelligentSearchEnabled ||
			!aiSearchStatus.answerGenerationConfigured
		) {
			throw new Meteor.Error('error-ai-not-enabled');
		}

		const answerMessages = await getSearchAnswerMessagesForUser(this.userId, messages);
		try {
			const answer = await AISearch.answer({
				query,
				messages: answerMessages,
			});

			return API.v1.success(answer);
		} catch (error) {
			const message = error instanceof Error ? error.message : '';
			if (message === 'error-ai-not-enabled') {
				throw new Meteor.Error('error-ai-not-enabled');
			}
			if (message === 'error-ai-provider-not-configured') {
				throw new Meteor.Error('error-ai-provider-not-configured');
			}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Check the license includes Intelligent Search and is active (Administration > License)
  2. Enable the intelligent search / AI settings in Administration > AI
  3. Configure the answer-generation LLM provider (Administration > AI > answer generation) and verify with GET ai.llm.models
  4. Cache the AISearch.status flags client-side and hide the answer UI when any of the three gates is false

Example fix

// before
const answer = await POST('/api/v1/ai.search.answer', { query, messages });

// after
const status = await GET('/api/v1/ai.status'); // hasIntelligentSearchLicense / intelligentSearchEnabled / answerGenerationConfigured
if (!status.hasIntelligentSearchLicense || !status.intelligentSearchEnabled || !status.answerGenerationConfigured) {
  throw new Error('AI answers unavailable on this workspace');
}
const answer = await POST('/api/v1/ai.search.answer', { query, messages });
Defensive patterns

Strategy: type-guard

Validate before calling

const status = await GET('/api/v1/ai.status');
const answerReady = status.hasIntelligentSearchLicense && status.intelligentSearchEnabled && status.answerGenerationConfigured;

Type guard

const isAnswerGenerationReady = (s: AISearchStatus): boolean =>
  Boolean(s.hasIntelligentSearchLicense && s.intelligentSearchEnabled && s.answerGenerationConfigured);

Try / catch

try { /* ai.search.answer */ } catch (e) {
  if (e.error === 'error-ai-not-enabled') { /* hide answer UI: feature unavailable */ }
}

Prevention

When it happens

Trigger: POST /api/v1/ai.search.answer on a workspace without an Enterprise license covering intelligent search; with the AI features disabled by the admin; or with the LLM provider for answer generation unset. Also occurs in dev/test environments that never configured AI.

Common situations: Trial or Community license without AI entitlement; admin disabled AI after a policy change; provider was configured for embeddings but not for answer generation; environment variables for the AI gateway are missing after a migration.

Related errors


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