RocketChat/Rocket.Chat · warning
AI search request failed
Error message
AI search request failed
What it means
After AISearch.status() reported intelligent search available, the actual intelligent-search request itself threw. The endpoint logs this warning, resets intelligentResults to an empty array, and still returns HTTP success with the non-intelligent results plus meta flags — so the AI portion fails silently for the caller unless it checks the intelligent array and meta fields.
Source
Thrown at apps/meteor/server/api/v1/ai-search.ts:289
aiSearchStatus.intelligentSearchConfigured
) {
try {
intelligentResults = await AISearch.search({
query,
userId: this.userId,
filters: {
rid,
rids,
roomNames,
fromUsername,
fromUsernames,
startDate: startDate?.toISOString(),
endDate: endDate?.toISOString(),
},
limit: intelligentLimit,
});
} catch (error) {
this.logger.warn({ msg: 'AI search request failed', err: error });
intelligentResults = [];
}
}
return API.v1.success({
intelligent: intelligentResults,
meta: {
intelligentSearchEnabled: aiSearchStatus.intelligentSearchEnabled,
intelligentSearchConfigured: aiSearchStatus.intelligentSearchConfigured,
answerGenerationConfigured: aiSearchStatus.answerGenerationConfigured,
},
});
},
);
API.v1.get(
'ai.llm.models',
{View on GitHub (pinned to b2c16d5842)
Solutions
- Read the err from the log entry — it distinguishes provider auth/rate-limit errors from OpenSearch/index errors
- Check AI provider credentials and quota if the error is 401/429 from the provider
- Check search backend health and that the workspace index exists and is not mid-rebuild
- Narrow the query (fewer rooms, smaller date window) to rule out timeouts
- In clients, treat an empty intelligent array as degraded output instead of 'no results'
Defensive patterns
Strategy: fallback
Validate before calling
// server-side guard: only call the intelligent pipeline when status is green
if (!aiSearchStatus.hasIntelligentSearchLicense || !aiSearchStatus.intelligentSearchEnabled || !aiSearchStatus.intelligentSearchConfigured) {
return API.v1.success({ intelligent: [], meta: { ...aiSearchStatus } });
} Try / catch
let intelligentResults: AISearchResult[] = [];
try {
intelligentResults = await runIntelligentSearch(query, { limit: intelligentLimit });
} catch (error) {
this.logger.warn({ msg: 'AI search request failed', err: error });
intelligentResults = []; // degrade to normal search, still return success
} Prevention
- Monitor and alert on the warn's err field to catch expired AI provider keys before users notice
- Keep the search index healthy; reindex during maintenance windows
- Include the meta flags in client telemetry so silent degradation is measurable
When it happens
Trigger: The search pipeline (OpenSearch/vector store) erroring on this specific query: missing or rebuilding index, embedding/LLM provider returning 4xx/5xx or timing out, invalid combinations of filters (rid/roomNames/fromUsername/date ranges) the backend rejects, or result size beyond limits.
Common situations: OpenSearch index being reindexed; AI provider API key expired or rate-limited; very wide date ranges or many rooms making the query slow enough to hit timeouts; status() passing but the query path misconfigured.
Related errors
- AI search status unavailable
- error-roomId-param-not-provided
- error-searchText-param-not-provided
- Room not found
- error-abac-attribute-store-external
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/449189f0dec94b97.
Report an issue: GitHub.