Context Detection

Smart tools detect context from the query and auto-select appropriate data sources and analysis methods. Three contexts: MATCH (Babolat + Zepp2), PRACTICE (Zepp Universal), LAB (Apple Watch + Zepp linked).

smart_analyze

Purpose: Context-aware analysis that adapts to match, practice, or lab context.

MATCH context: Fatigue by quarter, HR by outcome, PIQ trends

PRACTICE context: Session fatigue, patterns, drill detection

LAB context: Classification accuracy, sensor comparison

Parameters: analysis_type (fatigue, classification, patterns, hr, training, quality), shot_type, year, date

smart_compare

Purpose: Context-aware cross-sensor comparisons.

MATCH context: Zepp2 vs Babolat accuracy

LAB context: Apple Watch vs Zepp detection accuracy

Parameters: compare_type (sensors, sessions, practice_match, detection, fusion), primary sensor, secondary sensor, date

smart_query

Purpose: Context-aware session and count queries that auto-select data source.

MATCH context: Uses Babolat + Zepp2 data

PRACTICE context: Uses Zepp Universal data

LAB context: Uses Apple Watch + Zepp linked sessions

Parameters: query_type (count, latest, inventory, linked, sessions), sensor, year, month, date_range

smart_visualize

Purpose: Context-aware visualizations adapted to context.

MATCH context: PIQ trends, match timeline, HR overlay

PRACTICE context: Power trends, training dashboard, impact zones

LAB context: Waveforms, 3D trajectory, sensor comparison

Parameters: viz_type (trend, timeline, dashboard, impact, waveform, 3d, heatmap), data_source, date, shot_type

smart_practice

Purpose: Practice planning and DOE experiments. Only for PRACTICE/LAB contexts.

Actions: create_plan, create_doe, track, analyze, visualize

Focus types: max_topspin, max_power, speed_ladder, sweet_spot

Parameters: action, plan_type (practice, doe, focused), focus, session_date, sequence

Context Detection Logic

Context Trigger Keywords Data Sources
MATCH match, tournament, opponent, win, loss, PIQ Babolat PIQ, Zepp2, Garmin HR
PRACTICE practice, session, drill, training, swings Zepp Universal, Garmin HR
LAB linked, Apple Watch, wrist, trajectory, calibrate Apple Watch, Zepp Universal, linked sessions

Example Queries

Query Detected Context Smart Tool
"analyze fatigue in my latest match" MATCH smart_analyze (fatigue)
"compare Zepp vs Babolat accuracy" MATCH smart_compare (sensors)
"show power trend for practice" PRACTICE smart_visualize (trend)
"how many linked sessions in 2024" LAB smart_query (count)
"create serve DOE experiment" PRACTICE smart_practice (create_doe)

Fallback Behavior

When context cannot be detected from the query, smart tools prompt for clarification or default to the most likely context based on available data. The original_query parameter preserves the natural language query for context detection.