Skip to main content

Storage

sxth-mind supports pluggable storage backends for persisting the belief state — the cognitive model it owns (UserMind, ProjectMind, Nudge).
Storage persists beliefs, not raw bytes. Raw conversation turns and events live behind a separate EvidenceSource that sxth-mind reads but does not own — “own the beliefs, rent the bytes.” If you’re looking for where message history is kept, that’s the evidence source, not storage.

Available Backends

Memory (Default)

In-memory storage. Data is lost when the process exits. Good for development and testing.

SQLite

Persistent storage using SQLite. Good for single-server deployments.
The SQLite storage automatically creates these tables:
  • user_minds — User-level belief state
  • project_minds — Project-specific belief state
  • nudges — Proactive suggestions

Custom Storage

Implement the BaseStorage interface for custom backends (Redis, PostgreSQL, MongoDB, etc.):
There are no memory/message methods on BaseStorage — raw history is the EvidenceSource’s job, not storage’s.
Then use it:

Storage Lifecycle

When using the HTTP API, storage is initialized and closed automatically via FastAPI’s lifespan:
For direct usage, initialize manually if needed:

Data Model

All storage backends persist these entities: Raw message/event history is not a storage entity — it lives behind the EvidenceSource. Data is serialized as JSON using Pydantic’s model_dump_json() and deserialized with model_validate_json().