# Prerequisites & Setup Guide

> **Quick start alternative:** The AgentSim simulator (`simulator.html`) runs entirely in the browser with no installation required. You can explore guided scenarios immediately. For real API integration, `agent-connect.html` accepts an API key -- but simulation mode needs nothing. If you prefer a visual introduction, start with `walkthrough.html`.

Complete every step below before starting Module 1. Each section ends with a verification command -- if the verification fails, fix the issue before moving on.

---

## 1. Verify AgentSim Installation

AgentSim is the simulated banking environment you will work with throughout the curriculum. Confirm it is set up correctly.

### Check that AgentSim data files exist

```bash
ls ~/Documents/Claude/AgentSim/data/
```

You should see JSON files for the simulated bank (org structure, employees, systems, policies, etc.). If the `data/` directory is missing or empty, you need to set up AgentSim first -- see the main project README.

### Run the validation script

```bash
cd ~/Documents/Claude/AgentSim
python3 scripts/validate.py
```

This checks that all required data files are present and structurally valid. Fix any errors it reports before continuing.

### Start the dashboard (optional but recommended)

```bash
cd ~/Documents/Claude/AgentSim
python3 -m http.server 8090
```

Open http://localhost:8090 in your browser. You should see the AgentSim dashboard showing Frontier Community Bank's org chart, systems, and data. Press `Ctrl+C` to stop the server when you are done checking.

---

## 2. Install Claude Code

Claude Code is Anthropic's CLI for working with Claude as a coding agent.

### Install

```bash
npm install -g @anthropic-ai/claude-code
```

### Verify installation

```bash
claude --version
```

You should see a version number. If you get "command not found", make sure Node.js 22+ is installed and your npm global bin directory is in your PATH.

### Set up your API key

You need an Anthropic API key. Get one at https://console.anthropic.com/.

```bash
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
```

Add this to your shell profile (`~/.zshrc` or `~/.bashrc`) so it persists across terminal sessions.

### Verify Claude can access AgentSim

```bash
cd ~/Documents/Claude/AgentSim && claude
```

Then ask: "What is Frontier Community Bank?"

Claude should respond with details from the AgentSim data files (a $2.1B community bank in Tennessee, etc.). If Claude does not know, check that the `--add-dir` path is correct and the data files exist.

---

## 3. Install Hermes Agent

Hermes is Nous Research's autonomous agent framework with self-improving skills and layered memory.

### Install

```bash
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
```

### Verify installation

```bash
hermes --version
```

### Configure your LLM provider

Edit (or create) `~/.hermes/config.yaml`:

```yaml
provider: anthropic          # or openai, ollama
api_key: sk-ant-your-key     # your API key
model: claude-sonnet-4-20250514       # or gpt-4o, llama3
```

If using Ollama (local), set:

```yaml
provider: ollama
model: llama3
endpoint: http://localhost:11434
```

### Verify

```bash
hermes chat "What is 2+2?"
```

You should get a response. If you see a connection error, check your API key and provider configuration.

---

## 4. Install OpenClaw

OpenClaw is an open-source agent CLI that supports multiple LLM backends and identity-file-based configuration.

### Install

```bash
npm install -g openclaw@latest
```

### Verify installation

```bash
openclaw --version
```

### Configure

Edit (or create) `~/.openclaw/openclaw.json`:

```json
{
  "defaultProvider": "anthropic",
  "providers": {
    "anthropic": {
      "apiKey": "sk-ant-your-key"
    },
    "openai": {
      "apiKey": "sk-your-openai-key"
    },
    "ollama": {
      "endpoint": "http://localhost:11434",
      "model": "llama3"
    }
  }
}
```

You only need to configure the providers you plan to use. At minimum, configure one.

### Verify

```bash
openclaw chat "Hello"
```

---

## 5. Install NemoClaw

NemoClaw is NVIDIA's enterprise agent framework with YAML-based policy guardrails and a 5-layer security sandbox.

### Install via shell script

```bash
curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash
```

### Or install via pip

```bash
pip install nemoclaw
```

### Verify installation

```bash
nemoclaw --version
```

### Configure

NemoClaw reads configuration from `~/.nemoclaw/config.yaml`:

```yaml
provider: anthropic
api_key: sk-ant-your-key
guardrails:
  enabled: true
  policy_dir: ~/.nemoclaw/policies/
```

### Verify

```bash
nemoclaw status
```

You should see a status report showing the configured provider and guardrail status. If guardrails show as disabled, check the `policy_dir` path.

---

## 6. Verify All Frameworks

Run this quick check to confirm all 4 frameworks are installed and accessible:

```bash
echo "=== Claude Code ===" && claude --version
echo "=== Hermes ===" && hermes --version
echo "=== OpenClaw ===" && openclaw --version
echo "=== NemoClaw ===" && nemoclaw --version
```

All four should print version numbers without errors. If any fail, go back to the relevant section above and troubleshoot.

### Verify AgentSim data access

Each framework should be able to read AgentSim data. Quick test:

```bash
# Claude Code
cd ~/Documents/Claude/AgentSim && claude -p "List 3 departments at Frontier Community Bank"

# Hermes
hermes --context ~/Documents/Claude/AgentSim chat "List 3 departments at Frontier Community Bank"

# OpenClaw
openclaw --workspace ~/Documents/Claude/AgentSim chat "List 3 departments at Frontier Community Bank"

# NemoClaw
nemoclaw --data-dir ~/Documents/Claude/AgentSim/data query "List 3 departments at Frontier Community Bank"
```

Each should return department names from the AgentSim org structure (e.g., Information Technology, Compliance, Commercial Lending).

---

## 7. Optional: Local Models via Ollama

For learners who want to run models locally -- useful for air-gapped environments, cost-free experimentation, or comparing local vs. API model behavior.

### Install Ollama

```bash
curl -fsSL https://ollama.ai/install.sh | sh
```

### Pull a model

```bash
ollama pull llama3
```

This downloads the Llama 3 model (~4GB). Other options:

```bash
ollama pull mistral        # Mistral 7B
ollama pull codellama      # Code-focused model
ollama pull phi3           # Microsoft Phi-3 (smaller, faster)
```

### Verify Ollama is running

```bash
ollama list
```

You should see your downloaded model(s).

### Connect to OpenClaw and NemoClaw

Both OpenClaw and NemoClaw can route to Ollama as a backend. This is useful for:

- **Air-gapped testing** -- no internet required after model download
- **Cost-free experimentation** -- no API charges
- **Model comparison labs** -- run the same prompt through different models

OpenClaw configuration (in `~/.openclaw/openclaw.json`):

```json
{
  "providers": {
    "ollama": {
      "endpoint": "http://localhost:11434",
      "model": "llama3"
    }
  }
}
```

NemoClaw configuration (in `~/.nemoclaw/config.yaml`):

```yaml
provider: ollama
endpoint: http://localhost:11434
model: llama3
```

---

## Troubleshooting

### "command not found" after installation

Your shell cannot find the installed binary. Common fixes:

```bash
# Check if npm global bin is in PATH
npm config get prefix
# Add to PATH if needed (add to ~/.zshrc or ~/.bashrc)
export PATH="$PATH:$(npm config get prefix)/bin"

# For pip-installed tools
export PATH="$PATH:$HOME/.local/bin"

# Reload your shell
source ~/.zshrc
```

### Node.js version too old

The curriculum requires Node.js 22+. Check your version:

```bash
node --version
```

If it is below v22, install the latest LTS:

```bash
# macOS with Homebrew
brew install node@22

# Or use nvm
nvm install 22
nvm use 22
```

### Python version issues

```bash
python3 --version
```

If Python 3 is not installed:

```bash
# macOS
brew install python3

# Linux
sudo apt install python3 python3-pip
```

### API key not recognized

- Make sure there are no extra spaces or quotes around the key
- Confirm the key is exported in your current shell session: `echo $ANTHROPIC_API_KEY`
- If using a `.env` file, make sure your framework supports it (Claude Code does, others may not)

### Ollama connection refused

```bash
# Check if Ollama is running
ollama list

# If not, start it
ollama serve
```

Ollama runs as a background service on port 11434. If the port is in use, check for conflicting services.

### AgentSim validation script fails

Common causes:

- Missing data files -- re-clone or re-download the AgentSim repository
- JSON syntax errors in data files -- run `python3 -m json.tool data/filename.json` to check
- Wrong working directory -- make sure you are in `~/Documents/Claude/AgentSim/`

### Permission errors on macOS

```bash
# If npm install -g fails
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

# Or use a different npm prefix
npm config set prefix ~/.npm-global
export PATH="$PATH:$HOME/.npm-global/bin"
```

---

## Next Step

Once all verifications pass, proceed to **Module 1: The Enterprise Environment**:

```
training/track-1-foundations/module-01-enterprise-environment/
```
