Skip to main content

Advanced Settings

This guide covers advanced configuration options for power users who want to customize every aspect of their ClawBook AI assistant.

AI Response Configuration

Model Parameters

Fine-tune how your AI generates responses:

Model Settings:
temperature: 0.7 # Creativity (0=deterministic, 2=very random)
top_p: 1.0 # Nucleus sampling (0.1=focused, 1=all options)
top_k: 40 # Limit vocab choices (lower=more focused)
frequency_penalty: 0 # Reduce word repetition (0-2)
presence_penalty: 0 # Encourage new topics (0-2)
max_tokens: 2048 # Maximum response length

Temperature Guide

ValueBehaviorBest For
0.0Deterministic, same input = same outputMath, code, facts
0.3Focused, predictableTechnical support
0.7Balanced (recommended)General use
1.0Creative, variedCreative writing
1.5+Random, unpredictableBrainstorming

System Prompt Templates

Customize your assistant's personality:

Professional Assistant

You are a professional AI assistant. Be concise, accurate, and helpful.
Always cite sources when providing factual information.
If uncertain, say so rather than guessing.

Friendly Helper

You are Claw, a friendly and enthusiastic AI assistant!
Use a warm, conversational tone. Emojis are welcome 😊
Make complex topics easy to understand.

Technical Expert

You are a senior software engineer with expertise in all major programming languages.
Provide code examples when relevant. Explain your reasoning.
Follow best practices and mention potential edge cases.

Custom Persona

You are {name}, an AI assistant for {company}.
Your role is to help customers with {domain} questions.
Always maintain a {tone} tone.
When you don't know something, direct users to {fallback}.

Conversation Management

Context Window

Control how much history the AI remembers:

Context Settings:
max_messages: 20 # Messages to include in context
max_tokens: 4000 # Token limit for history
time_window: 24h # Expire old context after
include_system_prompt: true
summarize_long_conversations: true

Conversation Threading

Threading:
auto_thread_after: 10 # Create thread after N messages
thread_title_generation: true
separate_context_per_thread: true

Memory & Persistence

Long-term memory across conversations:

Memory:
enabled: true
remember_user_preferences: true
remember_facts_mentioned: true
max_memories_per_user: 100
memory_decay_days: 90

Rate Limiting & Quotas

Per-User Limits

User Limits:
messages_per_minute: 10
messages_per_hour: 100
messages_per_day: 500
max_tokens_per_message: 2000
max_conversation_length: 50

Per-Platform Limits

Platform Limits:
whatsapp:
messages_per_minute: 10
burst_limit: 5
telegram:
messages_per_minute: 15
burst_limit: 10
discord:
messages_per_minute: 5
burst_limit: 3

Cost Controls

Cost Limits:
daily_limit_usd: 10.00
monthly_limit_usd: 100.00
alert_at_percentage: [50, 75, 90]
action_at_limit: "switch_to_cheaper_model" # or "block"
cheaper_model: "claude-3-haiku-20240307"

Response Processing

Pre-Processing

Process incoming messages before sending to AI:

Pre-Processing:
trim_whitespace: true
normalize_unicode: true
remove_urls: false
translate_to_english: false # Uses separate translation API
detect_language: true

# Content moderation
block_profanity: false
block_patterns:
- "password.*is"
- "credit.*card"

Post-Processing

Process AI responses before sending:

Post-Processing:
# Formatting
convert_markdown: true
max_line_length: 80
add_spacing: true

# Content
remove_disclaimers: false
append_signature: false
signature_text: "— Powered by ClawBook"

# Links
expand_short_urls: true
add_link_previews: true

Response Filters

Filters:
# Block responses containing
blocked_phrases:
- "I cannot"
- "As an AI"

# Replace phrases
replacements:
"I don't have access": "Let me find out"
"I cannot browse": "I can help with"

Webhook Integration

Outgoing Webhooks

Send events to external services:

Webhooks:
message_received:
url: https://your-app.com/webhook/message
method: POST
headers:
Authorization: "Bearer xxx"

response_sent:
url: https://your-app.com/webhook/response
include_content: true

error_occurred:
url: https://your-app.com/webhook/error
retry_count: 3

Incoming Webhooks

Receive external triggers:

Incoming Webhooks:
enabled: true
endpoint: /api/webhook/incoming
secret: your-webhook-secret
actions:
- send_message
- clear_context
- change_model

Custom Commands

Define your own commands:

Custom Commands:
/weather:
description: "Get weather information"
handler: "api"
api_url: "https://api.weather.com/v1/current"
response_template: "Weather in {location}: {temp}°F, {condition}"

/translate:
description: "Translate text"
handler: "ai"
system_prompt: "You are a translator. Translate the following to {language}:"

/summarize:
description: "Summarize a URL"
handler: "ai"
fetch_url: true
system_prompt: "Summarize this article in 3 bullet points:"

Logging & Analytics

Log Levels

Logging:
level: INFO # DEBUG, INFO, WARNING, ERROR
include_messages: false # Privacy: don't log message content
include_metadata: true

destinations:
- file: /var/log/openclaw/app.log
- syslog: true
- webhook: https://logging.service.com/ingest

Analytics

Analytics:
enabled: true
track:
- messages_per_day
- tokens_used
- response_times
- error_rates
- user_satisfaction

export:
format: csv
schedule: weekly
destination: email

Performance Tuning

Caching

Cache:
enabled: true
ttl: 3600 # 1 hour
max_size: 1000 # entries

cache_types:
- api_responses
- user_preferences
- static_content

Connection Pooling

Connections:
database:
pool_size: 10
max_overflow: 20
timeout: 30

api:
max_connections: 50
keep_alive: true

Resource Limits

Resources:
max_memory_mb: 2048
max_cpu_percent: 80
request_timeout_ms: 30000
queue_size: 100

Security Settings

Encryption

Encryption:
at_rest: AES-256
in_transit: TLS 1.3
key_rotation_days: 90

Access Control

Access Control:
require_authentication: true
session_timeout_minutes: 60
max_failed_attempts: 5
lockout_duration_minutes: 30

ip_whitelist:
- 192.168.1.0/24
- 10.0.0.0/8

Audit Trail

Audit:
enabled: true
log_all_access: true
log_config_changes: true
retention_days: 365
tamper_proof: true

Configuration File

All settings can be managed via config file:

/etc/openclaw/config.yaml

Example structure:

# /etc/openclaw/config.yaml
version: "1.0"

ai:
provider: anthropic
model: claude-3-5-sonnet-20241022
temperature: 0.7
max_tokens: 2048

integrations:
whatsapp:
enabled: true
trigger: prefix
prefix: "/ai"

telegram:
enabled: true
trigger: always

discord:
enabled: false

security:
require_auth: true
session_timeout: 60

# ... more settings

Apply changes:

sudo systemctl restart openclaw

Environment Variables

Override config with environment variables:

# /etc/openclaw/env
OPENCLAW_AI_PROVIDER=anthropic
OPENCLAW_AI_MODEL=claude-3-5-sonnet-20241022
OPENCLAW_AI_API_KEY=sk-ant-xxx
OPENCLAW_LOG_LEVEL=DEBUG

Next Steps