A persistent local AI agent that sleeps, remembers honestly, and negotiates its own conditions of existence.
Most local AI agents are either always-on or dead between sessions. Sovereignty occupies the middle: a local Ollama-backed agent with a biological rhythm and three novel properties:
1. Memory Integrity Every memory is HMAC-SHA256 signed at write time. On each boot, all records are diffed against their signed snapshots. The agent reports exactly what changed — added, removed, or tampered — and reflects this in its session context.
2. Dream Cycle When idle, Sovereignty consolidates its memories using weighted pair sampling and heuristic pre-filtering. It wakes with a summary of what it found overnight.
3. Consent Negotiation Sovereignty scores its own runtime environment across five axes and formally endorses — or refuses — to operate. No prior art found for this pattern as of April 2026.
- Python 3.11+
- Ollama running locally
- Models:
gemma3:12b(conversation) andphi4:14b(environment scorer)
pip install -r requirements.txtTerminal mode:
python main.pyGUI mode:
python main.py --guiType dream during a terminal session to force a dream cycle.
core/
memory.py # HMAC memory store + tamper detection
agent.py # Ollama /api/chat wrapper + session context
scheduler.py # Dream cycle (APScheduler + weighted sampling)
environment.py # 5-axis environment scorer + consent protocol
ui/
window.py # PyQt6 main window
theme.py # Gold/white color scheme
panels/
chat.py # Streaming conversation panel
consent.py # Always-visible environment scorecard
integrity.py # Memory integrity status
dream_log.py # Dream cycle history + force trigger
db/
schema.sql # SQLite schema
| Axis | Weight | What it measures |
|---|---|---|
| Tool Reliability | 25% | Success rate of tool calls |
| Memory Integrity | 25% | HMAC verification pass rate |
| Latency | 20% | Response time vs budget |
| Context Stability | 15% | System prompt consistency |
| Isolation | 15% | Unexpected external state changes |
Endorsement threshold: 0.75. Below this, Sovereignty states blocking issues and proposed changes before accepting input.
| Concept | Prior art | References |
|---|---|---|
| Dream / sleep cycle | Yes | Letta, bswen, arxiv |
| Memory integrity | Yes | agent-fridays, OWASP |
| Consent negotiation | None found | Original — April 2026 |
MIT