Skip to main content

Mind

The Mind is the core abstraction in sxth-mind. It coordinates:
  • Adapter — Domain-specific behavior (identity types, journey stages, nudges)
  • Provider — LLM calls (OpenAI, custom, etc.)
  • Storage — Persistence (memory, SQLite, custom)

Creating a Mind

Core Methods

chat()

The primary interface. Handles everything automatically:
  1. Loads or creates UserMind and ProjectMind
  2. Builds context-aware prompt using the adapter
  3. Calls the LLM
  4. Updates state based on the interaction
  5. Returns the response

chat_stream()

Same as chat(), but yields tokens as they’re generated:

get_state()

Retrieve the current cognitive state for introspection or custom use:

explain_state()

Get a human-readable summary of what the Mind knows:

get_pending_nudges()

Retrieve proactive suggestions for a user:

Using State for Custom Personalization

You don’t have to use mind.chat(). Get state and use it however you want:
This makes sxth-mind useful for any AI-powered feature, not just chat.