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

# Lens Parameters

> A comprehensive reference for configuring lens parameters across all Archetype AI lens types.

A Lens is a software interface that allows developers to configure and interact with Newton. Lenses define how sensor data flows in and out of Newton and specify how Newton should interpret that data for a given use case.

## Parameter Categories

Lens parameters fall into two categories:

* **Basic Parameters** control core behavior like analysis focus, timing, and output format. These are the primary settings you'll adjust for your use case.
* **Advanced Parameters** fine-tune performance characteristics like buffering, model replicas, and token limits. Default values work well for most applications.

## Activity Monitor Lens

The Activity Monitor Lens analyzes camera data to identify activities, movements, or events within a scene. It detects human and object behaviors for applications like workflow monitoring, interaction tracking, and space usage analysis.

### Basic Parameters

| Parameter           | Description                                            | Default                                        | Notes                                                                                                                                                                               |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **instruction**     | Defines the lens's role, objective, and output format  | Answer the following question about the video: | Include role context, target behaviors, and response formatting                                                                                                                     |
| **focus**           | Steers what the model prioritizes in the sensor stream | Describe the video.                            | Narrow analysis to specific behaviors or conditions without retraining                                                                                                              |
| **temporal\_focus** | Controls how video frames are sampled over time        | `5`                                            | Temporal focus is defined as an integer in the number of seconds" This means over 5 seconds, 5 samples 5 frames are analyzed; higher values distribute frames across longer windows |

#### Instruction Format

Structure your instruction with these components:

```
[ROLE] You are a smart camera monitoring a conveyor belt in a manufacturing facility.
[OBJECTIVE] Detect complete work stoppages that require human intervention.
[OUTPUT FORMAT] ALERT: [reason in 5-7 words].
```

### Advanced Parameters

| Parameter                        | Description                                       | Default | Notes                                                    |
| -------------------------------- | ------------------------------------------------- | ------- | -------------------------------------------------------- |
| **camera\_buffer\_size**         | Number of frames kept in buffer before processing | 5       | Buffer size of 5 means model sees 5 frames per inference |
| **camera\_buffer\_step\_size**   | Step size for frame sampling                      | 5       | Step of 5 frames means next window starts 5 frames later |
| **memory\_prompt\_buffer\_size** | Previous lens responses kept in prompt history    | `0`     | Keep default for best results                            |
| **max\_new\_tokens**             | Maximum tokens generated during inference         | 512     | Keep default for best results                            |
| **min\_replicas**                | Minimum model replicas maintained                 | 1       | Keep default for best results                            |
| **max\_replicas**                | Maximum model replicas allowed                    | 1       | Keep default for best results                            |

<Card title="Activity Monitor Lens" icon="eye" href="/core-concepts/lenses/lens-templates/activity-monitor">
  Full documentation and configuration examples for the Activity Monitor Lens
</Card>

## Machine State Lens

The Machine State Lens classifies operational states of machines using sensor measurements. It distinguishes between normal operation, stressed conditions, and anomaly or failure modes like overheating, mechanical wear, or misalignment. The lens supports one-shot and few-shot classification, allowing adaptation to new machines without retraining.

### Basic Parameters

| Parameter          | Description                                 | Default | Notes                                                                                          |
| ------------------ | ------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------- |
| **input\_n\_shot** | Labeled CSV examples for each machine state | —       | At least one example required per state; format must match incoming data                       |
| **window\_size**   | Number of rows analyzed together            | `1024`  | Smaller values (256) give more frequent predictions; larger values (2048) provide more context |
| **step\_size**     | Rows to advance between predictions         | `1024`  | Controls prediction frequency                                                                  |

### CSV Configuration Parameters

| Parameter             | Description                        | Notes                                                            |
| --------------------- | ---------------------------------- | ---------------------------------------------------------------- |
| **timestamp\_column** | Column containing time information | Used to order and label predictions                              |
| **data\_columns**     | Sensor columns to analyze          | Update to match your CSV structure; maximum 4 variates supported |

### Advanced Parameters

| Parameter         | Description                            | Default | Notes                         |
| ----------------- | -------------------------------------- | ------- | ----------------------------- |
| **buffer\_size**  | Time points kept in buffer per variate | `1024`  | —                             |
| **min\_replicas** | Minimum model replicas maintained      | 1       | Keep default for best results |
| **max\_replicas** | Maximum model replicas allowed         | 1       | Keep default for best results |

### KNN Configuration Parameters

| Parameter                 | Description                            | Default     |
| ------------------------- | -------------------------------------- | ----------- |
| **n\_neighbors**          | Number of neighbors for classification | `5`         |
| **metric**                | Distance metric                        | `manhattan` |
| **weights**               | Weight function                        | `distance`  |
| **algorithm**             | Algorithm for neighbor computation     | `ball_tree` |
| **normalize\_embeddings** | Whether to normalize embeddings        | `false`     |

<Card title="Machine State Lens" icon="gauge" href="/core-concepts/lenses/lens-templates/machine-state">
  Full documentation and configuration examples for the Machine State Lens
</Card>

## Related Resources

<CardGroup cols={2}>
  <Card title="Developer Quickstart" icon="rocket" href="https://docs.archetypeai.app/introduction/getting-started">
    Get started with your first lens
  </Card>

  <Card title="Lenses Overview" icon="eye" href="/core-concepts/lenses/overview">
    Understanding how lenses work
  </Card>

  <Card title="Code Examples" icon="code" href="/code-examples/command-line-demos/activity-monitor/activity_monitor">
    Working examples for hands-on learning
  </Card>

  <Card title="Workbench" icon="sparkles" href="https://console.u1.archetypeai.app/">
    Configure lenses in a no-code environment
  </Card>
</CardGroup>
