Repository navigation
HybridRouter 0.11.0 lets Siri ask your app. A new library, HybridRouterKitSiri, answers a question from Siri AI with your app's own routing, documents and privacy rules, in the background, and shows the answer in your app's card, without opening the app. Private answers are never given to Siri.
Developer preview. Siri AI calls apps' tools in the iOS 27.3 betas, for development-signed builds and internal TestFlight testers only, until App Store submissions open in spring 2027.
.package(url: "https://github.com/jaichaudhry/HybridRouter", from: "0.11.0")Answering Siri
struct AskManualIntent: AppIntent {
static let title: LocalizedStringResource = "Ask the E-Bike Manual"
static let description = IntentDescription("Answers a question about the owner's e-bike from its manual and the owner's notes.")
static let supportedModes: IntentModes = .background
static let authenticationPolicy: IntentAuthenticationPolicy = .requiresAuthentication
@Parameter(title: "Question") var question: String
@Dependency private var siri: SiriAssistant
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<String> & ProvidesDialog & ShowsSnippetView {
await siri.answer(question).intentResult()
}
}
@available(iOS 27.3, *)
extension AskManualIntent: ToolIntent {}SiriAssistantanswers each question in a new conversation (Siri fills in follow-ups itself), without streaming, with instructions for short answers that may be read aloud.- Siri gets plain text, your card gets the answer.
SiriAnswerCardshows the route, why it was chosen, the answer and its cost. With a screen, Siri shows a short line above it rather than the answer twice. - Private answers stay on the phone. Siri is given only a line saying the answer is private; the card shows it. With
.requiresAuthentication, a locked phone asks for Face ID first.
Measured on an iPhone 17 Pro Max (iOS 27.3 beta)
| Questions asked by hand | 25, all in the background: 22 on-device (median 2.7 s, free), 3 by the cloud model (4.0–4.5 s, about $0.001 each) |
| App launched by iOS just for the question | 6, answered in 1.7–3.3 s |
| Siri called the tool with the right question | 7/7, 7/7 and 6/7 scenarios in three SiriEvaluations runs |
| Private notes in what Siri said | none |
Details are in Results.
Also in this release
- A rate-limited on-device model is busy, not "too long". Apple's on-device model rate-limits apps that use it often in the background, and then reports a context size of 0. The router read that as a 0-token window, so every question was "too long for On-device" and private ones failed. Now the reason says "On-device busy, so using …", a private question waits a moment and tries again, and a rate-limited private step retries on-device. In testing the limit started after about five quick questions from Siri in a row, since each uses the on-device model to classify and to answer.
- A question about private notes comes with the note. The router's search already finds the private note that keeps a question on Apple's models; now the model gets it with the question instead of having to search again. On an iPhone, the on-device model sometimes answered "I couldn't find it" without searching.
respond(to:streams: false)onHybridAssistant(andstreams:onTurnCoordinator.RequestandRoutedSession.respond) gets the reply whole, as Apple recommends in the background.StepMetrics.failureDetailkeeps the provider's own error behind a "model error".- Document search instructions are added once, even if your instructions already include them.
In the app
The Manual scenario answers from Siri: "Hey Siri, ask HybridRouter what E17 means". Settings › Developer › Siri spike logs every answer, and a SiriEvals UI test target scripts Siri requests.
Known limitations
- Siri rewords questions, often lowercase and unpunctuated, which can make a judgment question look simple: "do I need the Rapid charger?" stayed on-device and got a wrong answer.
- Siri sometimes shows the answer twice despite the short supporting line.
- Private questions fail while the on-device model is rate-limited, after a short wait, rather than going to the cloud model: "The on-device model is busy… Try again in a moment."
- Questions on a locked phone need Face ID, manual ones included: Siri applies authentication to the whole intent.
- The known limitations from 0.10 still apply.