# 5-Minute Quickstart: sigil-agent

Get from install to first persona injection in under 5 minutes.

## 1. Install

```bash
pip install sigil-agent
```

## 2. Get an API Key

Sign up at [https://sigil.l8ntlabs.com](https://sigil.l8ntlabs.com) and create an API key.

## 3. Initialize the Client

```python
from sigil import SigilClient

# Pass API key directly
client = SigilClient(
    api_key="sk_your_api_key",
    base_url="https://api.sigil.l8ntlabs.com"
)

# Or use environment variables
# export SIGIL_API_KEY="sk_your_api_key"
# export SIGIL_BASE_URL="https://api.sigil.l8ntlabs.com"
client = SigilClient()
```

## 4. Fetch a Persona

```python
# Get the latest version
persona = client.get("staccato")

# Access persona fields
print(persona.name)     # "staccato"
print(persona.version)  # "1.0.0"
print(persona.soul)     # The core character description
```

## 5. Inject into a System Prompt

```python
# Basic injection - generates a complete system prompt
system_prompt = persona.inject()

# With a base prompt prepended
system_prompt = persona.inject(base="You are an AI assistant for Acme Corp.")
```

## 6. Use with OpenAI

```python
from openai import OpenAI
from sigil import SigilClient

# Load persona
sigil = SigilClient(api_key="sk_...")
persona = sigil.get("staccato")

# Create system prompt
system_prompt = persona.inject(base="You help users with technical questions.")

# Use with OpenAI
openai = OpenAI()
response = openai.chat.completions.create(
    model="gpt-4",
    messages=[
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": "How do I deploy to production?"}
    ]
)
```

## 7. Use with Anthropic

```python
import anthropic
from sigil import SigilClient

# Load persona
sigil = SigilClient(api_key="sk_...")
persona = sigil.get("staccato")

# Create system prompt
system_prompt = persona.inject()

# Use with Anthropic
client = anthropic.Anthropic()
message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    system=system_prompt,
    messages=[
        {"role": "user", "content": "How do I deploy to production?"}
    ]
)
```

## 8. Version Pinning

```python
# Pin to a specific version for reproducibility
persona = client.get("staccato", version="1.0.0")

# This ensures your agent's behavior doesn't change
# when the persona is updated in the registry
```

## 9. Accessing Persona Fields

```python
persona = client.get("staccato")

# Voice configuration
print(persona.voice.tone)           # ["direct", "clear"]
print(persona.voice.dos)            # ["Be concise", ...]
print(persona.voice.donts)          # ["Don't hedge", ...]
print(persona.voice.example_phrases) # ["Here's the answer:", ...]

# Values (sorted by priority)
for value in persona.values:
    print(f"{value.name}: {value.description}")

# Behavioral map
for key, entry in persona.behavioral_map.items():
    print(f"{key}: {entry.posture}")
```

## 10. Error Handling

```python
from sigil import (
    SigilClient,
    SigilError,
    SigilAuthError,
    SigilNotFoundError
)

client = SigilClient(api_key="sk_...")

try:
    persona = client.get("my-persona")
except SigilNotFoundError:
    print("Persona not found - check the name")
except SigilAuthError:
    print("Invalid API key")
except SigilError as e:
    print(f"API error: {e.message} (status: {e.status_code})")
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `SIGIL_API_KEY` | Your API key | (required) |
| `SIGIL_BASE_URL` | API base URL | `http://localhost:8100` |

## Next Steps

- Read the full [README](https://github.com/l8ntlabs/sigil-sdk) for advanced usage
- Explore the [API reference](https://sigil.l8ntlabs.com/docs) for all available endpoints
- Join the waitlist at [sigil.l8ntlabs.com](https://sigil.l8ntlabs.com) for early access
