Skip to content

[EPIC] [MIND-REASON] Cross-platform Reasoning Engine #1827

Description

@ucguy4u

Goal

Airo Mind produces structured, intent-driven answers with a user-facing progress summary on every platform. Reasoning is a capability, not an inference-runtime feature and not a Flutter brain.

Same reason(request) API on macOS, Windows, Android, iOS, and iPadOS. Only the GenerationEngine implementor and the loaded model change.

Architectural rule (ADR-0002): Flutter calls reason() and renders ReasoningEvent. Rust owns policy, prompt, GBNF, parse, validate, and the tool loop. Chain-of-thought is an internal last-mile tick — never a stored field, never result.thoughts, never Gallery partialThinkingResult.

Pro boundary

Public crate rust/airo_mind_reasoning, same as airo_mind_meeting. Not an airo-pro overlay.

Critical Agent Gate

Problem: Chat streamed unconstrained tokens. Users need last-mile structured answers, not a raw thinking dump.

User / actor: Airo Mind chat on device.

Framework or application layer: Mixed — Rust capability (framework) + feature_mind presentation (application).

Owning agent: Framework Agent + Product Manager (feature_mind)

Reviewing agents: Chief Architect, Rust Architect, Platform Architect, Chief Performance Officer, Chief Security Officer, Chief QA Officer, Chief UX Officer

Decision: Ready

Contract

Flutter UI  ──FRB──►  airo_mind_reasoning
                         │  policy, context, prompt, parse, validate, tools
                         ▼
                   GenerationEngine  (domain-free)
                         │
          llama.cpp / Apple FM / LiteRT

Persist answer + reasoning_summary + level + tool_calls. Never thoughts / scratchpad / raw_thoughts / partialThinkingResult.

Tool loop cap = 5. none level: at most one tool, then answer, no second LLM call if the tool result is the answer.

Depends on

Related, not duplicated

Close / reframe

  • Add Thinking Mode to Brain AI Chat for supported models #271 Thinking Modesuperseded. Gallery-style raw CoT stream will not ship. Progress UI is StageChanged / Progress / ToolStarted. Keep capability gating (DeviceInferenceProfile + engine-ready), never a "show thinking" toggle that reveals a scratchpad.

Slice status (branch agent/mind/reasoning-engine)

ID Title Status
MIND-REASON-0 ADR + epic (this issue) Landing with ADR-0002
MIND-REASON-1 Policy + levels Done (9ba00595)
MIND-REASON-2 Prompt + result GBNF (no thoughts) Done (9ba00595)
MIND-REASON-3 Event stream + parser Done (9ba00595)
MIND-REASON-4 Wire GenerationEngine + Dart facade Done (9ba00595)
MIND-REASON-5 Context pack Done (9ba00595)
MIND-REASON-6 Tool loop cap=5 Done (84741190)
MIND-REASON-7 Thinking progress UI Done (62efd199)
MIND-REASON-8 Persistence without raw CoT Done (62efd199)
MIND-REASON-9 Device-tier clamp Done (62efd199)

Remaining on this epic

Verification environment

Host-only for crate + Dart tests. Real GGUF smoke is opt-in (AIRO_LLAMA_MODEL). Android emulator not required.

Docs

  • docs/architecture/ADR-airo-mind-reasoning-engine.md (ADR-0002)
  • docs/features/airo-mind/REASONING_ENGINE_ARCHITECTURE_REPORT.md
  • docs/superpowers/plans/2026-08-21-airo-mind-reasoning-engine.md

Feature Packet

Deterministic use cases: calendar lookup stays none; planning clamps by device tier; malformed envelope is InvalidModelOutput; tool loop stops at 5.

Security/privacy: no thought traces in SharedPreferences; no OS cfg in the reasoning crate; lookup-only tools (no create-event / notify) on the reasoning loop.

Rollback: chat send path can disable reason() via useOnDeviceReasoning; history schema v1 is additive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/ai-llmAI/LLM Agent tasksagent/docsDocs & ADR Agent tasksagent/frameworkFramework agent ownedarchitectureenhancementNew feature or requestepiclayer/platformReusable platform/framework contract or implementationnon-proGA/open-source work — delegate to cheaper modelson-deviceOn-device AI processingpriority/P1High - Important but not blockingrust-migrationMigrate subsystem to Rust platform coretype/taskImplementation task

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions