Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 136 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ Chronicle includes an **interactive setup wizard** for easy configuration. The w

### Quick Start
```bash
# Run the interactive setup wizard from project root
uv run python wizard.py
# Run the interactive setup wizard from project root (recommended)
./wizard.sh

# Or use the quickstart guide for step-by-step instructions
# See quickstart.md for detailed walkthrough
# Or use direct command:
uv run --with-requirements setup-requirements.txt python wizard.py

# For step-by-step instructions, see quickstart.md
```
Comment on lines +29 to 36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Format shell script paths consistently to avoid bare URL linting warnings.

Lines 30-31 trigger MD034 (no-bare-urls) because ./wizard.sh appears without markdown formatting. Consider using inline code formatting to fix this.

🔧 Proposed fix for markdown formatting
 ### Quick Start
-```bash
+```bash
-# Run the interactive setup wizard from project root (recommended)
-./wizard.sh
+# Run the interactive setup wizard from project root (recommended)
+./wizard.sh

Or use inline code formatting:

-# Run the interactive setup wizard from project root (recommended)
-./wizard.sh
+# Run the interactive setup wizard from project root (recommended)
+`./wizard.sh`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Run the interactive setup wizard from project root (recommended)
./wizard.sh
# Or use the quickstart guide for step-by-step instructions
# See quickstart.md for detailed walkthrough
# Or use direct command:
uv run --with-requirements setup-requirements.txt python wizard.py
# For step-by-step instructions, see quickstart.md
```
# Run the interactive setup wizard from project root (recommended)
`./wizard.sh`
# Or use direct command:
uv run --with-requirements setup-requirements.txt python wizard.py
# For step-by-step instructions, see quickstart.md
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

30-30: Bare URL used

(MD034, no-bare-urls)


31-31: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In @CLAUDE.md around lines 29 - 36, The markdown shows bare shell commands
(`./wizard.sh` and `uv run --with-requirements setup-requirements.txt python
wizard.py`) which trigger MD034; wrap these paths in inline code or place the
whole snippet in a fenced code block (e.g., mark with ```bash) so the commands
are rendered as code and not treated as bare URLs; update the section around the
"Run the interactive setup wizard..." header to use inline backticks for each
command or convert the two lines into a single fenced bash block to satisfy the
linter.


**Note on Convenience Scripts**: Chronicle provides wrapper scripts (`./wizard.sh`, `./start.sh`, `./restart.sh`, `./stop.sh`, `./status.sh`) that simplify the longer `uv run --with-requirements setup-requirements.txt python` commands. Use these for everyday operations.

### Setup Documentation
For detailed setup instructions and troubleshooting, see:
- **[@quickstart.md](quickstart.md)**: Beginner-friendly step-by-step setup guide
- **[@Docs/init-system.md](Docs/init-system.md)**: Complete initialization system architecture and design
- **[@Docs/getting-started.md](Docs/getting-started.md)**: Technical quickstart with advanced configuration
- **[@backends/advanced/SETUP_SCRIPTS.md](backends/advanced/SETUP_SCRIPTS.md)**: Setup scripts reference and usage examples
- **[@backends/advanced/Docs/quickstart.md](backends/advanced/Docs/quickstart.md)**: Backend-specific setup guide

### Wizard Architecture
The initialization system uses a **root orchestrator pattern**:
Expand Down Expand Up @@ -381,6 +382,134 @@ docker compose down -v
docker compose up --build -d
```

## Add Existing Data

### Audio File Upload & Processing

The system supports processing existing audio files through the file upload API. This allows you to import and process pre-recorded conversations without requiring a live WebSocket connection.

**Upload and Process WAV Files:**
```bash
export USER_TOKEN="your-jwt-token"

# Upload single WAV file
curl -X POST "http://localhost:8000/api/process-audio-files" \
-H "Authorization: Bearer $USER_TOKEN" \
-F "files=@/path/to/audio.wav" \
-F "device_name=file_upload"

# Upload multiple WAV files
curl -X POST "http://localhost:8000/api/process-audio-files" \
-H "Authorization: Bearer $USER_TOKEN" \
-F "files=@/path/to/recording1.wav" \
-F "files=@/path/to/recording2.wav" \
-F "device_name=import_batch"
```

**Response Example:**
```json
{
"message": "Successfully processed 2 audio files",
"processed_files": [
{
"filename": "recording1.wav",
"sample_rate": 16000,
"channels": 1,
"duration_seconds": 120.5,
"size_bytes": 3856000
},
{
"filename": "recording2.wav",
"sample_rate": 44100,
"channels": 2,
"duration_seconds": 85.2,
"size_bytes": 7532800
}
],
"client_id": "user01-import_batch"
}
```

## HAVPE Relay Configuration

For ESP32 audio streaming using the HAVPE relay (`extras/havpe-relay/`):

```bash
# Environment variables for HAVPE relay
export AUTH_USERNAME="user@example.com" # Email address
export AUTH_PASSWORD="your-password"
export DEVICE_NAME="havpe" # Device identifier

# Run the relay
cd extras/havpe-relay
uv run python main.py --backend-url http://your-server:8000 --backend-ws-url ws://your-server:8000
```

The relay will automatically:
- Authenticate using `AUTH_USERNAME` (email address)
- Generate client ID as `objectid_suffix-havpe`
- Forward ESP32 audio to the backend with proper authentication
- Handle token refresh and reconnection

## Distributed Deployment

### Single Machine vs Distributed Setup

**Single Machine (Default):**
```bash
# Everything on one machine
docker compose up --build -d
```

**Distributed Setup (GPU + Backend separation):**

#### GPU Machine Setup
```bash
# Start GPU-accelerated services
cd extras/asr-services
docker compose up moonshine -d

cd extras/speaker-recognition
docker compose up --build -d

# Ollama with GPU support
docker run -d --gpus=all -p 11434:11434 \
-v ollama:/root/.ollama \
ollama/ollama:latest
```

#### Backend Machine Configuration
```bash
# .env configuration for distributed services
OLLAMA_BASE_URL=http://[gpu-machine-tailscale-ip]:11434
SPEAKER_SERVICE_URL=http://[gpu-machine-tailscale-ip]:8085
PARAKEET_ASR_URL=http://[gpu-machine-tailscale-ip]:8080

# Start lightweight backend services
docker compose up --build -d
```

#### Tailscale Networking
```bash
# Install on each machine
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

# Find machine IPs
tailscale ip -4
```

**Benefits of Distributed Setup:**
- GPU services on dedicated hardware
- Lightweight backend on VPS/Raspberry Pi
- Automatic Tailscale IP support (100.x.x.x) - no CORS configuration needed
- Encrypted inter-service communication

Comment on lines +502 to +507
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix grammar in benefits list.

Line 506 contains a grammar issue: "needed Encrypted" is nonstandard. The phrase should use proper verb agreement or restructuring.

✏️ Proposed fix for grammar
-**Benefits of Distributed Setup:**
-- GPU services on dedicated hardware
-- Lightweight backend on VPS/Raspberry Pi
-- Automatic Tailscale IP support (100.x.x.x) - no CORS configuration needed - Encrypted inter-service communication
-- Encrypted inter-service communication
+**Benefits of Distributed Setup:**
+- GPU services on dedicated hardware
+- Lightweight backend on VPS/Raspberry Pi
+- Automatic Tailscale IP support (100.x.x.x) - no CORS configuration needed
+- Encrypted inter-service communication
🧰 Tools
🪛 LanguageTool

[style] ~506-~506: The double modal “needed Encrypted” is nonstandard (only accepted in certain dialects). Consider “to be Encrypted”.
Context: ...x.x.x) - no CORS configuration needed - Encrypted inter-service communication **Service ...

(NEEDS_FIXED)

🤖 Prompt for AI Agents
In @CLAUDE.md around lines 502 - 507, The second line of the "Benefits of
Distributed Setup:" bullet list contains a run-on where "no CORS configuration
needed Encrypted inter-service communication" is merged; split or punctuate
these as two separate bullets (keep "Automatic Tailscale IP support (100.x.x.x)
- no CORS configuration needed" as one bullet and "Encrypted inter-service
communication" as its own bullet) or insert proper punctuation/conjunction
between them so the verb agreement and sentence boundaries are correct.

**Service Examples:**
- GPU machine: LLM inference, ASR, speaker recognition
- Backend machine: FastAPI, WebUI, databases
- Database machine: MongoDB, Qdrant (optional separation)

## Development Notes

### Package Management
Expand Down
8 changes: 4 additions & 4 deletions Docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ Backends and ASR services use standardized audio streaming:

### Single Machine (Recommended for beginners)
1. **Clone the repository**
2. **Run interactive setup**: `uv run --with-requirements setup-requirements.txt python init.py`
3. **Start all services**: `python services.py start --all --build`
2. **Run interactive setup**: `./wizard.sh`
3. **Start all services**: `./start.sh`
4. **Access WebUI**: `http://localhost:5173` for the React web dashboard

### Distributed Setup (Advanced users with multiple machines)
Expand Down Expand Up @@ -215,8 +215,8 @@ Backends and ASR services use standardized audio streaming:

### For Production Use
1. Use **Advanced Backend** for full features
2. Run the orchestrated setup: `uv run --with-requirements setup-requirements.txt python init.py`
3. Start all services: `python services.py start --all --build`
2. Run the orchestrated setup: `./wizard.sh`
3. Start all services: `./start.sh`
4. Access the Web UI at http://localhost:5173 for conversation management

### For OMI Users
Expand Down
Loading