Skip to main content

Getting Started with sxth-mind

This guide will walk you through building your first AI application with sxth-mind.

What You’ll Build

A simple sales assistant that:
  1. Remembers user context across conversations
  2. Detects patterns in user behavior
  3. Adapts its responses based on journey stage

Prerequisites

  • Python 3.10+
  • An OpenAI API key (or any LLM provider)

Installation

Step 1: Create Your First Mind

That’s it! The Mind will:
  • Create a UserMind for user_1 (first interaction)
  • Create a ProjectMind for the default project
  • Generate a context-aware response
  • Update state after the interaction

Step 2: See How State Accumulates

By the third message, the Mind knows:
  • User has been interacting about this deal
  • They’re in the “qualifying” or “proposing” stage
  • They’re asking about follow-up timing

Step 3: Add Persistence

By default, state is stored in memory and lost when the program exits. Add SQLite for persistence:
Now user state survives restarts.

Step 4: Configure the LLM Provider

By default, sxth-mind uses OpenAI with gpt-4o-mini. To customize:

Step 5: Run the HTTP API

For production use, run sxth-mind as an API server:
Then make requests:

Step 6: Try Different Adapters

sxth-mind comes with three example adapters:

Habits

Learning

Step 7: Build Your Own Adapter

Create an adapter for your domain:

Next Steps

  1. Read the full API docs - See all available methods and options
  2. Explore the example adapters - Study how Sales, Habits, and Learning work
  3. Check out the nudge engine - Add proactive outreach
  4. Join the community - Share your adapters and get help

Common Patterns

Multi-Project Support

Track multiple contexts per user:

Explain State for Debugging

Generate Nudges

Troubleshooting

”OpenAI package not installed"

"No module named ‘aiosqlite’"

"No response from LLM”

  1. Check your OPENAI_API_KEY environment variable
  2. Or pass the key explicitly: OpenAIProvider(api_key="sk-...")

State not persisting

Make sure you’re using SQLiteStorage:

Questions? Issues? Open a GitHub issue.