-
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
extract_action_items() fetches up to 50 recent action items (past 2 days) for deduplication context. Each item includes description, due date, and completion status — adding thousands of input tokens per call.
File: backend/utils/conversations/process_conversation.py:87-91
existing_action_items = action_items_db.get_action_items(uid=uid, start_date=two_days_ago, limit=50)In prompt (conversation_processing.py:290-302):
existing_items_context = f"\nEXISTING ACTION ITEMS FROM PAST 2 DAYS ({len(items_list)} items):\n"Proposed Change
- Reduce limit from 50 to 10 (most recent)
- Or reduce time window from 2 days to 12 hours
- Only include pending (non-completed) items — completed items don't need dedup
Impact
- Reduces input tokens by ~500-2000 per call depending on user's action item volume
- Estimated 2-3% reduction in total costs
- Active users with many action items benefit most
Risk
Low — duplicate action items may occasionally slip through, but the LLM already handles near-duplicate detection. 10 recent items should catch the vast majority of duplicates.
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)