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

# Agents

> Git-backed agents for document tasks that are hard to express as a fixed step graph.

An **agent** is the alternative to a [workflow](https://docs.eigenpal.com/concepts/workflows.md) when the
task does not fit a fixed graph of typed steps. An agent uses model requests and tools to produce structured output from a
Git-backed TypeScript definition. Normal agents run without a filesystem sandbox;
add `.withFilesystem()` when they need files or shell scripts.

Use a workflow by default. Its steps run the same way every time, which makes it
easier to evaluate, debug, and review. Use an agent when the task is open-ended
or changes shape per input. Both are evaluated the same way; an agent changes how
the output is produced, not how quality is measured.

## When to use which

| | Workflow | Agent |
| - | - | - |
| Shape | Fixed DAG of typed steps | Model-driven agent with optional filesystem |
| Authoring | YAML you edit (or the builder generates) | TypeScript source, optional sandbox training |
| Determinism | Deterministic, same path every run | Model-driven, adapts per input |
| Best for | Known pipelines, strict reproducibility | Open-ended extraction, per-document variation |

Both run from the same places, are evaluated against datasets the same way, and
are inspected with the same `eigenpal runs` commands.

## Execution and authoring

An **inference run** executes a released agent and validates its final output.
Normal agents use structured inputs, custom tools and portable resources without
a filesystem sandbox. Filesystem agents also receive a workspace and sandbox
read/write/shell tools. Both modes capture the selected source commit and definition.

A **builder session** is an optional sandbox-backed editing session in Studio.
It edits the Git source; it is separate from running a normal agent. Deployments
without enabled sandboxes can still author through Git/CLI and run normal agents.

Use the [agent authoring SDK](https://docs.eigenpal.com/sdks/automations.md) to define capabilities and
[callback guide](https://docs.eigenpal.com/sdks/automations/callbacks.md) to understand custom tool limits.
Use the [API client](https://docs.eigenpal.com/sdks/typescript.md) to start and inspect runs from application code.

## Source lives in Git

An agent's source is a package in your organization's Git repository, not a
single file. Use `eigenpal agents` commands to clone, validate, commit, push,
release, and sync it:

```bash theme={null}
eigenpal agents clone --out tmp/org-repos/acme-prod   # clone the org repo
eigenpal agents validate                              # check source locally
eigenpal agents commit -m "teach invoice totals"      # commit changes
eigenpal agents push                                  # push to the org remote
eigenpal agents release                               # cut a release tag
eigenpal agents sync                                  # apply the release to the platform
```

See the [`eigenpal agents`](https://docs.eigenpal.com/cli/agents) reference for the full command surface.

## Running an agent

Start a run from the dashboard Run button, the CLI, or the API. Pass the agent
target in the JSON body alongside the input object:

```bash theme={null}
curl -X POST https://api.eigenpal.com/v1/runs \
  -H "Authorization: Bearer eig_live_..." \
  -F 'target=agents.extract-invoice' \
  -F 'input={"language":"en","vendor":"Acme"}' \
  -F 'files.document=@invoice.pdf'
```

This file-upload example requires a filesystem agent. Send scalar fields in the
`input` JSON part and each upload as `files.<fieldName>`. For a normal agent, send
its structured input without file uploads.
See the [API reference](https://docs.eigenpal.com/api-reference) for run status,
review, and corrected-output endpoints.

## Inspecting and improving runs

Every run produces output, a trace of what the agent did, and a place to attach
reviews and corrected outputs. Inspect them with the same commands you use for
workflow runs:

```bash theme={null}
eigenpal runs list
eigenpal runs get <run-id>
eigenpal runs trace <run-id>
eigenpal runs reviews update <run-id> --verdict incorrect --status open
eigenpal runs reviews close <run-id>
```

Reviews and expected artifacts are available to builder sessions, so future
source changes can account for past failures. See [Reviews](https://docs.eigenpal.com/concepts/reviews.md)
for the verdict/status model and [Review production runs](https://docs.eigenpal.com/guides/review-runs.md)
for the full review-and-rerun workflow.


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