-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
intelligenceLayer: Summaries, insights, action itemsLayer: Summaries, insights, action itemsmaintainerLane: High-risk, cross-system changesLane: High-risk, cross-system changesp2Priority: Important (score 14-21)Priority: Important (score 14-21)
Description
Parent: #4635
Problem
_trigger_apps() always calls get_suggested_apps_for_conversation() (LLM call) even when the user already has a preferred_app_id set in Redis. The suggestion result is stored but never used.
File: backend/utils/conversations/process_conversation.py:300-326
# Always runs suggestion first
if not conversation.suggested_summarization_apps:
with track_usage(uid, Features.CONVERSATION_APPS):
suggested_apps, reasoning = get_suggested_apps_for_conversation(...)
# Then checks preferred app anyway
preferred_app_id = redis_db.get_user_preferred_app(uid)
if preferred_app_id and preferred_app_id in all_apps_dict:
app_to_run = all_apps_dict.get(preferred_app_id) # Uses this, ignoring suggestionProposed Change
Check for preferred app FIRST. If user has one, skip the suggestion LLM call entirely.
# Check preferred app first
preferred_app_id = redis_db.get_user_preferred_app(uid)
if preferred_app_id and preferred_app_id in all_apps_dict:
app_to_run = all_apps_dict[preferred_app_id]
else:
# Only suggest if no preferred app
if not conversation.suggested_summarization_apps:
suggested_apps, reasoning = get_suggested_apps_for_conversation(...)Impact
- Eliminates 1 LLM call per conversation for users with preferred apps
- Estimated 2-3% reduction in total costs
- Uses
llm_miniso cost per call is small, but volume is high
Risk
Low — suggested_summarization_apps field won't be populated for these users, but it's unused when preferred app is set.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
intelligenceLayer: Summaries, insights, action itemsLayer: Summaries, insights, action itemsmaintainerLane: High-risk, cross-system changesLane: High-risk, cross-system changesp2Priority: Important (score 14-21)Priority: Important (score 14-21)