Skip to main content

Sovereign Minds Engine — Persistent AI companion with real memory

Project description

Sovyx

Self-hosted AI companion with a brain graph, a 7-phase cognitive loop, and 10 LLM providers.
Local-first. AGPL. Your hardware. Your data.

CI PyPI Python License Tests


Why Sovyx

Sovyx is an application, not a framework. Install it, point it at an API key, and talk to it from Telegram, Signal, the dashboard, or a microphone.

  • 10 LLM providers, your keys. Anthropic, OpenAI, Google, Ollama, xAI, DeepSeek, Mistral, Together, Groq, Fireworks. Complexity-based routing picks the right model per message. Streaming end-to-end.
  • Runs on a Raspberry Pi 5 or a rack server. Auto-detected hardware tier selects ONNX models that fit in 4 GB RAM. Same codebase, same config, any scale.
  • Memory that persists and consolidates. Brain graph in SQLite with hybrid vector + keyword retrieval, Hebbian learning, nightly dream cycles, and a PAD 3D emotional model. Not a vector dump -- a cognitive architecture.
  • No telemetry. No phone-home. AGPL-3.0. Your data stays in a SQLite file on your disk. The daemon never calls anywhere you didn't configure.

Quick Start

pip install sovyx
export ANTHROPIC_API_KEY=sk-ant-...   # or any of the 10 supported providers
sovyx init my-mind
sovyx start
[info] dashboard_listening       url=http://localhost:7777
[info] bridge_started            channels=3
[info] brain_loaded              concepts=1842 episodes=317
[info] cognitive_loop_ready      mind=my-mind

Open http://localhost:7777 and run sovyx token to get the auth token. Full setup in Getting Started.

What's Inside

Every inbound message -- Telegram, Signal, voice, or the dashboard -- enters the same cognitive loop. The loop assembles context from the brain graph, calls the LLM, executes tool calls if needed, and reflects the outcome back into memory. Consolidation and dream cycles run in the background to maintain the graph.

flowchart TB
    subgraph Channels
        TG[Telegram]
        SG[Signal]
        VX[Voice]
        WEB[Dashboard]
    end

    subgraph Engine
        BR[Bridge]
        GATE[CogLoopGate]

        subgraph CognitiveLoop["Cognitive Loop"]
            direction LR
            P[Perceive] --> AT[Attend] --> TH[Think] --> ACT[Act] --> RF[Reflect]
        end

        subgraph Safety
            PII[PII Guard]
            INJ[Injection Tracker]
            OUT[Output Guard]
            FIN[Financial Gate]
        end

        CTX[Context Assembler]
        LLM[LLM Router -- 10 providers]
        PLG[Plugin Executor]
    end

    subgraph Brain["Brain Graph -- SQLite + sqlite-vec"]
        CON[(Concepts)]
        EPI[(Episodes)]
        REL[(Relations)]
        EMB[Embeddings -- KNN + FTS5 + RRF]
    end

    subgraph Background
        CONS[Consolidation -- every 6h]
        DREAM[Dream -- nightly]
    end

    EB(((Event Bus)))

    TG & SG & VX & WEB -->|message| BR
    BR -->|perception| GATE
    GATE --> CognitiveLoop

    AT <-.-> Safety
    TH -->|query| CTX
    CTX -->|recall| Brain
    TH -->|generate / stream| LLM
    ACT -->|tool calls| PLG
    RF -->|"concepts + episodes + Hebbian"| Brain

    CONS -->|decay + merge| Brain
    DREAM -->|patterns| Brain

    CognitiveLoop -->|response| BR
    BR -->|reply| Channels

    CognitiveLoop --> EB
    EB -->|WebSocket| WEB

Features

Category What it does
Cognition 7-phase loop: Perceive, Attend, Think, Act, Reflect + periodic Consolidate + nightly Dream. PAD 3D emotional model (pleasure / arousal / dominance). Spreading activation across the concept graph.
LLM routing 10 providers with complexity-based tier selection (simple / moderate / complex). Per-provider circuit breaker. Daily and per-conversation cost caps. Cross-provider failover. Token-level streaming.
Voice Local STT (Moonshine ONNX) + TTS (Piper / Kokoro). SileroVAD. Wake word detection. Barge-in. Filler injection for perceived latency under 300 ms. Wyoming protocol. Streaming LLM chunks direct to TTS.
Channels Telegram, Signal, dashboard chat, CLI REPL (sovyx chat). Home Assistant plugin (4 domains, 8 tools). CalDAV plugin (6 read-only tools, Nextcloud / iCloud / Fastmail / Radicale).
Import Bring existing conversations from ChatGPT, Claude, Gemini, Grok. Import Obsidian vaults (frontmatter, wiki links, nested tags). Summary-first encoding with SHA-256 dedup.
Plugins 7 official plugins. @tool decorator SDK. 5-layer sandbox: AST scan, import guard, sandboxed HTTP (domain allowlist, rate limit, size cap), sandboxed filesystem, capability-based permissions. Hot reload.
Dashboard React 19 + TypeScript + Zustand. Real-time WebSocket. Brain graph visualization (force-graph-2d). Virtualized log viewer. Zod runtime response validation. Token auth. Dark mode. i18n.
Privacy Local-first. One SQLite file per mind. Zero telemetry by default. AGPL-3.0. No cloud requirement. Optional Sovyx Cloud for teams.

Plugin Example

from sovyx.plugins.sdk import ISovyxPlugin, tool


class WeatherPlugin(ISovyxPlugin):
    name = "weather"
    version = "1.0.0"
    description = "Current weather and forecasts via Open-Meteo."

    @tool(description="Get current weather for a city.")
    async def get_weather(self, city: str) -> str:
        from sovyx.plugins.sandbox_http import SandboxedHttpClient
        async with SandboxedHttpClient(
            plugin_name="weather",
            allowed_domains=["api.open-meteo.com"],
        ) as client:
            resp = await client.get(
                "https://api.open-meteo.com/v1/forecast",
                params={"latitude": "...", "longitude": "..."},
            )
        return resp.text
sovyx plugin list                 # installed plugins
sovyx plugin create my-plugin     # scaffold
sovyx plugin validate ./my-plugin # manifest + AST + permissions check
sovyx plugin install ./my-plugin  # hot-load into running daemon

Configuration

Three sources in priority order: environment variables (SOVYX_*), YAML files (system.yaml + mind.yaml), built-in defaults.

# ~/.sovyx/my-mind/mind.yaml
name: my-mind
language: en

personality:
  tone: warm
  humor: 0.4
  empathy: 0.8

llm:
  budget_daily_usd: 2.0

channels:
  telegram:
    enabled: true
    token_env: SOVYX_TELEGRAM_TOKEN

Full reference in Configuration.

Sovyx Cloud

Hosted offering for teams and power users. Encrypted relay, managed backup, orchestrated models, plugin marketplace. Runs on top of the same open-source engine.

Details at sovyx.ai.

Documentation

Development

git clone https://github.com/sovyx-ai/sovyx.git && cd sovyx
uv sync --dev
uv run python -m pytest tests/ --ignore=tests/smoke --timeout=30  # ~7,960 backend tests
cd dashboard && npx vitest run                                     # ~820 frontend tests

Read CLAUDE.md before your first PR -- it covers stack, conventions, anti-patterns, and the quality gates CI enforces (ruff, mypy strict, bandit, pytest 3.11 + 3.12, vitest, tsc).

Contributing

Issues and pull requests welcome. Please read CONTRIBUTING.md and the Code of Conduct first.

License

AGPL-3.0-or-later

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

sovyx-0.16.12.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

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

sovyx-0.16.12-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file sovyx-0.16.12.tar.gz.

File metadata

  • Download URL: sovyx-0.16.12.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sovyx-0.16.12.tar.gz
Algorithm Hash digest
SHA256 2e56a4b1f55962348746827cea42a1ff7cbeafdde6737d7672f9fb704e9b3d13
MD5 8f5073c8bac3eafc97f22c55fd94fd41
BLAKE2b-256 b8adca8c9d37931a88594e37714caf8cf424bb12e8efc80e302d96b937d36948

See more details on using hashes here.

Provenance

The following attestation bundles were made for sovyx-0.16.12.tar.gz:

Publisher: publish.yml on sovyx-ai/sovyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sovyx-0.16.12-py3-none-any.whl.

File metadata

  • Download URL: sovyx-0.16.12-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sovyx-0.16.12-py3-none-any.whl
Algorithm Hash digest
SHA256 240ed9e545f55110e1f7d9fb8d44160646ac502dffd1eca14afcc0d0eab3e6a7
MD5 4433c7358aaa83e75185ed1500c79b11
BLAKE2b-256 c846f712686ab590db6e62eac13d0070f8e2afe4efa102c0819fe32b1c40e4cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sovyx-0.16.12-py3-none-any.whl:

Publisher: publish.yml on sovyx-ai/sovyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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