-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Implement Athena Decision Service integration in the Agent (not backend). This follows the separation of concerns principle where:
- Backend handles recommendations (ML predictions stored and routed via SSE)
- Agent handles instructions (user confirmation, conversion to microscope format, execution via AthenaAPI)
Background
PR #190 originally implemented Athena integration in the backend (consumer.py), which violated the architectural boundary. That approach was removed. This issue captures the correct agent-side approach.
Implementation Notes
Decision Type Mapping
- Grid square predictions →
DecisionType.GRID_SQUARE_SELECTION - Foil hole predictions →
DecisionType.FOIL_HOLE_SELECTION - Decision value: "true" if prediction > 0.5, else "false"
- Details field: include prediction value and model name
Bulk vs Single Requests
- Single foilhole: Use
POST /api/v1/Decision - Multiple foilholes: Use
POST /api/v1/Decisions(bulk endpoint) - Reason: Prevents microscope blocking - sequential decisions would cause the microscope to process the first and block subsequent ones
Plugin Configuration
- Use
PluginType.CUSTOM decidedBy: "smartem_ml_model"
User Confirmation Modes
The agent should support three modes:
- Auto-accept: Automatically forward all recommendations as instructions
- Manual confirm: Present each recommendation to user for approval
- Observe only: Display recommendations but user takes manual action outside system
Tasks
- Add recommendation instruction handlers to agent (
fs_watcher.py) - Create Athena handler module for decision conversion and submission
- Implement user confirmation flow (3 modes)
- Connect to AthenaAPI for actual instruction submission
- Add configuration for user confirmation mode
- Test with Athena mock server
Related
- PR Athena Decision Service integration #190 (cleaned up backend-side integration)
src/athena_api/client.py-record_decisions()bulk method already available
Metadata
Metadata
Assignees
Labels
No labels