# June > A declarative runtime for AI workflows. Compose agents and async work with React on top of the AI SDK, run them from the CLI, and inspect the rendered execution tree. Every link below is a page's Markdown. Any June.dev docs URL also returns Markdown when requested with `Accept: text/markdown`. ## Start - [June Docs](https://june.dev/docs.md): June's mental model: a declarative runtime for AI workflows, built on the AI SDK. What it adds, when to use it, and where to start. - [Installation](https://june.dev/docs/installation.md): Install June with Bun, React, the AI SDK and your provider, set one API key, and check it with june doctor. - [Quickstart](https://june.dev/docs/quickstart.md): Write a June workflow as a React component, run it with june run, read its output, and pass it props. - [CLI](https://june.dev/docs/cli.md): The june command runs the workflow or chat a file default exports, and june doctor checks your setup. ## Workflows - [React as the workflow](https://june.dev/docs/workflows.md): June is React for AI workflows: a runtime where the component tree is the program. - [Agent and Step](https://june.dev/docs/workflows/agent-and-step.md): provides the model and tool configuration around its children. is one unit of model-backed work: one prompt, one agent loop, one result. - [Tools](https://june.dev/docs/workflows/tools.md): June ships tools so you don't have to write them. Each one is a plain AI SDK tool() underneath, declared in JSX like any other capability: in an 's children gives its steps the tool. - [Capabilities](https://june.dev/docs/workflows/capabilities.md): A capability is something an can do: call a tool, today. June declares capabilities in JSX, as children of the agent they belong to, so the shape of an agent reads straight off its source: - [Composition and data flow](https://june.dev/docs/workflows/composition.md): Nesting is dependency. A step's result is passed to what it renders, so its children can't exist, and can't run, until it finishes. - [Parallelism and concurrency](https://june.dev/docs/workflows/parallelism.md): says "these children don't depend on each other." The run's concurrency limit says how many ready steps may execute at once. - [Step identity](https://june.dev/docs/workflows/step-identity.md): A step's id names it within a run, and its cache key records what it asks. Together they decide when a step runs, when it shares another step's result, and when it reuses a snapshot. - [Custom steps with useStep](https://june.dev/docs/workflows/use-step.md): useStep makes ordinary async work part of the workflow runtime. It's not another way to call a model. - [Running workflows](https://june.dev/docs/workflows/running.md): run() and start() both execute a workflow from code. Pick by whether your code has to act while the workflow runs. - [Recovery](https://june.dev/docs/workflows/recovery.md): An unhandled step failure fails the run. Wrap a subtree in when that subtree has an alternate path, or can be retried, without throwing away the rest of the workflow. - [Approvals](https://june.dev/docs/workflows/approvals.md): The AI SDK marks a tool as needsApproval. When a June step reaches that tool call, June pauses the step and exposes the pending request through the live run handle until your app approves or denies it. - [Snapshots and resume](https://june.dev/docs/workflows/resume.md): A snapshot contains finished steps' results and cache keys, as JSON. A new run can reuse those finished steps instead of executing them again. - [Traces and usage](https://june.dev/docs/workflows/traces.md): The trace is the tree React rendered, as plain JSON: a node for each agent, step and , with each step's live state in its props. ## Chat - [Chat](https://june.dev/docs/chat.md): A workflow runs once and finishes. june/chat keeps an interaction alive across turns: a session records the conversation, can be reopened later, and stores people's feedback beside the replies it judges. - [Sessions and stores](https://june.dev/docs/chat/sessions.md): A session is one conversation. Its journal, an append-only list of entries in a ChatStore, is the session's canonical state: everything a session knows about its turns is rebuilt from it, including after a restart. - [Turns and streaming](https://june.dev/docs/chat/turns.md): A turn is one user input, answered once. It streams live events while it runs, settles with a reply or an error, and leaves a few entries in the session's journal. - [Responders](https://june.dev/docs/chat/responders.md): A responder answers turns. It owns one reply's execution: given the conversation so far and the new input, it produces one reply. - [Context](https://june.dev/docs/chat/context.md): The transcript and the model's context are different things. - [Feedback and preferred edits](https://june.dev/docs/chat/feedback.md): People can tell a chat two useful things about a reply: a rating, whether it was good, and a preferred edit, what it should have said instead. - [Learning from chat](https://june.dev/docs/chat/learning.md): Real conversations are the best evidence of what a model or agent gets wrong. june/train turns chat sessions, and the feedback people left on them, into datasets and eval cases. - [Privacy and security](https://june.dev/docs/chat/privacy.md): A chat keeps conversations, which are often the most sensitive data an application has. June itself has no service: nothing goes to June. ## Copy - [Copy and voice](https://june.dev/docs/copy.md): A style prompt tells a model how you hope someone writes. A corpus shows how they actually write. - [Corpora and authorship](https://june.dev/docs/copy/corpora.md): A corpus is the person's writing, and everything a voice knows about them comes from it. - [Voice preparation](https://june.dev/docs/copy/preparation.md): prepareVoice() turns a corpus into a voice's working material: the samples worth learning from, each with a reconstructed prompt and labels, as a dataset with deterministic splits. - [Writing with a voice](https://june.dev/docs/copy/voices.md): A Voice is three things: the person's writing, a model that writes, and evaluators that check the result sounds like them. - [Retrieval](https://june.dev/docs/copy/retrieval.md): Before writing, a voice picks a handful of the person's samples to show the writer as exemplars. - [Scoring and evaluation](https://june.dev/docs/copy/scoring.md): A voice scores every draft it writes, to pick the best one. That's scoring. Whether the voice is any good, and whether a change made it better, is a separate question that takes an evaluation. - [Saving and training](https://june.dev/docs/copy/training.md): Saving a voice and training a model are different things. Saving records which writing and settings a voice uses, so you can load the same voice again; it changes nothing about any model. - [Learning from edits](https://june.dev/docs/copy/learning.md): When a person edits a draft, that's the best evidence you'll get: what they actually wanted, next to what the voice wrote. Learning from it is a loop that ends with a person deciding. ## Evals and training - [Evals and training](https://june.dev/docs/training.md): Evaluate first. Train only when the evidence says you should. - [Datasets](https://june.dev/docs/training/datasets.md): A Dataset is an immutable, ordered list of canonical examples: the data you train on and the data you hold out to evaluate with. - [Evals](https://june.dev/docs/training/evals.md): An eval measures a behavior: a set of cases, a target that answers them, and graders that score each answer. - [Comparing candidates](https://june.dev/docs/training/comparing.md): A comparison doesn't decide what "better" means. It lines up two runs of the same suite. Your promotion rule decides whether the candidate is worth adopting. - [Fine-tuning](https://june.dev/docs/training/fine-tuning.md): june/train fine-tunes models through a small, provider-neutral contract. June orchestrates training; it doesn't train anything itself. The weights, GPUs and provider APIs belong to a trainer. - [Jobs](https://june.dev/docs/training/jobs.md): A Promise represents work your process is waiting on. A Job represents work a backend owns, which you can find again later from a serializable JobRef. - [Training in workflows](https://june.dev/docs/training/workflows.md): fineTune() and evaluate() are the canonical APIs. Use and only when training or evaluation is itself one stage of a larger June workflow, and should take part in its dependencies, trace, cancellation and composition. - [Local training](https://june.dev/docs/training/local.md): Use trl() when you want open-weight training on hardware you control. Use a managed trainer when you'd rather the provider own compute and serving. - [Managed training](https://june.dev/docs/training/managed.md): vertex() tunes Gemini models on Vertex AI with supervised fine-tuning. It's the same fineTune() call as local training, with a different trainer. - [Custom trainers](https://june.dev/docs/training/custom-trainers.md): Write a custom trainer when the place that trains your model isn't already covered by trl() or vertex(): an internal GPU platform, another provider's fine-tuning API, or a bespoke remote runner. ## Reference - [Package surfaces](https://june.dev/docs/reference/packages.md): Which entrypoint has what you need, and where it's explained. Anything you can't import from one of these is internal. - [Compatibility](https://june.dev/docs/reference/compatibility.md): Will June run in your project, and what can your code safely depend on across versions? The table below answers the first; the rest of the page answers the second. - [Security and privacy](https://june.dev/docs/reference/security.md): June is a library that runs in your process. It has no server and sends nothing to June itself: data leaves your machine only when your code calls a model, a provider or a trainer, and June writes files only where you point a store or a trainer. ## Agents - [Using June.dev from an agent](https://june.dev/docs/agents.md): What to give a coding agent so it builds with June accurately: the MCP server at june.dev/mcp, llms.txt, or a page's Markdown. - [Markdown and discovery](https://june.dev/docs/agents/markdown.md): Every June.dev page as Markdown through content negotiation or a .md URL, and the llms.txt, docs sitemap and llms-full.txt files that index them. - [MCP server](https://june.dev/docs/agents/mcp.md): June's MCP server at june.dev/mcp: connect a client, search and read June's docs with search_docs and get_doc, or read pages as june:// resources. - [Skills](https://june.dev/docs/agents/skills.md): There's no official June skill yet, and you don't need one: what to give a coding agent today, and what a skill would add. ## Examples - [June Examples](https://june.dev/examples.md): Real applications built only on June's public packages: a precision-first code reviewer and a writing agent that learns from edits. - [Code Review Agent](https://june.dev/examples/code-review-agent.md): A precision-first pull request reviewer, and June's runtime thesis in one application: it plans once, runs four specialists in parallel, has a verifier try to disprove each one's findings, and shows only the few that survive. - [Copy Agent](https://june.dev/examples/copy-agent.md): A writing agent that learns from evidence, not a style prompt: it drafts in a person's voice, turns their edits into evidence, evaluates candidates on held-out cases, and changes only when they promote one. ## Agent resources - [llms.txt](https://june.dev/llms.txt): The index of June's docs for agents: every page's Markdown URL with a one-line description. - [Markdown pages](https://june.dev/index.md): Every docs and examples page as Markdown: request it with `Accept: text/markdown`, or add `.md` to its path. - [Docs sitemap](https://june.dev/docs/sitemap.md): The docs' sections and pages as a nested Markdown list, linking each page's Markdown. - [MCP server](https://june.dev/mcp): June's MCP endpoint, over Streamable HTTP, public and without auth: `search_docs` and `get_doc` tools, and every page as a `june://docs/…` or `june://examples/…` resource. - [llms-full.txt](https://june.dev/llms-full.txt): Every docs and examples page in one file, in reading order. Large: prefer llms.txt and the pages you need.