> For the complete documentation index, see [llms.txt](https://documentation.ocsinventory-ng.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ocsinventory-ng.org/administrator-docs/agent-setup/agent-overview.md).

# Agent overview

The OCS Inventory Agent is the client component that collects inventory data from devices and sends it to the OCS Inventory server (or writes it locally, depending on configuration).&#x20;

The agent performs three main tasks:

* Collects device information (basic information, see [Base and Template Inventory](https://documentation.ocsinventory-ng.org/quickstart-guides/for-users/base-and-template-inventory.md#base-inventory), but also extended information through [Inventory and Templates](https://documentation.ocsinventory-ng.org/user-docs/asset-management/inventory-and-templates.md#template-inventory)).
* Formats results into an inventory payload.
* Sends the payload to the server or writes it to a local file, depending on configuration.

### Requirements and compatibility

For agent compatibility, please refer to [System Requirements](https://documentation.ocsinventory-ng.org/administrator-docs/system-requirements.md#agent).

### Workflow

{% stepper %}
{% step %}
Install the agent on the target device.

See [#installation](#installation "mention").
{% endstep %}

{% step %}
Run it either:

* as a **service** on a schedule
* as a **one-time command**
  {% endstep %}

{% step %}
On each run, the agent gathers device inventory and optional template data.
{% endstep %}

{% step %}
Then it either:

* **syncs configuration** with the server and **uploads inventory**
* **writes an inventory file locally** for offline workflows
  {% endstep %}

{% step %}
**If deployment is enabled, the agent can also process packages after the inventory upload step.**
{% endstep %}
{% endstepper %}

### Usage

The agent can run:

* On a schedule (most common)
* On demand (useful for testing and troubleshooting). You will require terminal access and sufficient privileges:
  * **Linux/macOS**: `sudo ocsinventory-cli`&#x20;
  * **Windows**: `"C:\Program Files\OCS Inventory Agent\ocsinventory-agent.exe"`


---

# 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://documentation.ocsinventory-ng.org/administrator-docs/agent-setup/agent-overview.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.
