Skip to main content

The understanding layer for adaptive AI products

Project description

sxth-mind

The understanding layer for adaptive AI products.

License: MIT Python 3.10+ PyPI

Documentation · Examples · Contributing


What is sxth-mind?

sxth-mind is a cognitive state layer for AI applications. It accumulates understanding about users over time—detecting patterns, tracking journey stages, and adapting responses based on derived insights.

Use it to personalize any LLM-powered experience:

  • Chat assistants that remember user patterns across sessions
  • Personalized dashboards that adapt to user behavior
  • Content recommendations informed by journey stage
  • Proactive nudges triggered by inactivity or momentum drops
  • Any AI feature where understanding should evolve over time
from sxth_mind import Mind
from examples.sales import SalesAdapter

mind = Mind(adapter=SalesAdapter())

# Get user state to personalize any LLM call
state = await mind.get_state("user_1")
# → Use state["user_mind"]["patterns"] to customize prompts, UI, recommendations

# Or use the built-in chat with automatic state management
await mind.chat("user_1", "Following up with the enterprise lead")

Unlike chat history retrieval, sxth-mind maintains derived understanding that evolves with each interaction.


Why sxth-mind?

Derived understanding Not just retrieval—patterns, identity, and journey stage evolve with each interaction
Pluggable everything Bring your own LLM provider, storage backend, and domain adapter
Framework-agnostic Works with OpenAI, Anthropic, or any LLM. Not an agent framework—complements them

Installation

pip install sxth-mind[openai]      # With OpenAI provider
pip install sxth-mind[api]         # With HTTP API server
pip install sxth-mind[sqlite]      # With SQLite storage
pip install sxth-mind[all]         # Everything

Quick Start

import asyncio
from sxth_mind import Mind
from examples.sales import SalesAdapter

async def main():
    mind = Mind(adapter=SalesAdapter())

    # Chat - state accumulates automatically
    response = await mind.chat("user_1", "Working on the Acme deal")
    print(response)

    # Inspect what the Mind knows
    state = await mind.get_state("user_1")
    print(state["user_mind"]["patterns"])

    # Human-readable summary
    print(await mind.explain_state("user_1"))

asyncio.run(main())

Features

Core

  • Mind — Central abstraction coordinating state, LLM calls, and persistence
  • UserMind — User-level identity, patterns, and preferences
  • ProjectMind — Context-specific state (deals, habits, learning topics)
  • ConversationMemory — Sliding window of recent messages

Adapters

  • Domain-specific behavior — Define identity types, journey stages, and nudge templates
  • Three examples included — Sales, Habits, Learning
  • Build your own — Simple interface, full control

Proactive Intelligence

  • Nudge engine — Generate suggestions based on inactivity, momentum drops, patterns
  • Journey detection — Automatically track progression through stages
  • Pattern recognition — Detect recurring themes and behaviors

Infrastructure

  • Pluggable LLM providers — OpenAI included, bring your own
  • Pluggable storage — Memory (default), SQLite, or custom
  • HTTP API — FastAPI server for service deployment
  • CLI — Demo mode and server commands

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                           Mind                                   │
│                                                                  │
│   ┌─────────────┐  ┌─────────────┐  ┌─────────────┐            │
│   │  UserMind   │  │ ProjectMind │  │   Memory    │            │
│   │  (identity) │  │  (context)  │  │  (history)  │            │
│   └─────────────┘  └─────────────┘  └─────────────┘            │
└───────────────────────────┬─────────────────────────────────────┘
                            │
        ┌───────────────────┼───────────────────┐
        ▼                   ▼                   ▼
┌───────────────┐   ┌───────────────┐   ┌───────────────┐
│    Adapter    │   │   Provider    │   │    Storage    │
│  (domain)     │   │  (LLM)        │   │  (persist)    │
└───────────────┘   └───────────────┘   └───────────────┘

Example Adapters

Sales

from examples.sales import SalesAdapter
mind = Mind(adapter=SalesAdapter())

Tracks: outreach patterns, deal stages, follow-up frequency

Habits

from examples.habits import HabitCoachAdapter
mind = Mind(adapter=HabitCoachAdapter())

Tracks: streaks, blockers, recovery patterns

Learning

from examples.learning import LearningAdapter
mind = Mind(adapter=LearningAdapter())

Tracks: progress, stuck indicators, learning style


Build Your Own Adapter

from sxth_mind import BaseAdapter
from sxth_mind.schemas import ProjectMind

class MyAdapter(BaseAdapter):
    @property
    def name(self) -> str:
        return "my_app"

    def get_identity_types(self):
        return [
            {"key": "power_user", "traits": ["fast", "keyboard-driven"]},
            {"key": "casual", "traits": ["occasional", "exploratory"]},
        ]

    def get_journey_stages(self):
        return [
            {"key": "onboarding", "tone": "helpful"},
            {"key": "proficient", "tone": "efficient"},
        ]

    def detect_journey_stage(self, project_mind: ProjectMind) -> str:
        if project_mind.interaction_count < 5:
            return "onboarding"
        return "proficient"

    def get_nudge_templates(self):
        return {}

See docs/adapters.md for the full guide.


HTTP API

sxth-mind serve --adapter sales --port 8000
Method Endpoint Description
POST /chat Send a message
GET /state/{user_id} Get cognitive state
GET /explain/{user_id} Human-readable summary
GET /nudges/{user_id} Pending nudges

What sxth-mind is NOT

  • Not an agent framework — We don't plan or execute actions
  • Not a vector database — We don't do similarity search
  • Not chat history — We store derived understanding, not transcripts

sxth-mind is cognitive infrastructure. You bring the intelligence; we maintain the understanding.


Security

sxth-mind is a library you integrate into your application. Authentication, rate limiting, and network security are your responsibility. See SECURITY.md.


Contributing

We welcome contributions! See CONTRIBUTING.md.


Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sxth_mind-0.1.0.tar.gz (101.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sxth_mind-0.1.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file sxth_mind-0.1.0.tar.gz.

File metadata

  • Download URL: sxth_mind-0.1.0.tar.gz
  • Upload date:
  • Size: 101.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for sxth_mind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 423a90e8bfade144e210120f446a4df8b2e548fa43f08913fc6fc049aa9fbf7f
MD5 b285ec29be15a510b47abd8673328189
BLAKE2b-256 d20ae9e9cda4e71d086607745111378ff6126220e41b3256b73be8c889386f70

See more details on using hashes here.

File details

Details for the file sxth_mind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sxth_mind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for sxth_mind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bab02fdb0ee4a99e137de7697fdbbc43fd14f27794710a6dfc196a5c879e350
MD5 c3c10a1bb394ecb697f837bbae8f4d04
BLAKE2b-256 53148d0928aa677eaeece85c1fca1a798c6a05aadc845c0afb599a6148ab121e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page