AIRA Endpoint
POST /api/endpoints/aira implements AIRA, short for AI Research Automation.
What it does
The endpoint executes one step of a structured research workflow based on the current workflow state.
The current router dispatches among six core AI methods:
- Generate research goal
- Generate research strategy
- Select the next protocol
- Generate initial values for fields in the next protocol
- Generate phased research conclusion
- Generate final research conclusion
Dispatch model
The backend reads workflow_data.path_data.path_status and maps that state to the correct function.
Current statuses include:
waiting_for_research_goalwaiting_for_research_strategywaiting_for_next_protocolwaiting_for_initial_values_for_fields_in_next_protocolwaiting_for_phased_research_conclusionwaiting_for_final_research_conclusion
Each successful step returns a typed structure that appends or updates the current path data.
Core payload shape
At a high level, the request carries:
{
"model": {
"name": "..."
},
"workflow_data": {
"workflow_info": {},
"protocols_info": {},
"path_data": {
"path_status": "waiting_for_research_goal",
"steps": []
}
}
}The response is not free-form text. It is a structured state transition such as:
AddResearchGoalAddResearchStrategyAddNextProtocolAddInitialValuesForFieldsInNextProtocolAddPhasedResearchConclusionAddFinalResearchConclusion
Why it is state-driven
AIRA is not modeled as one long prompt that re-derives the entire workflow from scratch on every request. Instead, it advances an explicit workflow state.
That approach makes it easier to:
- inspect intermediate steps
- rerun or branch a workflow
- validate transitions
- build UI around the current phase
- test each step independently
The implementation lives under packages/masterbrain/src/masterbrain/endpoints/aira/.