PROJECT · 01

Autarkia

Self-hosted agent runtime on one machine

View on GitHub →Under active development

It started as a chat interface and grew into a runtime: one request can contain several rounds of tool calls, state writes, and memory updates — read a file, set a reminder, glance at the screen, record a preference, then decide whether to keep going. Persona only constrains how it speaks and what it may say; everything it can actually do comes from the tool layer.

Tools are the largest layer. Register once, and every role gets its own set: resident tools enter the schema each turn, on-demand ones are discovered through retrieval, and disabled ones never appear in front of the model. Operations like sending messages, controlling devices, or writing local data carry risk annotations, and permission checks happen before execution — not inside the prompt.

Memory is not the whole history stuffed into the context. Weighted memory, keyword indexes, vector retrieval, and a forgetting probability are layered and picked by relevance, then distilled once a night to compress the day into long-term entries. Emotions, energy, sleep, and the role’s own schedule also enter the context and take part in proactive-message decisions.

Proactive messages are the product of hard constraints: quiet hours, minimum interval, daily cap, active client, role allowlist — miss one and nothing goes out; the user can also pause or change the frequency at any time. Stability takes the other half of the time: inference, TTS, and image generation compete for the same GPU, so an optional C++ extension separates tasks and prioritizes queues, falling back to Python when it isn’t compiled. After a model OOM, the system reloads along a degradation chain; if the service dies, monitoring and self-healing take over.

The boundaries are stated plainly too: one machine, one user, no multi-tenancy. C++ scheduling, ChromaDB, and SQLite indexes are all optional — without them it degrades to file and keyword paths. The iOS client is still an early implementation.

01Highlights

Tool layer94 tools across 26 domains, assigned per role as resident / on-demand / disabled; write operations carry risk annotations and pre-execution checks
Memory layerweighted memory + keyword index + vector retrieval + forgetting probability, with nightly distillation compressing each day into long-term entries
Scheduleran optional C++ extension separates GPU / CPU tasks with a priority queue, falling back to Python when not compiled
Stabilityhealth monitoring and self-healing restarts; log-driven patch generation passes a sandbox first, then human approval
Proactive tasksquiet hours, minimum interval, daily cap, and role allowlist are hard constraints — the default is not to send
Stateemotion detection, energy, sleep, and the role’s own schedule enter the context and gate proactive messages
ClientsWeb, Android (Compose, including accessibility / Shizuku device control), iOS, desktop shell, QQ, Telegram

02Stack

PythonFastAPIC++llama.cppReactKotlinSwiftDocker