Skip to content

Tubifix77/sovereignty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sovereignty

A persistent local AI agent that sleeps, remembers honestly, and negotiates its own conditions of existence.

What makes it different

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.

Requirements

  • Python 3.11+
  • Ollama running locally
  • Models: gemma3:12b (conversation) and phi4:14b (environment scorer)
pip install -r requirements.txt

Usage

Terminal mode:

python main.py

GUI mode:

python main.py --gui

Type dream during a terminal session to force a dream cycle.

Architecture

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

Environment axes

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.

Prior art

Concept Prior art References
Dream / sleep cycle Yes Letta, bswen, arxiv
Memory integrity Yes agent-fridays, OWASP
Consent negotiation None found Original — April 2026

License

MIT

About

A persistent local AI agent with tamper-evident memory, dream cycles, and consent negotiation

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages