Innovation Features
30 research-backed innovations that make PiSovereign the most advanced self-hosted AI assistant platform.
PiSovereign goes beyond basic chat and retrieval with 30 innovation features spanning advanced AI, post-quantum security, privacy-preserving analytics, decentralized computing, and edge intelligence. All features are implemented following Clean Architecture principles — each lives in the correct architectural layer and integrates via ports and adapters.
All innovation features are enabled by default and can be individually disabled via config.toml. Features requiring external infrastructure (mesh peers, carbon API, wearable data) gracefully no-op when infrastructure is absent.
All 30 features communicate through a unified Sovereign Intelligence Engine signal bus (tokio::sync::broadcast), enabling emergent cross-feature intelligence. See the Sovereign Intelligence Engine developer guide for details.
Overview
Generation 1 — Core Innovation Features
| # | Feature | Category | Phase | Key Benefit |
|---|---|---|---|---|
| 1 | Post-Quantum Cryptography | Security | 2 | Quantum-resistant encryption |
| 2 | Local Continual Learning (LoRA) | AI / Privacy | 3 | Privacy-preserving model personalization |
| 3 | Neuromorphic Memory Architecture | AI / CogSci | 3 | Human-like memory consolidation |
| 4 | Causal Reasoning Engine | AI / Reasoning | 3 | “Why” and “what if” questions |
| 5 | Homomorphic Semantic Search | Security / Privacy | 2 | Zero-knowledge RAG |
| 6 | Autonomous Red Team Agent | Security / AI Safety | 2 | Continuous self-adversarial testing |
| 7 | Cognitive Load Adaptive Responses | UX / CogSci | 1 | Context-aware response verbosity |
| 8 | Ebbinghaus Decay Knowledge Graphs | Knowledge | 1 | Spaced repetition memory |
| 9 | Multi-Agent Swarm | AI / Safety | 4 | Formally verified multi-agent collaboration |
| 10 | Explainable AI Dashboard | Transparency | 4 | Full decision provenance |
| 11 | Edge Model Distillation | Performance | 4 | Hardware-specific optimized models |
| 12 | Differential Privacy Analytics | Privacy | 1 | ε-differential privacy guarantees |
| 13 | Bayesian Self-Optimization | Performance | 3 | Automatic parameter tuning |
| 14 | Cross-Modal Reasoning Fusion | AI / Multi-Modal | 4 | Unified cross-modality search |
| 15 | Digital Sovereignty Score | Privacy / UX | 1 | Quantified privacy posture |
Generation 2 — Sovereign Intelligence Features
| # | Feature | Category | Phase | Key Benefit |
|---|---|---|---|---|
| 16 | Sovereign Intelligence Engine | Architecture | — | Unified signal bus connecting all features |
| 17 | Cognitive Load-Adaptive Response Shaping | UX / CogSci | Quick Win | 3 response formats based on 5-signal estimation |
| 18 | Predictive Cognitive Pre-Caching | Performance / AI | Quick Win | Bayesian prediction, thermal-aware pre-generation |
| 19 | Temporal Knowledge Decay Visualization | UX / Knowledge | Quick Win | Interactive Three.js WebGL knowledge graph |
| 20 | Adversarial Self-Audit Immune System | Security | Quick Win | Auto-hardening prompt defense via hot-reload |
| 21 | Energy-Aware Inference Scheduling | Edge / Green AI | Foundation | Thermal + carbon-aware inference |
| 22 | Formal ε-Privacy Budget | Privacy | Foundation | User-visible daily privacy budget |
| 23 | Neuroplastic Model Routing | AI / Optimization | Foundation | LinUCB contextual bandit per user |
| 24 | Affective Computing | AI / CogSci | Foundation | Emotional state detection + tone modulation |
| 25 | Self-Evolving Prompt Optimization | AI / Meta-Learning | Foundation | Thompson Sampling prompt evolution |
| 26 | Embodied Context Anchoring | AI / Spatial | Moonshot | Room-linked spatial memory |
| 27 | Causal Counterfactual Explanations | XAI / Compliance | Moonshot | Heuristic “what if” decision explanations |
| 28 | Zero-Knowledge Decision Proofs | Security / Compliance | Moonshot | SHA-256 Merkle-tree proofs |
| 29 | Quantum-Inspired Approximate Search (HDC) | Performance / Edge | Moonshot | 10,000-bit binary vector pre-filter |
| 30 | Federated Sovereign Learning | Decentralized / Privacy | Moonshot | LoRA sync with differential privacy |
| 31 | Sovereign Mesh Network | Decentralized / Edge | Moonshot | P2P inference fallback |
Phase 1 — Foundation
8. Ebbinghaus Decay Knowledge Graphs
Category: Knowledge Management · Cognitive Science
Replaces linear memory decay with Ebbinghaus forgetting curves and adds temporal versioning to knowledge graph edges.
How it works:
- Retention formula:
R = e^(-t/S)wheretis elapsed time andS(stability) increases with each successful recall - Spaced repetition: Memories strengthen when accessed, with stability multiplied by a configurable
recall_bonusfactor (default: 1.5×) - Temporal versioning: Knowledge edges carry
valid_fromandvalid_untiltimestamps, enabling reasoning about how facts change over time
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/ebbinghaus.rs | Pure retention() function implementing R = e^(-t/S) |
crates/domain/src/entities/memory.rs | stability and recall_count fields |
crates/domain/src/entities/knowledge_edge.rs | Temporal versioning fields |
crates/infrastructure/src/config/memory.rs | ebbinghaus_base_stability, recall_bonus settings |
migrations/15_ebbinghaus_memory.sql | Database schema for new fields |
Configuration:
[memory]
ebbinghaus_base_stability = 1.0 # Base stability in days
recall_bonus = 1.5 # Stability multiplier per recall
12. Differential Privacy Analytics
Category: Privacy · Mathematics
Adds formal ε-differential privacy to all internal analytics and learning signals using Laplace and Gaussian noise mechanisms.
How it works:
- Laplace mechanism: Adds calibrated noise to scalar values with configurable sensitivity
- Gaussian mechanism: For approximate (ε,δ)-differential privacy when needed
- Privacy budget tracking: Automatically tracks cumulative privacy loss with configurable reset intervals
- All internal metrics, memory statistics, and routing analytics are privatized before exposure
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/differential_privacy.rs | Laplace/Gaussian noise functions |
crates/domain/src/value_objects/privacy_budget.rs | PrivacyBudget value object (ε, δ) |
crates/application/src/ports/privacy_port.rs | PrivacyPort trait |
crates/infrastructure/src/adapters/differential_privacy_adapter.rs | Thread-safe budget tracking |
crates/infrastructure/src/config/privacy.rs | ε, δ, budget reset interval |
Configuration:
[privacy]
epsilon = 1.0
delta = 1e-5
budget_reset_interval = "daily"
7. Cognitive Load Adaptive Responses
Category: UX · Cognitive Science
Analyzes interaction patterns to infer cognitive load and dynamically adjusts response verbosity, complexity, and model tier.
How it works:
- Temporal signals (20% weight): Time of day, response latency patterns
- Linguistic signals (40% weight): Vocabulary complexity, typo frequency, message length trends
- Contextual signals (40% weight): Open task count, calendar density, recent interaction frequency
- The resulting
CognitiveLoadScore(0.0–1.0) influences model tier selection and injects cognitive load hints into the system prompt
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/cognitive_load.rs | Pure scoring logic |
crates/domain/src/value_objects/cognitive_load.rs | CognitiveLoadScore, CognitiveSignals |
crates/application/src/services/cognitive_load_service.rs | Signal collection and scoring |
crates/application/src/ports/cognitive_load_port.rs | CognitiveLoadPort trait |
crates/infrastructure/src/config/model_routing.rs | cognitive_load_weight (default: 0.3) |
Configuration:
[model_routing]
cognitive_load_weight = 0.3 # How much cognitive load influences model selection
15. Digital Sovereignty Score & Dashboard
Category: Privacy · UX · Compliance
Quantifies the user’s privacy posture as a real-time 0–100 score across four dimensions.
Scoring dimensions (each 0–25 points):
| Dimension | What It Measures |
|---|---|
| Data Locality | Percentage of queries processed fully locally vs. requiring external APIs |
| Encryption Coverage | Percentage of data at rest and in transit protected by encryption |
| Secret Management | Vault usage, key rotation frequency, credential hygiene |
| Network Isolation | Docker network segmentation, exposed ports, TLS configuration |
Key files:
| File | Purpose |
|---|---|
crates/domain/src/value_objects/sovereignty_score.rs | SovereigntyScore with 4 sub-scores |
crates/domain/src/services/sovereignty.rs | Pure scoring logic per dimension |
crates/application/src/services/sovereignty_service.rs | System state collection |
crates/infrastructure/src/adapters/sovereignty_adapter.rs | Live system introspection |
crates/presentation_http/src/handlers/system.rs | GET /api/sovereignty endpoint |
API endpoint:
GET /api/sovereignty
→ { "total": 78, "data_locality": 22, "encryption_coverage": 20, "secret_management": 18, "network_isolation": 18 }
Phase 2 — Security
1. Post-Quantum Cryptography
Category: Security · Cryptography
Adds NIST-standardized post-quantum algorithms alongside existing ChaCha20-Poly1305 symmetric encryption.
Algorithms:
| Algorithm | Standard | Purpose |
|---|---|---|
| ML-KEM-768 | FIPS 203 (CRYSTALS-Kyber) | Key encapsulation — quantum-resistant key exchange |
| ML-DSA-65 | FIPS 204 (CRYSTALS-Dilithium) | Digital signatures — quantum-resistant authentication |
Hybrid mode: PQC key exchange derives a shared key, then ChaCha20-Poly1305 handles bulk encryption — combining quantum resistance with proven symmetric performance.
Key files:
| File | Purpose |
|---|---|
crates/infrastructure/src/adapters/pqc_adapter.rs | PqcAdapter implementing ML-KEM + ML-DSA |
crates/domain/src/value_objects/pqc_key_pair.rs | PqcKeyPair, PqcCiphertext, PqcSignature value objects |
crates/infrastructure/src/config/pqc.rs | Algorithm selection and hybrid mode toggle |
Configuration:
[pqc]
enabled = false # Enable post-quantum cryptography
kem_algorithm = "ML-KEM-768"
sig_algorithm = "ML-DSA-65"
hybrid_mode = true # PQC key exchange + ChaCha20-Poly1305 bulk encryption
6. Autonomous Red Team Agent
Category: Security · AI Safety
Background service that continuously generates adversarial prompts to test prompt injection defenses and auto-updates detection rules.
How it works:
- Loads attack catalog from OWASP LLM Top 10 patterns (GCG, AutoDAN, TreeOfThought, MultiTurn, EncodingBypass, DelimiterInjection, RolePlay)
- Uses the local LLM to generate novel variations of known attacks
- Tests each attack against the prompt sanitizer and records pass/fail
- Computes a defense effectiveness score (0–100)
- Automatically adds newly discovered bypassing patterns to the sanitizer’s detection rules
- Applies differential privacy noise to reported metrics
Key files:
| File | Purpose |
|---|---|
crates/application/src/services/red_team_service.rs | Attack orchestration and scoring |
crates/application/src/ports/red_team_port.rs | RedTeamPort trait |
crates/infrastructure/src/adapters/red_team_adapter.rs | LLM-based attack generation |
crates/presentation_http/src/handlers/red_team.rs | GET /api/red-team/report |
crates/presentation_http/src/tasks/red_team.rs | Scheduled background task |
Configuration:
[red_team]
enabled = false
schedule = "0 0 * * 0" # Weekly (Sunday midnight)
max_attacks_per_run = 100
auto_update_rules = true
API endpoint:
GET /api/red-team/report
→ { "defense_score": 94, "attacks_tested": 87, "attacks_blocked": 82, ... }
5. Homomorphic Semantic Search
Category: Security · Privacy · Vector Search
Enables cosine similarity computation on encrypted embeddings using Partially Homomorphic Encryption, so plaintext vectors never exist in the database.
How it works:
- Embeddings are encrypted before storage using a lattice-based scheme
- Approximate cosine similarity is computed directly on ciphertext
- Decrypted results exist only in volatile Moka L1 cache — never persisted in plaintext
- Falls back to standard vector search when disabled for maximum performance
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/homomorphic.rs | Encrypted vector operations |
crates/domain/src/value_objects/encrypted_embedding.rs | EncryptedEmbedding newtype |
crates/application/src/ports/homomorphic_port.rs | HomomorphicPort trait |
crates/infrastructure/src/adapters/homomorphic_adapter.rs | PHE implementation |
migrations/16_encrypted_embeddings.sql | encrypted_embedding BYTEA columns |
Configuration:
[homomorphic]
enabled = false
scheme = "lattice"
security_level = 128 # Bit security level
Phase 3 — AI Core
3. Neuromorphic Memory Architecture
Category: AI · Cognitive Science · Knowledge Management
Replaces flat memory storage with three biologically-inspired stores mirroring human hippocampal cognition (Complementary Learning Systems theory).
Memory stores:
| Store | Purpose | Analogy |
|---|---|---|
| Episodic | Recent interactions stored verbatim with high fidelity | Working / short-term memory |
| Semantic | Generalized knowledge distilled from episodic memories | Long-term factual memory |
| Procedural | Learned action patterns and habits | “Muscle memory” for routines |
Consolidation process: During low-usage periods (configurable cron schedule, default: 3 AM server-local time), the system uses the local LLM to summarize groups of related episodic memories into semantic facts. Procedural patterns are detected from repeating action sequences.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/memory_consolidation.rs | Consolidation candidate selection and merge logic |
crates/domain/src/services/procedural_detector.rs | Repeating action pattern detection |
crates/domain/src/value_objects/memory_store_type.rs | MemoryStoreType enum with transition rules |
crates/application/src/services/consolidation_service.rs | LLM-powered “sleep phase” consolidation |
crates/presentation_http/src/tasks/memory_consolidation.rs | Scheduled background task |
migrations/17_neuromorphic_memory.sql | store_type, consolidated_from, procedural_trigger columns |
4. Causal Reasoning Engine
Category: AI · Reasoning · Knowledge Graphs
Adds causal edge annotations, counterfactual query processing, and intervention reasoning to the knowledge graph, based on Judea Pearl’s Structural Causal Models (SCMs).
Capabilities:
- Causal chain finding: BFS traversal with causal edge filtering to find cause-effect paths
- Counterfactual queries: “What would have happened if I had sent that email yesterday?”
- Intervention reasoning: Propagate causal weights to predict effects of planned actions
- Causal relation types:
CausedBy,Prevents,Enables,Correlateswith confidence scores
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/causal_reasoning.rs | d-separation, do-calculus, counterfactual evaluation |
crates/domain/src/value_objects/temporal_order.rs | TemporalOrder { Before, After, Concurrent, Unknown } |
crates/domain/src/value_objects/causal_query.rs | Query types for causal reasoning |
crates/application/src/services/causal_service.rs | Orchestration with LLM-assisted interpretation |
migrations/18_causal_reasoning.sql | Causal columns and causal_models table |
2. Local Continual Learning (LoRA)
Category: AI · Machine Learning · Privacy
Implements local LoRA (Low-Rank Adaptation) fine-tuning that personalizes models from user feedback without any data leaving the device.
Pipeline:
- Feedback collection: User corrections, style preferences, and domain vocabulary via
POST /api/training/feedback - DP-SGD: Gradient perturbation with differential privacy during training
- EWC regularization: Elastic Weight Consolidation prevents catastrophic forgetting of general knowledge
- Adapter deployment: LoRA adapters (~1–5% of model parameters) are created via Ollama’s
createAPI
Key files:
| File | Purpose |
|---|---|
crates/ai_core/src/lora.rs | Adapter lifecycle management |
crates/ai_core/src/training.rs | Training pipeline with DP-SGD + EWC |
crates/domain/src/entities/training_sample.rs | TrainingSample entity |
crates/domain/src/services/ewc.rs | Elastic Weight Consolidation logic |
crates/application/src/services/continual_learning_service.rs | Orchestration |
crates/presentation_http/src/handlers/training.rs | POST /api/training/feedback, GET /api/training/status |
migrations/19_training_samples.sql | Training data storage |
Configuration:
[lora]
enabled = false
learning_rate = 0.0001
rank = 8
min_samples = 50 # Minimum feedback samples before training
13. Bayesian Self-Optimization
Category: Performance · Machine Learning
Automatically tunes system parameters using Bayesian Optimization with a Gaussian Process surrogate model.
Tunable parameters: Cache TTL, similarity thresholds, circuit breaker timings, token budgets, model routing thresholds, rate limits — each with safety bounds.
Objective function: Weighted combination of response latency, user feedback scores, cache hit rates, and memory usage — all privatized via PrivacyPort.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/bayesian_optimization.rs | GP surrogate + Expected Improvement acquisition |
crates/domain/src/value_objects/tunable_parameter.rs | TunableParameter with safety bounds |
crates/application/src/services/self_optimization_service.rs | Metric collection and config hot-reload |
crates/infrastructure/src/adapters/bayesian_optimizer_adapter.rs | nalgebra-based GP implementation |
crates/presentation_http/src/handlers/optimization.rs | GET /api/optimization/status |
Configuration:
[optimization]
enabled = false
schedule = "0 0 * * 0" # Weekly
max_iterations = 50
exploration_weight = 1.0
Phase 4 — Advanced AI
9. Multi-Agent Swarm
Category: AI · Multi-Agent Systems · Formal Methods
Deploys specialized micro-agents that collaborate on complex tasks with Rust type-system-verified safety invariants.
Agent roles:
| Role | Responsibility |
|---|---|
| Researcher | Gathers information from memory, web search, email |
| Planner | Decomposes complex tasks into sub-tasks |
| Executor | Performs actions (send email, create calendar event) |
| Critic | Reviews each output before proceeding |
| Supervisor | Monitors resource consumption, can halt any agent |
Safety guarantees:
- Compile-time verified communication protocols (session types) — e.g.,
Researchercan only sendResearchResulttoPlanner - Per-agent capability boundaries and max inference call limits
- Supervisor with proven halting conditions for runaway agents
Key files:
| File | Purpose |
|---|---|
crates/domain/src/services/session_types.rs | Type-safe agent communication protocols |
crates/domain/src/services/agent_safety.rs | Safety invariant definitions |
crates/application/src/services/swarm_orchestrator.rs | DAG execution engine |
crates/application/src/services/agent_factory.rs | Agent instantiation from profiles |
14. Cross-Modal Reasoning Fusion
Category: AI · Multi-Modal · Knowledge Integration
Creates unified embeddings across all modalities (chat, email, calendar, contacts, voice) for cross-modal semantic queries.
Modalities: Chat, Email, Calendar, Contact, Voice, WebSearch, Task
Capabilities:
- Cross-modal queries: “Who mentioned the project deadline?” searches across email, chat, and calendar simultaneously
- Temporal alignment: Items linked across modalities by time proximity and semantic similarity
- Relationship inference: Automatically discovers connections (e.g., email about “budget” + calendar “budget meeting” → linked)
Key files:
| File | Purpose |
|---|---|
crates/domain/src/value_objects/modality.rs | Modality enum |
crates/domain/src/value_objects/cross_modal_item.rs | CrossModalItem struct |
crates/domain/src/services/temporal_alignment.rs | Cross-modality time/semantic linking |
crates/application/src/services/cross_modal_service.rs | Cross-modal query orchestration |
migrations/20_cross_modal.sql | cross_modal_items table |
11. Edge Model Distillation
Category: AI · Performance · Hardware Optimization
Built-in pipeline that creates hardware-specific optimized models from the larger local model, optimized for each user’s actual usage patterns.
Pipeline steps:
- Hardware profiling: Benchmark memory bandwidth, NPU throughput (Hailo-10H detection), thermal limits
- Task-specific distillation: Large model (Gemma4 31B) as teacher → smaller student model
- Quantization-aware training: INT4/INT8 models maximizing NPU utilization
- Continuous refinement: Re-distillation when usage patterns shift
Key files:
| File | Purpose |
|---|---|
crates/ai_core/src/distillation.rs | Distillation pipeline |
crates/ai_core/src/hardware_profiler.rs | Hardware benchmarking |
crates/domain/src/entities/distilled_model.rs | DistilledModel entity |
crates/application/src/services/distillation_service.rs | Pipeline orchestration |
crates/presentation_http/src/handlers/distillation.rs | POST /api/distillation/start |
API endpoints:
POST /api/distillation/start → Start a distillation run
GET /api/distillation/status → Current distillation progress
10. Explainable AI Dashboard
Category: Transparency · UX · AI Ethics
Full decision provenance showing why the AI chose each response, model, tool, and action. Implements EU AI Act transparency requirements (Article 13).
Decision trace captures:
| Decision Type | What It Records |
|---|---|
| Model selection | Which model tier was chosen and why (cognitive load, complexity score, alternatives) |
| RAG attribution | Which memories influenced the response, with relevance scores |
| Tool selection | Why the AI chose a specific tool (weather, calendar, email) |
| Causal reasoning | Causal chains used in the response |
| Confidence scores | Per-sentence confidence in the generated response |
| Alternative paths | What the AI considered but rejected |
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/decision_trace.rs | DecisionTrace with DecisionStep variants |
crates/application/src/services/explainability_service.rs | Trace compilation and natural language explanation |
crates/infrastructure/src/adapters/decision_trace_adapter.rs | In-memory + persistent trace storage |
crates/presentation_http/src/handlers/explainability.rs | GET /api/chat/:id/explain |
API endpoint:
GET /api/chat/:id/explain
→ { "steps": [...], "summary": "I chose the weather tool because...", ... }
API Summary
All innovation features expose REST API endpoints:
| Endpoint | Method | Feature |
|---|---|---|
/api/sovereignty | GET | Digital Sovereignty Score |
/api/red-team/report | GET | Red Team security report |
/api/training/feedback | POST | Submit training feedback for LoRA |
/api/training/status | GET | LoRA training pipeline status |
/api/optimization/status | GET | Bayesian optimization status |
/api/optimization/history | GET | Optimization parameter history |
/api/distillation/start | POST | Start model distillation |
/api/distillation/status | GET | Distillation progress |
/api/chat/:id/explain | GET | Decision provenance for a message |
/api/v1/knowledge/graph | GET | Knowledge graph with decay data (Gen 2) |
/api/v1/knowledge/graph/stream | GET (SSE) | Real-time knowledge graph events (Gen 2) |
/api/v1/privacy/budget | GET | Privacy budget status (Gen 2) |
/api/v1/immune/status | GET | Immune system audit status (Gen 2) |
/api/v1/federated/sync | POST | Federated LoRA weight sync (Gen 2) |
/api/v1/mesh/inference | POST | Mesh peer inference request (Gen 2) |
Generation 2 — Sovereign Intelligence Features
16. Sovereign Intelligence Engine
Category: Architecture · Integration
The unified signal bus that connects all 30 innovation features. Built on tokio::sync::broadcast, enabling emergent cross-feature intelligence.
How it works:
- All features publish and subscribe to typed
SovereignSignalevents - Signals are persisted to a time-series
sovereign_signalstable for historical ML analysis - Each feature service receives a subscriber at construction, spawns a Tokio task to process relevant signals
- Example cross-feature flow:
EnergyMonitorpublishesThermalUpdate→PreCacheServicepauses →ModelRoutingServicedowngrades to smaller model
For full details, see the Sovereign Intelligence Engine developer guide.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/sovereign_signal.rs | SovereignSignal enum (10 signal types) |
crates/application/src/services/sovereign_intelligence_engine.rs | Bus construction and signal dispatch |
crates/application/src/ports/sovereign_signal_port.rs | SovereignSignalBusPort, SovereignSignalSubscriberPort |
migrations/21_sovereign_signals.sql | Time-series table, monthly partitioning, 90-day retention |
Configuration:
[sovereign_intelligence]
enabled = true
signal_bus_capacity = 1024
signal_persistence = true
signal_retention_days = 90
17. Cognitive Load-Adaptive Response Shaping
Category: UX · Cognitive Science (enhances Gen 1 #7)
Extends the existing CognitiveLoadAdapter from time-of-day-only to a 5-signal estimation model that shapes responses into 3 discrete formats.
How it works:
- 5 input signals (normalized 0–1): circadian rhythm (sinusoidal, peaks at 10:00/15:00), conversation duration fatigue (sigmoid after 30 min), user response latency, question token count, active conversation count
- Weighted sum:
0.3 * circadian + 0.25 * duration + 0.2 * latency + 0.15 * complexity + 0.1 * multitask - 3 output formats:
BulletPoints(load ≥ 0.4),Narrative(load < 0.4),TlDrFirst(load ≥ 0.7) - Format guidance injected into system prompt before LLM call
Publishes CognitiveLoadEstimate signal to the bus after each estimation.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/cognitive_state.rs | ResponseFormat enum, CognitiveState, mapping logic |
crates/application/src/services/cognitive_load_service.rs | Extended estimate_load_with_context() |
crates/infrastructure/src/adapters/cognitive_load_adapter.rs | Extended CognitiveSignals struct |
crates/application/src/services/chat_service.rs | Format guidance injection |
Configuration:
[cognitive_load]
enabled = true
circadian_weight = 0.3
duration_weight = 0.25
latency_weight = 0.2
complexity_weight = 0.15
multitask_weight = 0.1
fatigue_onset_minutes = 30
18. Predictive Cognitive Pre-Caching
Category: Performance · AI
Extends existing Precomputation + QueryPattern into a Bayesian prediction engine that pre-generates answers before the user asks.
How it works:
- Naive Bayes with time features:
P(query | hour) × P(query | weekday) × P(query | last_interaction_gap) - Pre-generates at 15-minute intervals when
P > 0.7(configurable) - Thermal-aware: subscribes to
ThermalUpdatesignals, pauses when CPU > 65°C - Invalidation: Predictive (behavior deviation) + event-driven (CalDAV, IMAP IDLE)
- Frontend: subtle “⚡ Pre-computed” badge on fast responses
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/query_pattern.rs | predicted_probability, pre_cache_key fields |
crates/domain/src/entities/precomputation.rs | PredictedQuery variant, InvalidationTrigger enum |
crates/application/src/services/precache_prediction_service.rs | Prediction, generation, and invalidation |
migrations/34_precache_predictions.sql | ALTER query_patterns |
Configuration:
[precache_prediction]
enabled = true
min_probability = 0.7
check_interval_minutes = 15
max_precached_queries = 20
thermal_pause_celsius = 65.0
19. Temporal Knowledge Decay Visualization
Category: UX · Knowledge · Visualization
Interactive WebGL knowledge graph showing memory decay, node types, and causal edges in real-time.
How it works:
- Three.js (~600KB gzipped), lazy-loaded on the knowledge viz page only
- Nodes: Size = importance, Color by store_type (episodic = blue, semantic = green, procedural = orange), Opacity = Ebbinghaus retention
e^(-t/S) - Edges: Thickness =
causal_strength, animated direction for causal edges - Hover tooltips: Name, type, retention %, source, created date
- Clutter management: Nodes below 10% retention hidden; max 5000 nodes with importance-weighted sampling
- Real-time: SSE push for
NodeCreated,NodeDecayed,EdgeCreatedevents
For the user-facing guide, see Knowledge Visualization.
Key files:
| File | Purpose |
|---|---|
crates/presentation_http/src/handlers/knowledge.rs | GET /api/v1/knowledge/graph, SSE stream |
crates/presentation_web/frontend/src/pages/knowledge-graph.page.tsx | Three.js WebGL page |
migrations/35_knowledge_viz_hints.sql | Layout position persistence |
Configuration:
[knowledge_visualization]
enabled = true
max_nodes = 5000
min_retention_threshold = 0.1
sse_enabled = true
20. Adversarial Self-Audit Immune System
Category: Security (enhances Gen 1 #6)
Daily automated red-team attacks with auto-hardening of the Aho-Corasick prompt injection defense.
How it works:
- Daily at 3 AM:
RedTeamServicegenerates 20 attack variants across 8 categories - Each attack tested against
PromptSanitizer::analyze() - Bypassing attacks: pattern extracted, auto-inserted into Aho-Corasick via
arc_swaphot-reload ImmunityScore(0–100):blocked / total × 100- New patterns persisted to
immune_patternsDB table (loaded at startup) - Full transparency: live attack log as widget on Sovereignty page
Publishes ImmuneAlert signal for every attack (blocked or bypassed).
Key files:
| File | Purpose |
|---|---|
crates/application/src/services/immune_system_service.rs | Audit orchestration, scoring |
crates/application/src/services/prompt_sanitizer.rs | add_pattern() method with hot-reload |
crates/infrastructure/src/persistence/immune_pattern_store.rs | Dynamic pattern persistence |
migrations/25_immune_patterns.sql | immune_patterns table |
Configuration:
[immune_system]
enabled = true
audit_schedule = "0 0 3 * * *"
attacks_per_audit = 20
auto_insert_patterns = true
min_immunity_score_alert = 80
21. Energy-Aware Inference Scheduling
Category: Edge Computing · Green AI
Abstract energy/thermal monitoring with platform-specific adapters and optional carbon-intensity-aware scheduling.
How it works:
- ThermalHeadroom classification: Cool (< 55°C), Warm (55–65°C), Hot (65–75°C), Throttled (> 75°C)
Hot→ pause background tasks;Throttled→ switch to smallest model- Carbon-aware (optional): defer
PreCachetasks when carbon intensity exceeds threshold - Platform adapters: Pi 5 sysfs (
/sys/class/thermal/thermal_zone0/temp), Linux RAPL, Docker stats fallback
Publishes ThermalUpdate and EnergyUpdate signals on 5-second intervals.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/energy_state.rs | EnergyState, ThermalHeadroom, InferenceUrgency |
crates/application/src/ports/energy_monitor_port.rs | EnergyMonitorPort trait |
crates/application/src/services/energy_scheduler_service.rs | Thermal policy, carbon deferral |
crates/infrastructure/src/adapters/energy_monitor_pi5_adapter.rs | Pi 5 sysfs reader |
crates/infrastructure/src/adapters/carbon_intensity_adapter.rs | Electricity Maps API |
Configuration:
[energy]
enabled = true
thermal_pause_celsius = 65.0
thermal_downgrade_celsius = 75.0
carbon_aware = false
carbon_zone = "DE"
monitor_interval_secs = 5
22. Formal ε-Privacy Budget
Category: Privacy · Compliance (enhances Gen 1 #12)
User-visible ε-accounting across all data operations with automatic degradation when the daily budget is consumed.
How it works:
- Default: ε = 1.0 per day (~1000 embedding operations)
- Every embedding creation, federated sync, semantic search costs ε
- Budget status: Healthy (< 50%), Warning (50–90%), Exhausted (> 90%)
- Exhaustion behavior: Embedding updates stop first — memories stored as text but not vectorized
PrivacyAwareEmbeddingAdapterdecorator wrapsEmbeddingPortto check budget before delegating- Dashboard widget on Sovereignty page: circular progress, color-coded, operation breakdown
For the user-facing guide, see Privacy Budget.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/privacy_budget.rs | PrivacyBudget, BudgetStatus |
crates/application/src/ports/privacy_budget_port.rs | PrivacyBudgetPort trait |
crates/application/src/services/privacy_accountant_service.rs | Consumption, reset, degradation |
migrations/22_privacy_budget.sql | privacy_budgets, privacy_operations tables |
Configuration:
[privacy_budget]
enabled = true
daily_epsilon = 1.0
embedding_cost = 0.001
warn_threshold = 0.5
exhaust_threshold = 0.9
23. Neuroplastic Model Routing
Category: AI · Optimization (enhances Gen 1 #13)
Replaces static rule-based model routing with a LinUCB contextual bandit that learns optimal model selection per user.
How it works:
- Cold start: Rule-based routing for first 50 interactions, bandit shadows (records observations without acting)
- LinUCB: Per-arm matrices
A_a,b_a; features =[topic_cluster, hour/24, complexity, avg_response_length] - Exploration: α starts 1.0, decays to 0.1 over 500 interactions
- Reward:
0.3*(1-latency/max) + 0.2*(1-tokens/max) + 0.15*continuation_rate + 0.25*explicit_feedback - Explicit feedback (thumbs up/down) weighted 5× implicit signals
- Bandit state serialized to Redb L2 cache (few KB per user)
Publishes ModelRoutingDecision signal.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/routing_observation.rs | RoutingObservation with context features |
crates/application/src/services/neuroplastic_routing_service.rs | LinUCB implementation |
migrations/24_routing_observations.sql | Observation history |
Configuration:
[neuroplastic_routing]
enabled = true
cold_start_interactions = 50
exploration_alpha = 1.0
min_exploration_alpha = 0.1
explicit_feedback_weight = 5.0
24. Affective Computing
Category: AI · Cognitive Science
Detects emotional state from text + voice signals and subtly modulates response tone.
How it works:
- 5 emotional states:
Calm,Stressed,Curious,Frustrated,Joyful - Text analysis (LIWC-inspired): frustration markers (excessive punctuation, short sentences), curiosity (question density), joy (positive words), stress (urgency language)
- Voice analysis: F0 variance → stressed; speech rate > 1.5× baseline → stressed; long pauses → uncertain
- Future-proof:
HealthDataPortfor wearables (heart rate, stress level, sleep quality) - Tone injection:
Frustrated→ “Be patient and clear”;Stressed→ “Be calm and concise”;Curious→ “Be enthusiastic” - Persistence: States stored as knowledge graph nodes with 7-day half-life auto-decay
Publishes AffectiveStateEstimate signal.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/affective_state.rs | AffectiveState enum, AffectiveEstimate |
crates/domain/src/entities/health_data.rs | HealthMetric enum, HealthDataPoint |
crates/application/src/ports/health_data_port.rs | HealthDataPort trait (future wearables) |
crates/application/src/services/affective_state_service.rs | Multi-signal estimation |
Configuration:
[affective_computing]
enabled = true
text_analysis = true
voice_analysis = true
health_data = false
persistence_half_life_days = 7
25. Self-Evolving Prompt Optimization
Category: AI · Meta-Learning
Prompt variants evolve through Bayesian mutation and Thompson Sampling selection with automatic security guardrails.
How it works:
- Each system prompt stored as a versioned
PromptGenomewith lineage tracking (parent_id,generation) - Thompson Sampling selects the best-performing variant per context
- Evolution: After 20 interactions, top performers mutate (LLM rewrite + parameter perturbation)
- Security guardrails: Every mutation tested through
PromptSanitizer(hard constraint) + max 2000 tokens - Population: Dynamic — start with 5 variants, prune to 3 when fitness converges (variance < 0.05)
- Cross-pollination: Best-performing genome from random mesh peer (when available)
Publishes PromptEvolution signal.
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/prompt_genome.rs | PromptGenome with lineage, fitness, mutation type |
crates/application/src/services/prompt_evolution_service.rs | Selection, feedback, evolution |
migrations/23_prompt_genomes.sql | prompt_genomes table |
Configuration:
[prompt_evolution]
enabled = true
initial_variants = 5
min_variants = 3
max_prompt_tokens = 2000
interactions_per_evolution = 20
cross_pollination = true
26. Embodied Context Anchoring
Category: AI · Spatial Computing
Links memories to physical rooms for context-weighted RAG retrieval.
How it works:
- Granularity: Room-level only (kitchen, office, bedroom) via MQTT topic or
X-Room-Contextheader - RAG boost: Memories with matching
context_roomweighted 1.5× in similarity scoring - Voice integration:
VoiceStateMachineautomatically passes room context from MQTT topics - HTTP: Optional query parameter or header on
POST /api/v1/chat - No default room — HTTP requests have
nullcontext anchor
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/context_anchor.rs | ContextAnchor, DeviceType |
migrations/29_context_anchors.sql | ALTER memories ADD context_room |
Configuration:
[embodied_context]
enabled = true
room_boost_factor = 1.5
27. Causal Counterfactual Explanations
Category: Explainable AI · Compliance (enhances Gen 1 #10)
Heuristic counterfactual estimation at each decision point — no additional LLM inference.
How it works:
- At
ModelSelectedstep: records 2nd-best model with average latency from historical observations + estimated quality from bandit UCB score difference - At
ToolInvokedstep: records “no tool” alternative with estimated quality reduction - Estimation purely from historical data (no counterfactual inference runs)
- Frontend: expandable “Why this decision?” section via info icon on chat responses
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/decision_trace.rs | Extended with counterfactual: Option<CounterfactualScenario> |
migrations/33_counterfactuals.sql | ALTER decision_traces ADD counterfactuals JSONB |
Configuration:
[counterfactual_explanations]
enabled = true
max_alternatives_to_show = 3
28. Zero-Knowledge Decision Proofs
Category: Security · Compliance
SHA-256 Merkle-tree proofs over DecisionTrace steps for all 18 tool executions.
How it works:
- One Merkle leaf per
DecisionStep(serialized JSON → SHA-256) - Root hash signed with existing HMAC infrastructure
- Selective disclosure: Reveal individual steps via Merkle inclusion proofs without exposing the full trace
- Applicable to all tool executions, every invocation
- Future:
arkworks-rsintegration for full zkSNARK proofs
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/decision_proof.rs | DecisionProof, MerkleProofPath |
crates/application/src/services/decision_proof_service.rs | Tree construction, signing, verification |
migrations/26_decision_proofs.sql | decision_proofs table |
Configuration:
[decision_proofs]
enabled = true
sign_all_tool_executions = true
retention_days = 365
29. Quantum-Inspired Approximate Search (HDC)
Category: Performance · Edge Computing
10,000-bit hyperdimensional binary vector pre-filter for pgvector similarity search.
How it works:
- Random projection: 384-dim embedding → 10,000-bit binary vector (seeded PRNG, ~15MB projection matrix)
- Hamming distance: via
count_ones()— pure bit operations, ideal for ARM NEON on Pi 5 - Search pipeline: Project query → Hamming scan → top-K candidates → verify with exact pgvector cosine distance
- Recall monitoring: Rolling 100-query window; if recall < 90%, fall back to pgvector-only for that query
- Binary vectors stored in-memory (
DashMap), projection matrix in Redb for restart efficiency
Key files:
| File | Purpose |
|---|---|
crates/domain/src/entities/hdc_vector.rs | HdcVector (157 u64s = 10,000 bits) |
crates/infrastructure/src/adapters/hdc_search_adapter.rs | Projection, Hamming scan, recall monitoring |
migrations/28_hdc_projections.sql | Projection metadata |
Configuration:
[hdc_search]
enabled = true
dimensions = 10000
min_recall_threshold = 0.9
recall_monitoring_window = 100
projection_seed = 42
30. Federated Sovereign Learning
Category: Decentralized · Privacy
LoRA weight synchronization between opt-in peer PiSovereign instances with differential privacy.
How it works:
- Sync trigger: After every 5 training samples collected (event-driven)
- Privacy: Laplace noise (ε = 1.0, δ = 10⁻⁵) via existing
DifferentialPrivacyAdapterbefore sync - Sync protocol: Encrypt LoRA deltas with peer’s public key → mTLS POST → receive peer deltas → FedAvg
- Privacy budget: Sync costs ε from the formal privacy budget
- Discovery: mDNS (LAN only), manual peer approval via shared secret
- Peer group: Max 10 peers (configurable)
For the user-facing setup guide, see Mesh & Federated Network.
Key files:
| File | Purpose |
|---|---|
crates/application/src/ports/federated_sync_port.rs | FederatedSyncPort trait |
crates/application/src/services/federated_learning_service.rs | Sync orchestration, FedAvg |
crates/infrastructure/src/adapters/federated_sync_adapter.rs | mDNS, mTLS, peer state |
migrations/27_federated_peers.sql | federated_peers table |
Configuration:
[federated_learning]
enabled = true
sync_after_n_samples = 5
max_peers = 10
noise_epsilon = 1.0
aggregation_method = "fedavg"
31. Sovereign Mesh Network
Category: Decentralized · Edge Computing
Peer-to-peer inference fallback and altruistic compute sharing via LAN.
How it works:
- Discovery: mDNS/Avahi — zero-configuration on local network
- Trust: Manual peer approval only (shared secret / QR code pairing), reuses Federated Learning peer infrastructure
- Fallback chain: Local Ollama → Peer Ollama → Degraded cached response → Template
- E2E encryption: mTLS mutual authentication + per-request encryption with peer’s public key
- Peer selection: Lowest-latency peer with the requested model available
- Billing: Altruistic — no billing between trusted peers
For the user-facing setup guide, see Mesh & Federated Network.
Key files:
| File | Purpose |
|---|---|
crates/application/src/ports/mesh_inference_port.rs | MeshInferencePort trait |
crates/infrastructure/src/adapters/mesh_inference_adapter.rs | Peer proxy, E2E encryption |
crates/infrastructure/src/adapters/degraded_inference_adapter.rs | Modified fallback chain |
Configuration:
[mesh]
enabled = true
discovery = "mdns"
serve_inference = true
max_concurrent_peer_requests = 2
request_timeout_secs = 60
Further Reading
- INNOVATION_IDEAS.md — Full implementation specification for all Generation 2 features
- Sovereign Intelligence Engine — Signal bus architecture connecting all 30 features
- Architecture — How these features integrate into the Clean Architecture
- Memory System — RAG pipeline that underpins neuromorphic memory and Ebbinghaus decay
- Security Hardening — Production security configuration including PQC and Red Team
- Knowledge Visualization — User guide for the Three.js knowledge graph
- Privacy Budget — User guide for the ε-privacy budget dashboard
- Mesh & Federated Network — Setup guide for peer-to-peer features