# Your agent gets better at its own job. You don't run the training.

A continual-learning loop around the agent you already have. Ship one line: your agent keeps running in your process, behind your firewall, on your credentials, unchanged. The model it calls and the prompt it runs keep improving, and a person on your side approves every change.

[Start the quickstart](https://docs.percepteye.ai/quickstart.md) [Python SDK](https://docs.percepteye.ai/sdk-python.md) [Node SDK](https://docs.percepteye.ai/sdk-node.md)

**Python**

```text
# 1 · install (one runtime dependency: httpx)
$ pip install agent-flywheel
$ agent-flywheel login --agent-id my-agent
$ export PERCEPTEYE_AGENT_MODE=training

# 2 · serve: that is the integration
import agent_flywheel as fw

fw.serve("my_pkg.agent:build",
         agent_id="my-agent",
         input_shape="text")

✓ connected · claiming practice tasks
```

**Node**

```text
# 1 · install (zero runtime dependencies)
$ npm install @percepteye/agent-flywheel
$ npx @percepteye/agent-flywheel login --agent-id support-agent

# 2 · wrap each turn you serve
import { flywheel } from "@percepteye/agent-flywheel";

const fw = flywheel({ agentId: "support-agent" });
const answer = await fw.turn(message, (t) => runAgent(t));

✓ connected · recording the turns you serve
```

**OpenClaw**

```text
# 1 · install (zero runtime dependencies)
$ openclaw plugins install @percepteye/agent-flywheel
$ npx @percepteye/agent-flywheel login

# 2 · let it read the conversation
{ "plugins": { "entries": { "agent-flywheel": {
    "hooks": { "allowConversationAccess": true } } } } }

# 3 · restart OpenClaw. No code changes.
✓ approved prompt + model applied in production
```

**OpenTelemetry**

```text
# already on OpenTelemetry? nothing to install
$ export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=\
    "$PERCEPTEYE_CONTROL_PLANE_URL/agents/my-agent/otlp/v1/traces"
$ export OTEL_EXPORTER_OTLP_TRACES_HEADERS=\
    "Authorization=Bearer%20$PERCEPTEYE_API_KEY"
$ export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf

✓ GenAI spans in · improvement rounds start from them
```

-   **0** lines changed in your agent
-   **0** inbound ports, containers or GPUs
-   **1 · 0** runtime deps, Python · Node
-   **2,306** tests across both SDKs, 0 skips

The loop

## Register once. Then it turns on its own.

Every lane is opened from your side. The better agent generates better evidence, which is what makes it a flywheel rather than a pipeline.

1.  **Describe** the agent from inside its own process
2.  **Claim** a practice task over an outbound long-poll
3.  **Run** it in a fresh child, single-use credential
4.  **Record** every tool call: `ok` · `failed` · `unknown`
5.  **Grade & train** on PerceptEye GPUs
6.  **Approve**: a person, in Decisions
7.  **Improve**: the next lap runs on the better agent

-   [Python agent](https://docs.percepteye.ai/sdk-python.md): LangChain, LangGraph, Google ADK or custom. Adapters auto-bind.
-   [Any CLI agent](https://docs.percepteye.ai/guides-cli-agents.md): Pass its argv to `serve()`. No change to the binary.
-   [JavaScript or TypeScript](https://docs.percepteye.ai/sdk-node.md): Vercel AI SDK, LangChain.js or custom: wrap each turn in `fw.turn()`. Or the OpenClaw and dsh plugin.
-   [Already on OTel](https://docs.percepteye.ai/guides-opentelemetry-push.md): Point your exporter at the control plane. Nothing to install.

Invariants, enforced by tests

-   **Outbound only**: No listening socket anywhere. Every connection is dialled from your side.
-   **`unknown` is never rounded up**: A verifier abstains instead of learning from a lie.
-   **A person approves every change**: No threshold, scheduler or language model can promote a model or ship a prompt.
-   **Fails open**: An unreachable control plane costs the improvement, never your agent's turn.
-   **Consent first**: Production upload and model content are two separate opt-ins, both off by default.
-   **Never loses an outcome**: Spooled to a durable outbox before the first send; refusals are retired, never deleted.

## Improve agents from real work

Agent Flywheel has two halves, joined by one key:

|  | The SDK or plugin | The control plane |
| --- | --- | --- |
| **Runs** | In your process or harness, beside your agent | Hosted by PerceptEye at [launch.percepteye.ai](https://launch.percepteye.ai/onboard/agent-sdk) (Mission Control) |
| **Does** | Runs practice tasks, records every tool outcome, captures the turns you serve, picks up the approved model and prompt | Writes tasks from your agent's real tools, grades every run, trains the policy, evolves the system prompt, measures each candidate against what you run today |
| **You bring** | `pip install agent-flywheel` or `npm install @percepteye/agent-flywheel` | An email address. Free plan, no credit card |

```text
Your agent (unchanged)
  → SDK / plugin records tool outcomes and turns
  → outbound HTTPS to the control plane
  → Mission Control: tasks → grading → training → evaluation
  → a person approves in Decisions
  → your agent picks up the approved model and prompt
```

Your agent keeps running where it runs today, behind your firewall, on your credentials. There is no container to build, no GPU to provision, and no inbound port to open: every connection is opened from your side.

## Three things it gives you

1.  **An agent that improves in place.** A policy trained on this agent's own work: its prompt, its tools, its failure modes. Not a generic model.
2.  **A system prompt that keeps evolving.** Mission Control evolves your prompt from your agent's own traces and keeps improving it as new traces arrive. See [Prompt optimization](https://docs.percepteye.ai/guides-prompt-optimization.md).
3.  **Honest evidence.** Every tool call is recorded as `ok`, `failed` or `unknown`. `unknown` is never rounded up to `ok`. See [Outcomes](https://docs.percepteye.ai/concepts-outcomes.md).

Nothing reaches your users until a person approves it. See [Approvals](https://docs.percepteye.ai/concepts-approvals.md).

## Pick your integration

| You have | Use | Start here |
| --- | --- | --- |
| A Python agent (LangChain, LangGraph, Google ADK, or custom) | Python SDK, `agent-flywheel` | [Python SDK](https://docs.percepteye.ai/sdk-python.md) |
| A JavaScript or TypeScript agent (Vercel AI SDK, LangChain.js, LangGraph.js, Mastra, or custom) | Node SDK, `@percepteye/agent-flywheel` | [Node SDK](https://docs.percepteye.ai/sdk-node.md) |
| A command-line agent in any language | Python SDK with an argv entrypoint | [CLI agents](https://docs.percepteye.ai/guides-cli-agents.md) |
| An OpenClaw agent | Node SDK as an OpenClaw plugin, `@percepteye/agent-flywheel` | [Node SDK](https://docs.percepteye.ai/sdk-node.md#openclaw-and-deepseek-harness) |
| A DeepSeek Harness agent | Node SDK as a DeepSeek Harness plugin, record-only | [Node SDK](https://docs.percepteye.ai/sdk-node.md#deepseek-harness) |
| An agent that already exports OpenTelemetry GenAI spans | No install: push the spans | [OpenTelemetry push](https://docs.percepteye.ai/guides-opentelemetry-push.md) |

Pick one per agent. Never install both SDKs for the same agent.

## Responsibilities

| Component | Responsible for |
| --- | --- |
| **Your runtime** | Runs the agent, unchanged. Produces the evidence. |
| **SDK or plugin** | Records outcomes and turns, runs practice tasks in training mode, applies the approved pair in production. Opens every connection outbound. |
| **Mission Control** | Task generation, grading, training, prompt optimization, evaluation, and the Decisions queue. |
| **A person on your side** | Approves or rejects every model and prompt before it reaches your users. |

## Explore

-   [Quickstart](https://docs.percepteye.ai/quickstart.md): connect your first agent in a few minutes.
-   [Concepts](https://docs.percepteye.ai/concepts.md): how the loop closes.
-   [Authentication](https://docs.percepteye.ai/authentication.md): which key goes where.
-   [Integrations](https://docs.percepteye.ai/integrations.md): every supported harness and hook.

---
Source: https://docs.percepteye.ai/#introduction · Index: https://docs.percepteye.ai/llms.txt
