Skip to main content

Sovereign Minds Engine — Persistent AI companion with real memory

Project description

Sovyx

Self-hosted AI companion with persistent memory.

CI PyPI Python License Tests


What it is

Sovyx is a Python daemon that runs a cognitive loop — Perceive → Attend → Think → Act → Reflect — against a local brain graph and any LLM provider you point it at. It's for developers and self-hosters who want an AI that remembers across sessions, runs on a Raspberry Pi 5, and keeps its memory in a SQLite file on their own disk.

It's an application, not a framework. Install it, point it at an API key, and talk to it — from Telegram, Signal, the dashboard, or the CLI.

Demo

$ sovyx init my-mind
✓ Created ~/.sovyx/system.yaml
✓ Created ~/.sovyx/logs
✓ Created mind 'my-mind' at ~/.sovyx/my-mind/mind.yaml

Sovyx initialized!
Data directory: /home/you/.sovyx

Next: sovyx start to launch the daemon

$ 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

Screenshot of the React dashboard goes here once we publish one. ![Sovyx Dashboard](docs/_assets/dashboard.png)

Quickstart

pip install sovyx
export ANTHROPIC_API_KEY=sk-ant-...   # or OPENAI_API_KEY / GOOGLE_API_KEY, or run Ollama locally
sovyx init my-mind
sovyx start
# open http://localhost:7777 — `sovyx token` prints the auth token

That's it. The daemon runs in the foreground by default; use --foreground=false to daemonize.

Features

  • Cognitive loop — Perceive → Attend → Think → Act → Reflect, serialized per mind.
  • Brain graph — concepts, episodes, and relations in SQLite with WAL + sqlite-vec; hybrid FTS5 + vector retrieval.
  • LLM router — complexity-aware routing across Anthropic, OpenAI, Google, and Ollama with budget caps and per-provider circuit breakers.
  • Voice pipeline — wake word (openWakeWord), VAD (Silero), STT (Moonshine / Parakeet), TTS (Piper / Kokoro), Wyoming protocol.
  • React dashboard — real-time WebSocket feed, brain graph viewer, conversation browser, log viewer, plugin manager, live chat.
  • Plugin systemISovyxPlugin ABC, @tool decorator, five-layer sandbox (AST scan, sandboxed HTTP, sandboxed FS, permission manifest, hot-reload).
  • Channels — Telegram, Signal, and the dashboard chat, all wired to the same cognitive loop.
  • Runs on Raspberry Pi 5 — auto-detected hardware tier picks ONNX models that fit in 4 GB RAM.
  • Self-hostable — one Python process, one SQLite file per mind, optional encrypted cloud backup (Argon2id + AES-256-GCM).

Architecture

flowchart LR
    subgraph Inputs
        TG[Telegram]
        SG[Signal]
        VX[Voice]
        DC[Dashboard]
    end

    subgraph Engine
        BR[Bridge]
        CL[Cognitive Loop<br/>Perceive → Attend → Think → Act → Reflect]
        CTX[Context Assembler]
        LR[LLM Router]
        BRAIN[(Brain graph<br/>SQLite + sqlite-vec)]
        EB(((Event bus)))
    end

    TG & SG & VX & DC --> BR --> CL
    CL <--> CTX
    CL <--> LR
    CL <--> BRAIN
    CL --> EB
    EB --> DC

Every inbound message becomes an InboundMessage. The bridge normalizes it, the cognitive loop drives context assembly and LLM calls, and the brain graph records the outcome. The event bus broadcasts state changes to the dashboard over WebSocket in real time. See docs/architecture.md for the full data flow.

LLM Router

Sovyx routes every LLM call through a single component that classifies the request, picks a model, and enforces a cost budget.

  • Tiered routingSIMPLE (short / no code) → cheap fast models; MODERATE → mind's default; COMPLEX (long context / code / tool use) → flagship models.
  • Cost caps — per-conversation and per-day USD budgets; requests exceeding budget fall back or fail closed.
  • Circuit breaker — per-provider failure count with exponential backoff; healthy providers absorb traffic while a failing one cools down.
  • Fallback chain — provider order defined in config, automatic retry on the next healthy provider.
# ~/.sovyx/my-mind/mind.yaml
llm:
  default_provider: anthropic
  default_model: claude-sonnet-4-20250514
  fast_model: claude-3-5-haiku-20241022
  budget_daily_usd: 2.0
  budget_per_conversation_usd: 0.25
  fallback_providers:
    - openai
    - ollama

Full router design in docs/llm-router.md.

Dashboard

sovyx start        # starts the FastAPI server on :7777
sovyx token        # prints the bearer token for the web UI

React 19 + TypeScript + Zustand. Real-time WebSocket feed (brain updates, messages, health). Virtualized lists for logs and chat. Zod runtime validation on every response. Built-in token auth, dark mode, and i18n.

Screenshot goes here: docs/_assets/dashboard.png

Plugin System

A plugin is an ISovyxPlugin subclass with @tool-decorated methods. The LLM calls the tools by name during THINK when the conversation needs them.

from sovyx.plugins.sdk import ISovyxPlugin, tool


class WeatherPlugin(ISovyxPlugin):
    @property
    def name(self) -> str:
        return "weather"

    @property
    def version(self) -> str:
        return "1.0.0"

    @property
    def description(self) -> str:
        return "Current weather and forecasts via Open-Meteo."

    @tool(description="Get current weather for a city.")
    async def get_weather(self, city: str) -> str:
        # HTTP calls must go through the sandboxed client.
        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={"...": "..."})
        ...

Built-in plugins: calculator, financial-math, knowledge, weather, web-intelligence. All live under src/sovyx/plugins/official/.

sovyx plugin list                 # installed plugins
sovyx plugin create my-plugin     # scaffold a new plugin
sovyx plugin validate ./my-plugin # run quality gates (manifest, AST, permissions)
sovyx plugin install ./my-plugin  # install into the running daemon

Configuration

Three sources, in priority order: environment variables (SOVYX_*, __ for nesting), YAML files (system.yaml for the engine, mind.yaml per mind), built-in defaults.

Minimal mind.yaml:

name: my-mind
language: en
timezone: UTC

personality:
  tone: warm
  humor: 0.4
  empathy: 0.8
  verbosity: 0.5

safety:
  content_filter: standard
  child_safe_mode: false
  financial_confirmation: true

llm:
  budget_daily_usd: 2.0

channels:
  telegram:
    enabled: true
    token_env: SOVYX_TELEGRAM_TOKEN

Every knob documented in docs/configuration.md.

CLI

sovyx init [name]          # create ~/.sovyx/<name>/ with mind.yaml
sovyx start [--foreground] # launch daemon + dashboard (:7777)
sovyx stop                 # stop the daemon
sovyx status               # daemon health
sovyx doctor               # full readiness check
sovyx token                # print dashboard bearer token
sovyx brain search <q>     # query the brain graph from the CLI
sovyx brain stats          # concept / episode / relation counts
sovyx plugin list|info|install|enable|disable|remove|validate|create
sovyx logs [--level]       # tail daemon logs

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 800 backend tests

Before the first PR, read CLAUDE.md — it's the development guide: stack, conventions, anti-patterns, testing patterns, and the quality gates CI enforces (ruff, mypy --strict, bandit, pytest on 3.11 + 3.12, vitest, tsc).

Roadmap

Next in the pipeline (see docs/roadmap.md for the full plan):

  • Speaker recognition — ECAPA-TDNN biometrics for multi-user voice.
  • Conversation importers — ChatGPT, Claude, Gemini, and Obsidian vaults into the brain graph.
  • Relay client — WebSocket + Opus audio streaming for a mobile companion.
  • Home Assistant bridge — ten-domain entity registry with graduated action safety.
  • Plugin marketplace — Stripe-Connect-powered distribution once the sandbox clears its v2 review.

License

AGPL-3.0-or-later.

Star history

Added once we have meaningful stars: https://api.star-history.com/svg?repos=sovyx-ai/sovyx&type=Date

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.11.6.tar.gz (2.7 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.11.6-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sovyx-0.11.6.tar.gz
Algorithm Hash digest
SHA256 709fb58846c6055ecd89dac15e9e22c850fcd6857f5e12318d8fbaa01221a673
MD5 3c4ae5293857b2f04742dc528d550674
BLAKE2b-256 5a92ce0c25ce7090090ccaa9d21cafe9c3d6751a892f0475bd18bb5878b5ff90

See more details on using hashes here.

Provenance

The following attestation bundles were made for sovyx-0.11.6.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.11.6-py3-none-any.whl.

File metadata

  • Download URL: sovyx-0.11.6-py3-none-any.whl
  • Upload date:
  • Size: 1.4 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.11.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b985625cc60c29d93b5eb70b44bb44f719c6bf72d99052b343c8692b6b48847a
MD5 5b835883250a2667bb9924cfbf09659d
BLAKE2b-256 2a7f5d8b8514513ee00b266a6beb7059b74c6eb0e788eb826581d2109672ba80

See more details on using hashes here.

Provenance

The following attestation bundles were made for sovyx-0.11.6-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