# 🤖 AI Registration Agent v2.0

An AI-powered browser automation agent that automatically fills registration forms using a local Llama 3.2 model and a temporary email address.

---

## ✅ Works On
- **Windows 10/11**
- **macOS 12+**
- **Linux (Ubuntu 20.04+)**

---

## 📋 Prerequisites

### 1. Node.js (v18 or newer)
Download from: https://nodejs.org

Verify: `node --version`

---

### 2. Python 3 (v3.8 or newer)
Download from: https://python.org

Verify: `python3 --version` (Mac/Linux) or `python --version` (Windows)

Then install the Python audio/speech packages:

**Windows:**
```
pip install SpeechRecognition sounddevice numpy
```

**macOS:**
```
pip3 install SpeechRecognition sounddevice numpy
```

**Linux (Ubuntu/Debian):**
```
sudo apt install portaudio19-dev python3-pip
pip3 install SpeechRecognition sounddevice numpy
```

> ⚠️ Voice input is **optional**. If your mic or these packages don't work, the agent automatically falls back to typed input.

---

### 3. Google Chrome
Download from: https://google.com/chrome

Must be installed in the default location:
- **Windows:** `C:\Program Files\Google\Chrome\Application\chrome.exe`
- **macOS:** `/Applications/Google Chrome.app`
- **Linux:** `/usr/bin/google-chrome` or install Chromium: `sudo apt install chromium-browser`

---

### 4. Ollama + Llama 3.2 (for AI-powered form filling)
Download Ollama from: https://ollama.com

After installing:
```
ollama pull llama3.2
```

Start the Ollama server (keep this running in a separate terminal):
```
ollama serve
```

> ⚠️ Ollama is **optional**. If it's not running, the agent uses built-in heuristic rules to fill forms (slightly less accurate but still works).

---

## 🚀 Setup & Running

### Step 1 — Install Node dependencies
Open a terminal in the project folder and run:
```
npm install
```

### Step 2 — Start Ollama (in a separate terminal window)
```
ollama serve
```

### Step 3 — Run the agent
```
node agent.js
```
or
```
npm start
```

---

## 🎤 Voice Input
The agent can speak questions and listen for your voice responses.

- **Windows:** Uses PowerShell's built-in `System.Speech` (no extra install needed)
- **macOS:** Uses the built-in `say` command (no extra install needed)
- **Linux:** Tries `espeak` — install with `sudo apt install espeak` (optional)

If voice doesn't work, no problem — the agent will simply ask you to type your answer.

---

## 📁 Files Explained

| File | What it does |
|------|-------------|
| `agent.js` | Main brain — runs everything |
| `listen.py` | Records 5s of mic audio and transcribes via Google Speech |
| `package.json` | Node.js dependencies list |
| `user_profiles.json` | Auto-created — stores your saved identity profile |
| `accounts_db.json` | Auto-created — logs created account credentials |

---

## 🔒 Privacy Notes
- `user_profiles.json` stores your name, username, DOB, country, gender
- `accounts_db.json` stores created account emails and passwords
- **Do not share these files with anyone**
- The agent uses temporary throwaway emails (from 1secmail) — not your real email

---

## ⚠️ Important
Use this agent only on websites you own or have permission to test. Automated account creation may violate the Terms of Service of many websites.

---

## 🐛 Troubleshooting

**"Chrome not found" error**
→ Make sure Google Chrome is installed in the default location for your OS.

**"Ollama offline" message**
→ Run `ollama serve` in a separate terminal. The agent will still work using heuristic rules without it.

**Voice input not working**
→ Make sure your microphone is connected and Python packages are installed. The agent falls back to typed input automatically.

**`npm install` fails**
→ Make sure Node.js v18+ is installed: `node --version`

**Python speech packages fail on Linux**
→ Run: `sudo apt install portaudio19-dev` then `pip3 install sounddevice speechrecognition numpy`
