> For the complete documentation index, see [llms.txt](https://docs.reviactyl.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reviactyl.app/development/customization/building-agent.md).

# Building Agent

Steps to Build Reviactyl Agent (GO)

{% hint style="warning" %}
Do **not** run the following steps on your production nodes.
{% endhint %}

Agent is written in Go. This makes it very easy to modify and compile it on your own, and distribute your own binaries. This guide will cover the steps necessary to build it yourself.

It will not, however, explain where to look for certain aspects of Agent and which changes are necessary to achieve specific results. Knowledge of the Go language is required if you want to modify it.

Building Go programs is very easy, and the same also applies to Agent. Go is cross-platform, but Agent only supports Linux at the moment. The easiest way to compile it for Linux is to run the commands on a Linux machine.

### Build Requirements

An up to date version of Go is required to compile Agent. The minimum version can be found at the top of the [go.mod](https://github.com/reviactyl/agent/blob/develop/go.mod) file. See the [official instructions](https://golang.org/doc/install) for help with installing Go.

### Building

Execute the following command in your local clone of the repository to compile Agent into a binary.

```bash
go build
```

### Install the new binary

{% hint style="info" %}
**Root Required**\
Some the following commands require root permissions. Prepend them with `sudo` if you are not logged in as root.
{% endhint %}

{% stepper %}
{% step %}

### Backup the current installation of wings

```sh
mv /usr/local/bin/agent /usr/local/bin/wings-agent
```

{% endstep %}

{% step %}

### Place the new binary in /usr/local/bin

```shellscript
cp ./agent /usr/local/agent
```

{% endstep %}

{% step %}

### Restart Agent

```shellscript
systemctl restart agent
```

{% endstep %}
{% endstepper %}

### Troubleshooting

If the wings service does not start properly, you can try to start Wings in a console window.

```shellscript
agent --debug
```

Remember to stop the system service before, and re-enable it afterwards.

```shellscript
systemctl stop agent
systemctl start agent
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.reviactyl.app/development/customization/building-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
