> For the complete documentation index, see [llms.txt](https://docs.eitherway.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eitherway.ai/documentation/ai-companion/how-it-works.md).

# How it Works

One of the first principles behind the companion is that it should not act blindly.

Before making meaningful changes, it produces a plan in language a non-engineer can understand. The user can approve that plan, request changes, or send it back. This creates a clear decision layer before the system changes anything important.

That matters because one of the most common failures in AI tooling is not bad output on its own. It is unexpected output delivered without context. Planning out loud reduces that problem.

The companion is also built to check whether its work actually succeeded before treating a task as complete.

#### That means running the equivalent of basic validation after a change:

* did the build succeed
* do tests still pass
* does the preview load cleanly
* did the intended result actually happen

If something is off, the system should not pretend otherwise.

The standard is simple: when the companion says a task is done, that should mean something.

A major part of the work so far has been getting the companion to recover from failure instead of stopping at the first issue.

When something breaks during execution, the system attempts to identify the problem, apply a fix, re-run the checks, and only return to the user if it reaches a real decision point.

That changes the product significantly. The difference between a system that gives up at the first error and one that can work through problems on its own is the difference between a tool that needs constant supervision and one that can be trusted with meaningful tasks.

The companion is also being developed to help with maintenance over time, not only first-pass execution. That includes surfacing issues inside the codebase, identifying when dependencies or environments need attention, and asking for approval before applying meaningful updates. The aim is to help keep projects functional and current, not just help create them once.

The companion also includes a dedicated in-app panel so users can see what it is doing in real time.

#### That panel is intended to show:

* the plan being followed
* the actions being taken
* what was auto-approved
* what is waiting for user input
* the full history of previous runs


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eitherway.ai/documentation/ai-companion/how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
