> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuralfactory.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How an agent works

> What happens between the moment you send a task and the moment the agent answers.

An agent is an AI assistant you give a task to in plain words. It works on the task in steps: it reads what you asked, looks things up or uses its tools when it needs to, and answers once it has enough.

## The steps of a task

1. It reads the task. The agent reads your message, the earlier messages of the conversation, any files you attached, and its own instructions and guardrails.
2. It decides what it needs. Some questions it can answer straight away. For others it needs to look something up or do something first.
3. It uses a tool. It searches its knowledge bases or the web, loads a skill, runs code, works in a connected service, or hands part of the work to a subagent. You do not have to name the tool; the agent picks it.
4. It looks at the result. If the result is not enough, it goes back to step 2 and tries something else.
5. It may pause to ask you. When something is unclear, or a guardrail says an action needs your approval first, it stops and asks.
6. It answers. The answer can include numbered sources, files it made, or a question back to you.

```mermaid theme={null}
flowchart LR
  A[Your task] --> B[Agent decides]
  B --> C[Uses a tool]
  C --> D[Reads the result]
  D --> B
  B --> E[Asks you]
  E --> B
  B --> F[Answer]
```

## An example

You ask a finance agent: "Which supplier invoices from March are still unpaid?" It searches its knowledge base of invoices, runs a short piece of code to add up the amounts, and answers with a table, the total and the invoices it used as sources. Suppose you also ask it to remind the suppliers, it has a mail toolkit, and its **Needs approval first** guardrail names sending email. It then stops and asks you before it sends anything.

## What you see while it works

* The answer area names what the agent is doing: **Queued...**, **Starting...**, then the current step with a seconds counter, such as **Thinking...** or **Searching...**. The answer then appears as it is written.
* The **Execution Trace** panel (the monitor button in the top bar) lists every step: model calls, tool calls and searches.
* When the agent pauses, a box above the composer says **The agent is waiting for your input.** Reply in the message box and it carries on from where it stopped.

The task runs on the platform. You can close the tab and come back to it later from **Tasks**. While it runs, the send button becomes **Stop**; what the agent already did still counts toward your usage.

## The limits of a task

* By default a task may work for about an hour and use a bounded number of tokens (the units models measure text in). Time spent waiting for you does not count. A task that reaches a limit stops and says so.
* A paused task waits up to 72 hours by default. If nobody answers in time, the task ends as failed.
* One message may take at most half of the model's context window, the amount of text the model can consider at once. A longer message is refused before any work starts.
* How many tasks can run at the same time is limited per person and per organization:
  * **SaaS**: set by your plan. Free 1, Pro 10, and 30 for a whole Business organization.
  * **Enterprise**: by default 10 per person and 25 for the organization, unless your installation sets other values.
* A task that waits for your answer does not count toward the tasks running at once.

## Where you see this in the app

* **New task**: send the task and follow it. See [Starting a task](https://docs.neuralfactory.ai/user-guide/chat/starting-a-conversation.md).
* **Tasks**: come back to a task that is running or done. See [Tasks](https://docs.neuralfactory.ai/user-guide/tasks/overview.md).
* **Inbox** (Admins and Members): tasks that wait for your answer. See [Inbox](https://docs.neuralfactory.ai/user-guide/inbox.md).

## Next

* [Knowledge and citations](https://docs.neuralfactory.ai/user-guide/concepts/knowledge-and-citations.md)
* [Skills, knowledge and tools](https://docs.neuralfactory.ai/user-guide/concepts/skills-knowledge-and-tools.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.