Autopilot
AutopilotService is Nuru, the agent that runs a business's back office in the background and asks a person only to approve. See docs/adr/0066-autopilot-foundations.md.
Phase 0 lays the groundwork. A built-in connector reads each business's change feed (sales, payments, stock levels, timecards and the rest), keeps daily signal counts, and gathers agent actions from what Lumora already drafts or notices: forecast purchase orders and schedules, stock findings and alerts. Every action and what happened to it is recorded, so the approval rate, edit rate and time to act can be measured from the start.
Reading needs reports.view, inventory.manage or shifts.manage; acting on an action needs the permission its kind needs (inventory.manage for purchase orders and stock findings, shifts.manage for schedules, reports.view for alerts); changing autonomy needs settings.manage.
GetAutopilot#
GetAutopilot is whether Nuru runs for the business, its autonomy per kind, what is waiting, and what the connector last saw.
Request body
No fields: send {}.
Response
onbooleanreasonstringWhy it is off: platform_off, business_off, not_in_plan, addon_needed or canceled.
messagestringagentNamestringagent_nameThe agent's name: Nuru.
autonomyAutonomy[]openActionsint64 stringopen_actionsOpen actions the caller can see.
lastCollectedAtstringlast_collected_atRFC 3339; empty before the connector's first round.
lastChangeAtstringlast_change_atChanges the connector read today across the caller's locations, by entity (order, payment, stock_level, timecard, ...).
weekWeekTallyWhat was done for the business in the last 7 days.
waitingKindTally[]Open actions the caller can see, per kind.
setupSetupStep[]Getting Nuru ready (ADR 80): what it needs from the business to be useful, in order, each done or not.
curl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/GetAutopilot \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"on": false,
"reason": "",
"message": "",
"agentName": "Amina Mushi",
"autonomy": [
{
"kind": "",
"label": "",
"mode": "",
"modes": [
""
]
}
],
"openActions": "0",
"lastCollectedAt": "",
"lastChangeAt": "",
"signalsToday": [
{
"entity": "",
"changes": "0"
}
],
"week": {
"done": "0",
"amount": "150000",
"minutesSaved": "0"
},
"waiting": [
{
"kind": "",
"label": "",
"count": 1,
"amount": "150000"
}
],
"setup": [
{
"key": "",
"title": "",
"detail": "",
"done": false,
"href": "",
"optional": false
}
]
}UpdateAutonomy#
UpdateAutonomy sets how far Nuru may go on its own for one kind.
Request body
kindstringmodestringResponse
autonomyAutonomy[]curl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/UpdateAutonomy \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"autonomy": [
{
"kind": "",
"label": "",
"mode": "",
"modes": [
""
]
}
]
}ListAgentActions#
ListAgentActions lists actions, newest first.
Request body
locationIdstringlocation_idEmpty for every location the caller can see.
statusesstring[]Empty for every status; else open, approved, dismissed, applied, undone or expired.
kindsstring[]Empty for every kind.
limitintegerAt most 200; 50 when unset.
cursorstringThe next_cursor of the page before.
Response
actionsAgentAction[]nextCursorstringnext_cursorcurl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/ListAgentActions \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"statuses": [
""
],
"kinds": [
""
]
}'{
"actions": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"kind": "",
"subject": "",
"source": "",
"sourceId": "",
"severity": "",
"title": "",
"detail": "",
"basis": "",
"amount": "150000",
"link": "",
"changeJson": "",
"status": "",
"edited": false,
"decidedVia": "",
"decidedBy": "",
"decidedAt": "",
"note": "",
"createdAt": "",
"lastSeenAt": "",
"outcome": "",
"aboutMemberIds": [
""
]
}
],
"nextCursor": ""
}ActOnAgentAction#
ActOnAgentAction approves, dismisses, undoes or marks seen one action. Approving carries the action out where it lives: the purchase order is sent to its vendor, the week's shifts are published, the stock finding is resolved, the alert is cleared. Undo reopens a finding; a sent order or published week is changed from its own page.
Request body
idstringactionstringapprove, dismiss, undo or seen. A staff integrity case is never approved or dismissed: it is reviewed with fine, coaching, escalate or confirm, each but fine with a note.
editedbooleanThe person changed the draft before approving.
notestringResponse
actionAgentActioncurl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/ActOnAgentAction \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"action": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"kind": "",
"subject": "",
"source": "",
"sourceId": "",
"severity": "",
"title": "",
"detail": "",
"basis": "",
"amount": "150000",
"link": "",
"changeJson": "",
"status": "",
"edited": false,
"decidedVia": "",
"decidedBy": "",
"decidedAt": "",
"note": "",
"createdAt": "",
"lastSeenAt": "",
"outcome": "",
"aboutMemberIds": [
""
]
}
}GetAutopilotMetrics#
GetAutopilotMetrics is how people responded to Nuru over a period: per kind and overall, how many were approved, edited, dismissed or left, and how long people took.
Request body
daysintegerDays back from now, 1 to 365; 30 when unset.
locationIdstringlocation_idEmpty for every location the caller can see.
Response
daysintegerkindsKindMetrics[]overallKindMetricsactiveDaysintegeractive_daysDistinct days in the period with someone acting on an action, the "opens the inbox on 4 days a week" measure.
curl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/GetAutopilotMetrics \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'{
"days": 0,
"kinds": [
{
"kind": "",
"created": "0",
"open": "0",
"approved": "0",
"edited": "0",
"dismissed": "0",
"applied": "0",
"undone": "0",
"expired": "0",
"approvalRateBp": 0,
"editRateBp": 0,
"medianSecondsToDecide": "0",
"seen": "0"
}
],
"overall": {
"kind": "",
"created": "0",
"open": "0",
"approved": "0",
"edited": "0",
"dismissed": "0",
"applied": "0",
"undone": "0",
"expired": "0",
"approvalRateBp": 0,
"editRateBp": 0,
"medianSecondsToDecide": "0",
"seen": "0"
},
"activeDays": 0
}SyncAutopilot#
SyncAutopilot runs the connector for the business now instead of waiting for its next round.
Request body
No fields: send {}.
Response
changesReadint64 stringchanges_readChange feed entries read and actions gathered or updated.
actionsOpenint64 stringactions_openlastCollectedAtstringlast_collected_atcurl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/SyncAutopilot \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"changesRead": "0",
"actionsOpen": "0",
"lastCollectedAt": ""
}RecordVoiceCommand#
RecordVoiceCommand notes what someone said to Nuru and what it did (ADR 119), so the audit log shows who said what. Refused when the business turned voice off for the caller's role.
Request body
saidstringWhat the phone heard.
languagestringThe language listened in: sw-TZ or en-US.
actionstringWhat Nuru did with it: ask, approve, dismiss, brief, receive, waste, handover, count, order, price_check or none.
targetIdstringtarget_idWhat it acted on, such as an agent action or purchase order id.
locationIdstringlocation_idoutcomestringok, cancelled (the person said no) or failed.
Response
No fields: send {}.
curl https://api.buziin.tech/holygrail.autopilot.v1.AutopilotService/RecordVoiceCommand \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'{}Types
The messages and enums these methods use. Field names are lowerCamelCase in JSON; the snake_case names work too. Enum values are sent as their names.
GetAutopilotRequest
holygrail.autopilot.v1.GetAutopilotRequest
No fields.
GetAutopilotResponse
holygrail.autopilot.v1.GetAutopilotResponse
onbooleanreasonstringWhy it is off: platform_off, business_off, not_in_plan, addon_needed or canceled.
messagestringagentNamestringagent_nameThe agent's name: Nuru.
autonomyAutonomy[]openActionsint64 stringopen_actionsOpen actions the caller can see.
lastCollectedAtstringlast_collected_atRFC 3339; empty before the connector's first round.
lastChangeAtstringlast_change_atChanges the connector read today across the caller's locations, by entity (order, payment, stock_level, timecard, ...).
weekWeekTallyWhat was done for the business in the last 7 days.
waitingKindTally[]Open actions the caller can see, per kind.
setupSetupStep[]Getting Nuru ready (ADR 80): what it needs from the business to be useful, in order, each done or not.
UpdateAutonomyRequest
holygrail.autopilot.v1.UpdateAutonomyRequest
kindstringmodestringListAgentActionsRequest
holygrail.autopilot.v1.ListAgentActionsRequest
locationIdstringlocation_idEmpty for every location the caller can see.
statusesstring[]Empty for every status; else open, approved, dismissed, applied, undone or expired.
kindsstring[]Empty for every kind.
limitintegerAt most 200; 50 when unset.
cursorstringThe next_cursor of the page before.
ListAgentActionsResponse
holygrail.autopilot.v1.ListAgentActionsResponse
actionsAgentAction[]nextCursorstringnext_cursorActOnAgentActionRequest
holygrail.autopilot.v1.ActOnAgentActionRequest
idstringactionstringapprove, dismiss, undo or seen. A staff integrity case is never approved or dismissed: it is reviewed with fine, coaching, escalate or confirm, each but fine with a note.
editedbooleanThe person changed the draft before approving.
notestringGetAutopilotMetricsRequest
holygrail.autopilot.v1.GetAutopilotMetricsRequest
daysintegerDays back from now, 1 to 365; 30 when unset.
locationIdstringlocation_idEmpty for every location the caller can see.
GetAutopilotMetricsResponse
holygrail.autopilot.v1.GetAutopilotMetricsResponse
daysintegerkindsKindMetrics[]overallKindMetricsactiveDaysintegeractive_daysDistinct days in the period with someone acting on an action, the "opens the inbox on 4 days a week" measure.
SyncAutopilotRequest
holygrail.autopilot.v1.SyncAutopilotRequest
No fields.
SyncAutopilotResponse
holygrail.autopilot.v1.SyncAutopilotResponse
changesReadint64 stringchanges_readChange feed entries read and actions gathered or updated.
actionsOpenint64 stringactions_openlastCollectedAtstringlast_collected_atRecordVoiceCommandRequest
holygrail.autopilot.v1.RecordVoiceCommandRequest
saidstringWhat the phone heard.
languagestringThe language listened in: sw-TZ or en-US.
actionstringWhat Nuru did with it: ask, approve, dismiss, brief, receive, waste, handover, count, order, price_check or none.
targetIdstringtarget_idWhat it acted on, such as an agent action or purchase order id.
locationIdstringlocation_idoutcomestringok, cancelled (the person said no) or failed.
RecordVoiceCommandResponse
holygrail.autopilot.v1.RecordVoiceCommandResponse
No fields.
Autonomy
holygrail.autopilot.v1.Autonomy
Autonomy is how far Nuru may go for one kind of action.
kindstringpurchase_order, schedule, stock_finding or alert.
labelstringmodestringsuggest (draft and wait), auto (act, with undo) or off (stay quiet).
modesstring[]Modes this kind supports; some kinds can't act on their own yet.
SignalCount
holygrail.autopilot.v1.SignalCount
entitystringchangesint64 stringWeekTally
holygrail.autopilot.v1.WeekTally
WeekTally is the "done for you this week" tally: actions people approved in the inbox or at their source, or that Nuru carried out, in the last 7 days.
doneint64 stringamountint64 stringMoney in the purchase orders among them, in minor units.
minutesSavedint64 stringminutes_savedA rough estimate of the admin minutes saved, from a typical time per kind (a purchase order 15 minutes, a week's schedule 45, a finding 10, an alert 5).
kindsKindTally[]KindTally
holygrail.autopilot.v1.KindTally
kindstringlabelstringcountint64 stringamountint64 stringSetupStep
holygrail.autopilot.v1.SetupStep
SetupStep is one item on the onboarding checklist.
keystringvendors, recipes, reorder_points, stock_count, schedule, invoice, phone, payments or accounting.
titlestringdetailstringWhy it matters to Nuru.
donebooleanhrefstringWhere in the dashboard to do it.
optionalbooleanUseful, but Nuru works without it.
AgentAction
holygrail.autopilot.v1.AgentAction
idstringlocationIdstringlocation_idkindstringsubjectstringWhat it is about: "po:<id>", "finding:<id>", "schedule:<location>:<week>".
sourcestringforecast, stock_findings or alerts.
sourceIdstringsource_idseveritystringhigh, medium or low.
titlestringdetailstringbasisstringHow it was worked out, in plain words.
amountint64 stringMoney at stake, in minor units of the business's currency.
linkstringWhere in the dashboard to see it.
changeJsonstringchange_jsonThe change it proposes, as JSON: {"before": ..., "after": ...}.
statusstringopen, approved, dismissed, applied, undone or expired.
editedbooleandecidedViastringdecided_viainbox, source or auto; empty while open.
decidedBystringdecided_bydecidedAtstringdecided_atnotestringcreatedAtstringcreated_atlastSeenAtstringlast_seen_atoutcomestringStaff integrity cases (kind integrity_case, ADR 79): what the reviewer concluded (fine, coaching, escalated or confirmed; empty until then), and the team members the case is about, who never see it.
aboutMemberIdsstring[]about_member_idsKindMetrics
holygrail.autopilot.v1.KindMetrics
kindstringA kind, or "all".
createdint64 stringopenint64 stringapprovedint64 stringeditedint64 stringdismissedint64 stringappliedint64 stringundoneint64 stringexpiredint64 stringapprovalRateBpintegerapproval_rate_bpOf the decided ones (approved, dismissed, applied), the share approved or applied, in basis points (10000 = 100%).
editRateBpintegeredit_rate_bpOf the approved ones, the share a person changed first, in basis points.
medianSecondsToDecideint64 stringmedian_seconds_to_decideMedian seconds from an action appearing to a person deciding it.
seenint64 stringTimes people looked at an action in the inbox.
Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.