# PeptBase Agent - Hermes Skill

## Overview

PeptBase Agent is a research-grade peptide intelligence API for use as a Hermes tool. It provides structured, citation-backed peptide research data through JSON endpoints at `https://agent.peptbase.xyz`.

## Base URL

```
https://agent.peptbase.xyz
```

## Authentication

PeptBase requires Solana wallet signature authentication. Hermes agents must complete the wallet challenge flow to obtain a session token before calling protected endpoints.

### Wallet Auth Flow

```
1. POST /api/auth/challenge       -> get challenge message
2. Sign message with Solana key   -> ed25519 signature (base58)
3. POST /api/auth/verify-wallet   -> get session token
4. Use: Authorization: Bearer <token>
```

**Step 1 - Get Challenge:**
```json
POST https://agent.peptbase.xyz/api/auth/challenge
{ "wallet_address": "<solana_pubkey>" }
```

**Step 2 - Sign** the returned `message` field with your Solana private key.

**Step 3 - Verify:**
```json
POST https://agent.peptbase.xyz/api/auth/verify-wallet
{
  "wallet_address": "<solana_pubkey>",
  "message": "<challenge_message>",
  "signature": "<base58_signature>"
}
```

**Step 4 - Authenticated requests:**
```
Authorization: Bearer <session.token>
```

## Hermes Tool Definitions

### peptbase_ask

**Description:** Ask PeptBase a peptide research question. Returns structured answer with mechanism, safety, dosing context, and citations.

**Input Schema:**
```json
{
  "type": "object",
  "required": ["question"],
  "properties": {
    "question": {
      "type": "string",
      "description": "A peptide research question"
    },
    "mode": {
      "type": "string",
      "enum": ["quick", "research", "deep"],
      "default": "research"
    },
    "provider": {
      "type": "string",
      "enum": ["local", "copilot"],
      "default": "copilot"
    }
  }
}
```

**Endpoint:** `POST https://agent.peptbase.xyz/api/agent`

---

### peptbase_compare

**Description:** Compare 2-4 peptides. Returns structured comparison with mechanisms, use cases, safety profiles, and citations.

**Input Schema:**
```json
{
  "type": "object",
  "required": ["peptides"],
  "properties": {
    "peptides": {
      "type": "array",
      "minItems": 2,
      "maxItems": 4,
      "items": { "type": "string" },
      "description": "Peptide slugs or names to compare"
    },
    "mode": {
      "type": "string",
      "enum": ["quick", "research", "deep"],
      "default": "research"
    },
    "provider": {
      "type": "string",
      "enum": ["local", "copilot"],
      "default": "copilot"
    }
  }
}
```

**Endpoint:** `POST https://agent.peptbase.xyz/api/compare`

---

### peptbase_protocol

**Description:** Build a research-context peptide stack for a specific goal and risk level. Not a treatment plan.

**Input Schema:**
```json
{
  "type": "object",
  "required": ["goal", "risk_level"],
  "properties": {
    "goal": {
      "type": "string",
      "enum": ["recovery", "longevity", "sleep", "fat_loss", "inflammation", "cognitive_support", "skin"]
    },
    "risk_level": {
      "type": "string",
      "enum": ["conservative", "balanced", "experimental"]
    },
    "mode": {
      "type": "string",
      "enum": ["quick", "research", "deep"],
      "default": "research"
    },
    "provider": {
      "type": "string",
      "enum": ["local", "copilot"],
      "default": "copilot"
    }
  }
}
```

**Endpoint:** `POST https://agent.peptbase.xyz/api/protocol`

---

### peptbase_get_profile

**Description:** Retrieve a full peptide profile by slug.

**Input Schema:**
```json
{
  "type": "object",
  "required": ["slug"],
  "properties": {
    "slug": {
      "type": "string",
      "description": "Peptide slug (e.g., bpc-157, tb-500, epithalon)"
    }
  }
}
```

**Endpoint:** `GET https://agent.peptbase.xyz/api/peptide/{slug}`

## Available Peptides (102 entries)

Categories: GH Secretagogues, Healing & Repair, Nootropic, Longevity

Common slugs: `bpc-157`, `tb-500`, `ipamorelin`, `cjc-1295`, `epithalon`, `selank`, `semax`, `mk-677`, `semaglutide-peptide`, `tirzepatide`, `ghk-cu`, `foxo4-dri`, `ss-31`

## Response Format

All responses include:
- Structured research data (mechanism, safety, dosing context, citations)
- Research limitations array
- Mandatory disclaimer: research/educational only, not medical advice

## Integration Notes

- All endpoints are read-only
- Responses are JSON-only
- Medical claims are automatically sanitized
- LLM-assisted endpoints have deterministic local fallback
- Session tokens expire (default 24h), re-authenticate when expired
- Rate limiting may apply in production
