> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 5-Minute Quickstart

> Deploy your first AI agent and see StateSet in action

# From Zero to Autonomous in 5 Minutes

<Check>
  **Time to first value: 5 minutes**

  By the end of this guide, you'll have a live AI agent handling real customer
  conversations.
</Check>

## What You'll Build

Here's what we'll accomplish together in the next 5 minutes:

<Steps>
  <Step title="Create Account">Sign up for StateSet and verify your email</Step>
  <Step title="Deploy Agent">Launch your AI customer service agent</Step>
  <Step title="Send Message">Test your agent with real conversations</Step>
  <Step title="See Action">Watch autonomous operations in real-time</Step>
</Steps>

## Prerequisites

Before we begin, ensure you have:

| Requirement      | Why You Need It                |
| ---------------- | ------------------------------ |
| 🌐 Web browser   | Access StateSet dashboard      |
| ✉️ Email address | Create and verify your account |
| ⏱️ 5 minutes     | Complete the entire quickstart |

***

## Step 1: Create Your Account

**Time investment: 30 seconds**

1. Go to [stateset.com/sign-up](https://stateset.com/sign-up)
2. Enter your email address
3. Click the verification link sent to your inbox
4. You're now in your StateSet dashboard!

<Info>
  **Prefer code-first setup?**

  You can skip the dashboard and jump straight to the SDK option in Step 2
  below.
</Info>

***

## Step 2: Deploy Your First Agent

**Time investment: 2 minutes**

### Option A: One-Click Deploy (Recommended)

In your dashboard, click the **"Deploy Agent"** button and choose from our pre-configured options:

<CardGroup cols={2}>
  <Card title="Customer Service Pro" icon="headset">
    Pre-trained on 10M+ support conversations. Perfect for handling: - Product
    inquiries - Order tracking - Returns processing - Technical issues
  </Card>

  <Card title="Sales Assistant" icon="chart-line">
    Optimized for driving revenue and conversions. Specializes in: - Lead
    qualification - Product recommendations - Quote generation - Demo scheduling
  </Card>

  <Card title="Operations Manager" icon="cogs">
    Handles backend operations seamlessly. Expert in: - Order fulfillment -
    Inventory management - Logistics coordination - Vendor communications
  </Card>
</CardGroup>

### Option B: Deploy via Code

Install the required packages:

```bash theme={null}
npm install stateset-node dotenv winston
```

Create your agent file (`agent.js`):

```javascript title="agent.js" theme={null}
import { StateSetClient } from "stateset-node";
import dotenv from "dotenv";
import winston from "winston";

// Load environment variables
dotenv.config();

// Configure logger
const logger = winston.createLogger({
  level: process.env.LOG_LEVEL || "info",
  format: winston.format.json(),
  transports: [new winston.transports.Console()],
});

// Initialize StateSet client
const client = new StateSetClient({
  apiKey: process.env.STATESET_API_KEY,
});

// Deploy agent
async function deployAgent() {
  try {
    const agent = await client.agents.create({
      name: "Alex",
      role: "Customer Success Specialist",
      personality: {
        tone: "friendly",
        style: "solution-oriented",
        traits: ["empathetic", "knowledgeable"],
      },
      greeting: "Hi! I'm Alex from customer success. How can I help you today?",
      capabilities: [
        "answer_product_questions",
        "track_orders",
        "process_returns",
        "technical_support",
        "escalate_issues",
      ],
    });

    logger.info("Agent deployed successfully", {
      agentId: agent.id,
    });

    logger.info("Chat URL", {
      url: `https://app.stateset.com/chat/${agent.id}`,
    });

    return agent;
  } catch (error) {
    logger.error("Agent deployment failed", {
      message: error.message,
      code: error.code,
      requestId: error.request_id,
    });
    throw error;
  }
}

// Execute deployment
deployAgent()
  .then((agent) => console.log(`Agent ${agent.name} is live!`))
  .catch((error) => console.error("Deployment failed:", error.message));
```

Set your API key in `.env`:

```bash title=".env" theme={null}
STATESET_API_KEY=your_api_key_here
LOG_LEVEL=info
```

Run your application:

```bash theme={null}
node agent.js
```

***

## Step 3: Test Your Agent

**Time investment: 1 minute**

### Test via Live Chat

Open the chat URL from your deployment and try these test messages:

```text theme={null}
"Hi, I need help with my order"
"What's your return policy?"
"I'm having trouble logging in"
"Can you help me track order #12345?"
```

### Test via API

Send a message programmatically:

```bash title="Send message via API" theme={null}
curl -X POST https://api.stateset.com/v1/messages \
  -H "Authorization: Bearer ${STATESET_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "agent_xxx",
    "body": "Hello, I need help with my order",
    "is_public": true
  }'
```

<Tabs>
  <tab title="Response">
    ```json title="API Response" theme={null}
    {
      "id": "msg_123",
      "to": "agent_xxx",
      "body": "Hello, I need help with my order",
      "created_at": "2025-01-01T12:00:00Z",
      "status": "queued"
    }
    ```
  </tab>

  <tab title="Error Handling">
    ```json title="Error Response" theme={null}
    {
      "error": {
        "code": "invalid_api_key",
        "message": "Invalid or expired API key"
      }
    }
    ```
  </tab>
</Tabs>

***

## Step 4: Verify & Monitor

**Time investment: 1.5 minutes**

### Real-Time Analytics Dashboard

Track your agent's performance:

1. Navigate to your [StateSet Dashboard](https://app.stateset.com)
2. Click **"Agent Analytics"**
3. Monitor these key metrics:

| Metric             | What It Shows                         |
| ------------------ | ------------------------------------- |
| 🎯 Conversations   | Total messages handled                |
| ⚡ Response Time    | Average time to reply (usually \< 1s) |
| 😊 CSAT Score      | Customer satisfaction rating          |
| 📈 Resolution Rate | Issues solved autonomously            |

### What Just Happened?

Your AI agent is now:

* ✨ **Learning** from every interaction to improve
* 📈 **Improving** response quality automatically
* 🔄 **Scaling** to handle unlimited conversations
* ⏰ **Operating** 24/7 without breaks
* 🔒 **Secure** with enterprise-grade protection

***

## Explore Your Agent's Capabilities

Your agent comes pre-configured with powerful capabilities:

<Tabs>
  <tab title="Customer Service">
    * Answer product and feature questions - Track orders and shipment status -
      Process returns and refund requests - Handle complaints with empathy -
      Escalate complex issues to humans
  </tab>

  <tab title="Sales Support">
    * Qualify incoming leads automatically - Recommend products based on needs -
      Apply promotional discount codes - Upsell related products and services -
      Schedule product demos with sales team
  </tab>

  <tab title="Technical Support">
    * Troubleshoot common technical issues - Guide users through setup processes
    * Reset passwords and manage accounts - Check system and service status -
      Create and update support tickets
  </tab>
</Tabs>

***

## Next Steps: Level Up Your Agent

**Optional enhancements**

### Add Your Knowledge Base

**Time: 2 minutes**

Make your agent an expert on your products and services:

```javascript title="Add knowledge base" theme={null}
const kb = await client.knowledgeBase.create({
  name: "Product Documentation",
  agent_id: agent.id,
});

// Upload your documentation
await kb.uploadDocument("./product-guide.pdf");
await kb.uploadDocument("./faq.md");
await kb.uploadDocument("./api-reference.md");

// Your agent now knows everything in your docs!
logger.info("Knowledge base updated", {
  documents: 3,
  agentId: agent.id,
});
```

### Connect Your Systems

**Time: 5 minutes**

Enable your agent to take real actions:

```javascript title="Add system integration" theme={null}
await agent.addIntegration({
  type: "webhook",
  name: "order_lookup",
  endpoint: "https://api.yourstore.com/orders",
  method: "GET",
  authentication: {
    type: "api_key",
    header: "X-API-Key",
    key: process.env.STORE_API_KEY,
  },
  // Define response mapping
  mapping: {
    orderId: "$.order_id",
    status: "$.status",
    items: "$.items[*].name",
  },
});

logger.info("Integration added", {
  type: "order_lookup",
  agentId: agent.id,
});
```

### Deploy to Your Website

**Time: 3 minutes**

Add a chat widget to your site:

```html title="Add chat widget to your website"> theme={null}
<head>
  <script src="https://cdn.stateset.com/widget.js"></script>
</head>
<body>
  <script>
    StateSet.init({
      agentId: 'agent_xxx',
      position: 'bottom-right',
      primaryColor: '#6366f1',
      greeting: 'Hi! How can I help you today?',
      // Customize widget behavior
      autoOpen: false,
      minimizeOnMobile: true,
      branding: 'custom'
    });
  </script>
</body>
</html>
```

***

## Common Questions

<AccordionGroup>
  <Accordion title="How much does this cost?">
    Your first 1,000 conversations are completely free. After that:

    | Plan       | Price               | What You Get                                   |
    | ---------- | ------------------- | ---------------------------------------------- |
    | Starter    | \$0.50/conversation | Up to 10K conversations/month                  |
    | Growth     | Custom pricing      | Unlimited conversations + priority support     |
    | Enterprise | Custom              | Dedicated infrastructure + custom integrations |

    You only pay for **successfully resolved** conversations.
  </Accordion>

  <Accordion title="Can I customize the agent's responses?">
    Absolutely! You can fully customize:

    * **Personality**: Define tone, style, and Traits
    * **Knowledge**: Train on your own documentation
    * **Responses**: Provide templates and examples
    * **Correction**: Refine responses in real-time
    * **Integrations**: Connect to any system via API

    Your agent learns from every correction you make.
  </Accordion>

  <Accordion title="What about data security and privacy?">
    StateSet takes security seriously:

    * 🔒 **SOC 2 Type I** — independent assessment of control design
    * 🛡️ **End-to-end encryption** at rest and in transit
    * 📋 **GDPR compliant** data handling
    * 👥 **Role-based access control** for team management
    * 📊 **Complete audit logs** of all activities

    We never train on your data without explicit permission.
  </Accordion>

  <Accordion title="Can it integrate with my existing tools?">
    Yes! Integration options include:

    * **Pre-built integrations**: 100+ tools supported (Shopify, NetSuite, Zendesk, etc.)
    * **Custom API**: Flexible REST/GraphQL endpoints
    * **Webhooks**: Real-time event notifications
    * **SDK support**: Official libraries for 11+ languages
    * **Middleware**: Zapier, Make, and custom solutions

    See our [Integration Guide](/api-reference/integrations) for details.
  </Accordion>
</AccordionGroup>

***

## Summary

In just 5 minutes, you've:

✅ Created your StateSet account\
✅ Deployed a fully functional AI agent\
✅ Tested real conversations\
✅ Monitored performance metrics

### Your Agent Can Now:

| Capability                                      | Benefit                           |
| ----------------------------------------------- | --------------------------------- |
| 🎯 Handle multiple conversations simultaneously | Scale without headcount           |
| 📈 Improve response quality over time           | Get better with every interaction |
| ⏰ Operate continuously without breaks           | 24/7 availability                 |
| 🔒 Connect securely to your systems             | Safe, autonomous operations       |
| 📊 Provide detailed analytics                   | Data-driven insights              |

***

## Ready for More?

<CardGroup cols={2}>
  <Card title="Full Developer Guide" icon="code" href="/development">
    Deep dive into building advanced features with StateSet
  </Card>

  <Card title="Agent Training Guide" icon="graduation-cap" href="/guides/agent-trainer-guide">
    Make your agents even smarter with custom training
  </Card>

  <Card title="Integration Library" icon="plug" href="/guides/integrations">
    Connect to 100+ pre-built integrations
  </Card>

  <Card title="Community & Support" icon="discord" href="https://discord.gg/stateset">
    Connect with 5,000+ developers and get help
  </Card>
</CardGroup>

***

<Info>
  **Next: Monitor Your Agent**

  Visit the **Agent Analytics** tab in your dashboard to track conversation
  volume, resolution rate, and customer satisfaction scores. Use these metrics
  to identify areas where your agent's knowledge base can be expanded.
</Info>

<Tip>
  **Need help?**

  Our AI-powered support team (yes, real AI agents!) is standing by:

  * 📧 Email: [support@stateset.com](mailto:support@stateset.com)
  * 💬 Chat: Click the bubble below
  * 🎙️ Discord: [Join our community](https://discord.gg/stateset)

  Average response time: \< 2 minutes
</Tip>
