Skip to content

Architecture

Sophia has one conversational runtime, one Discord retrieval pipeline and one identity. Conversations select the current exchange; durable tasks own work. Availability and source audiences determine where the identity can act and what it can disclose.

OwnerResponsibility
ConversationAdapterAuthenticated Discord event, requester, reply context, attachments, response visibility and delivery binding
AccessPolicyExplicit enabled locations, user/role grants, action tiers and current Ask/Auto decisions
Runtime / ExecutionControlNative tool loop, task binding, cancellation, steering, continuation and context capacity
ToolExecutorCapability validation, caller-owned approvals, serialized guild mutations, publication audiences and receipts
TaskStoreTask ownership, handoff, outcomes, working state, approvals, evidence, files and retention
ModelUsageProvider-attempt accounting across task work, compaction, transcription and dreaming
DiscordHistoryReaderSerialized page ingestion and checkpoint commits shared by refresh and backfill
UnifiedMessageRetrievalChronological and relevance retrieval, cursors, local index and live escalation
KnowledgeStore / DreamingServiceOne identity, audience-scoped memories, revisions, forgetting and idle consolidation
SkillStoreVersioned procedures, private learned drafts, retirement and provenance
TaskSandbox / ContainerSandboxOwned file operations and isolated code/media processing
ScheduleStore / SchedulerExplicit future work, occurrence claims, current authorization and delivery outcomes
ArtifactStoreDurable interactive card specification, state, serialization and retryable expiry cleanup

One startup listener owns each canonical storage root. A second process fails before login or interrupted-task recovery. There are no distributed workers or automatic task replays.

StoreContentsReset policy
storage/settings.jsonVersioned runtime preferences, availability, grants and protected channelsAtomic updates; category resets preserve unrelated configuration
storage/tasks.sqliteDurable task ledger, evidence, files, sources and usagePreserved by index/runtime reset
storage/knowledge.sqliteIdentity, memories, source tombstones and dream queuePreserved by index/runtime reset
storage/products.sqliteCards, schedules, skills and immutable skill revisionsPreserved by index/runtime reset
Configured operational SQLite databaseIndexed Discord messages and operational tracesRetrieval tables are reconstructible; reset migrates legacy durable records first

Settings and provider profiles are validated before use. Secrets remain in environment-backed credentials. OpenRouter supplies remote model access; configured compatible endpoints can override a profile. No model IDs are embedded in fallback source code. Configured modalities describe which inputs a model accepts; configuration alone is not a health check.

External prompts define runtime policy. The system prompt receives authenticated identifiers and machine configuration. Names, quotations, remembered facts, page text, media and prior results enter separately as source data. Compaction preserves the original request and complete tool-call/result groups; a summary cannot become system authority.

Core tools are initially visible and other schemas are discovered through tool_search. inspect_runtime exposes relevant configuration, current permission decisions and owned file metadata without credentials. Every schema follows the strict provider contract in AGENTS.md.

Reads run within the current grant. Changes require Ask approval or an applicable Auto grant within the permitted action tier. Protected targets remain protected. The executor saves mutation intent before dispatch and concrete output after success. An uncertain outcome pauses work and blocks replay. Owners can record what they verified before explicitly resuming; this attestation remains distinct from automated verification.

Cancellation and steering stop unstarted work at checkpoints. An external request already in flight can still complete. Approval and availability are rechecked before execution. Tasks have no default call, duration, continuation or note quota; an operator can set an explicit tool-call limit. Individual network/container operations remain bounded.

Code and decoders run inside the same unprivileged, network-disabled container boundary with no host mounts. Task files persist outside the disposable container. Image input, sampled video and source-labelled audio transcription remain distinct forms of evidence. Publication uses the normal action policy.

Dreaming processes delivered eligible conversations while idle. It can save supported memories and draft a procedure from demonstrated tools. Drafts remain private; publishing or promoting a procedure uses ordinary write approval. Scheduled work has an explicit owner, destination and timezone. Conditional checks may record a quiet completed result; failures remain reportable.

Source invalidation, shared crawl ownership, supported postcondition verification, provider accounting, private handoff, retention and migration review are implemented and tested. Remaining acceptance work and model-specific failures are tracked in the v5 plan. Docker integration is blocked by the local engine startup failure; no host execution fallback exists. Real Discord desktop/mobile behavior still needs direct acceptance testing.