# NexMind AI — DataClean Swarm SDK

Clean your ML training data with AI-powered agents.

## Install

```bash
pip install nexmind
```

## Quick Start

```python
from nexmind import NexMindClient
import pandas as pd

# Initialize
client = NexMindClient(api_key="dcs_your_key")

# Clean a DataFrame
df = pd.read_csv("dirty_data.csv")
clean_df, report = client.clean(df)

print(f"Quality: {report['quality_score_before']:.0%} -> {report['quality_score_after']:.0%}")
print(f"Rows removed: {report['rows_removed']}")
print(f"Rows repaired: {report['rows_repaired']}")
```

## Choose Agents

```python
# Run specific agents only
clean_df, report = client.clean(
    df,
    agents=["schema", "dedup", "repair"],  # skip anomaly + labeling
)
```

## Async Jobs

```python
# Submit and don't wait
job = client.submit_job(
    name="Nightly data clean",
    source={"type": "s3", "bucket": "raw", "key": "data.csv"},
    output={"type": "s3", "bucket": "clean", "key": "clean.parquet"},
)

# Check later
job.refresh()
print(job.status)  # "running" | "completed" | "failed"

# Or wait
job.wait()
print(job.report)
```

## 5 AI Agents

| Agent | What it does |
|-------|-------------|
| **schema** | Fix column types, names, formats |
| **anomaly** | Detect outliers (Z-score, IQR, Isolation Forest) |
| **dedup** | Remove exact + fuzzy duplicates |
| **repair** | Fill missing values, fix typos, standardize |
| **labeling** | Detect PII, classify columns |

## Get Your API Key

1. Sign up at [app.getnexmind.com](https://app.getnexmind.com)
2. Go to API Keys page
3. Create a key

## Links

- [Dashboard](https://app.getnexmind.com)
- [API Docs](https://api.getnexmind.com/docs)
- [Website](https://getnexmind.com)
