Skip to main content
Use this page when you need to trace a run or decide where an extension belongs. Navi defines the CLI, YAML flow contract, evidence and outcome schemas, and session behavior. Mastra runs the agents, workflows, tools, memory, storage, and model-provider routing beneath it.

Trace one run end to end

  1. Resolve — Navi finds the flow by name or path and binds its arguments, workspace, model, tools, skills, and output schema.
  2. Compile — Navi maps every declared step to a Mastra agent or command step and rejects invalid wiring.
  3. Run — Mastra executes the committed workflow.
  4. Validate — Navi validates the final answer, verdict, gate, or structured result.
  5. Record — Navi writes the turn to the selected session and renders human output or a navi.run.v2 JSON envelope.
Inspect the first two stages without calling a model or creating a session:
The shape names the resolved arguments, model, steps, tools, skills, output fields, settings, and lint findings.

Know what Mastra owns and what Navi owns

Choose the repository, model, review, and session

  • Repository — the current directory or -w <path> becomes the workspace read boundary.
  • ModelNAVI_MODEL selects any compatible route exposed by Mastra’s Model Router and AI SDK provider adapters.
  • Review — a built-in or project-owned action.yaml defines the steps, tools, and result.
  • Session — a new ID starts one line of work; -t <session> continues it and --fork branches its history.
The model surface belongs on Providers. Repository and command boundaries belong on Security and storage. Session behavior belongs on Sessions.

Add review logic with YAML

A flow adds a reusable review without replacing the runtime. It declares arguments, agent or command steps, dependencies, tools, skills, conditions, and output validation. Mastra executes the compiled result; Navi keeps the review contract stable around it. Start with Write a flow. Use Return a gate when the result must direct the caller rather than return ordinary data.