Building Adapters
This guide explains how to build your own adapter for sxth-mind.What is an Adapter?
An adapter defines domain-specific behavior for your application. It tells the Mind:- What identity types exist (e.g., sales rep styles, learning types)
- What journey stages look like (e.g., prospecting → closing)
- How to detect the current stage from state
- What nudges to send when patterns emerge
- How to build system prompts with domain context
Minimal Adapter
Here’s the simplest possible adapter:Full Adapter Example
Here’s a more complete example for a customer support domain:Key Methods to Override
Required
| Method | Purpose |
|---|---|
name | Unique identifier for your adapter |
get_identity_types() | Define user archetypes |
get_journey_stages() | Define progression stages |
detect_journey_stage() | Logic to determine current stage |
get_nudge_templates() | Proactive message templates |
get_insight_types() | Types of insights to surface |
Optional (but recommended)
| Method | Purpose |
|---|---|
display_name | Human-readable name |
get_system_prompt() | Custom AI instructions |
update_after_interaction() | Custom state updates |
get_context_for_prompt() | Additional prompt context |
Journey Stages
Stages define the user’s progression. Each stage should have:Stage Detection
Thedetect_journey_stage() method determines which stage a user is in. You can use:
- Explicit context: Check
project_mind.get_context_field("stage") - Interaction count:
project_mind.interaction_count - Momentum:
project_mind.momentum_score - Days since activity:
project_mind.days_since_activity - Progress data:
project_mind.get_progress_field("key") - User patterns:
user_mind.patterns
Identity Types
Identity types help personalize responses. Define traits that matter for your domain:user_mind.identity_type and additional data in user_mind.identity_data.
Pattern Detection
Overrideupdate_after_interaction() to detect domain-specific patterns:
Nudge Templates
Nudges are proactive messages. Define templates with placeholders:Testing Your Adapter
Using Your Adapter
Best Practices
Start simple
Start simple
Begin with basic stages, add complexity as needed. You can always add more identity types and stages later.
Test stage detection
Test stage detection
Make sure transitions happen when expected. Write unit tests for
detect_journey_stage().Be specific in guidance
Be specific in guidance
Tell the AI exactly how to behave at each stage. Vague guidance leads to inconsistent responses.
Track meaningful patterns
Track meaningful patterns
Only detect patterns you’ll actually use. Every pattern adds complexity.
Keep nudges helpful
Keep nudges helpful
Don’t spam; nudge when there’s real value. Users will mute aggressive nudges.

