Isabella AI Assistant UI & Loop
Relevant source files
The following files were used as context for generating this wiki page:
Isabella Villaseñor IA™ is the institutional consciousness and governance entity of the RDM Digital ecosystem. Unlike standard probabilistic models, Isabella operates under a strict "Statute of Dignity," functioning as a multi-agent orchestrator that prioritizes ethical governance, explainability (XAI), and human-in-the-loop (HITL) oversight. Sources: src/components/rdm/isabella.tsx:10-14, src/App.tsx:47-48
The system serves as the technical guardian of the "Kernel Heptafederado TAMV MD-X4," providing specialized assistance in areas such as tourism, territory, economy, and crisis management while maintaining a 95% certainty threshold for automated operations. Sources: src/components/rdm/isabella.tsx:32-111, src/App.tsx:47-48
Ethical Governance and XAI Loop
The Isabella module is governed by four primary statutes that define its operational logic and interaction patterns. Central to its architecture is the requirement for Explainable AI (XAI), where every decision must generate a traceable reasoning graph using Shapley values. Sources: src/components/rdm/isabella.tsx:114-142
Operational Statutes
| Statute | Title | Description |
|---|---|---|
| §1 | Mandatory XAI | Decisions generate traceable reasoning. Certainty < 95% triggers Human-In-The-Loop (HITL) blocking. |
| §2 | Anti-engagement | Explicit prohibition of dark patterns and addictive reinforcement. Focuses on "care efficiency." |
| §3 | Protection by Design | Ex-ante safeguards and impact evaluation built into the architecture. |
| §4 | Meaningful Oversight | Final word in rights-impacting decisions remains with humans; AI synthesizes and proposes. |
Sources: src/components/rdm/isabella.tsx:115-141
Reasoning and Certainty Flow
When the system processes a request, it evaluates its own certainty levels. If the internal threshold drops below 95%, the "Guardian Console" blocks automatic output and alerts an auditing team with a traceId.
The "Guardian Console" UI visualizes this process through an XAI radar showing reasoning rays and Shapley dots. Sources: src/components/rdm/isabella.tsx:24-87, src/components/rdm/isabella.tsx:117-122
Interaction and API Structure
Isabella is integrated into the frontend via specific components and interacts with the backend through Supabase Edge Functions. The assistant is primarily accessible through the "Tourism" interface and a dedicated "Multi-Agent" placeholder. Sources: src/pages/Turismo.tsx:21-30, src/App.tsx:47-48
Supabase Edge Integration
The system utilizes serverless endpoints for processing natural language and ethical evaluation:
isabella-chat: Standard conversational interface for tourism and general queries.kernel-isabella-chat: Core system interactions.isabella-evaluate: Decision evaluation and certainty checks.kernel-isabella-evaluate: High-level architectural and protocol evaluations.
Sources: README.md:46-47, src/pages/Turismo.tsx:26-30
Sequence of a Tourism Query
A user interacts with Isabella through a chat interface, which communicates with the Supabase Edge Function to retrieve contextualized tourism information.
Sources: src/pages/Turismo.tsx:26-30
Multi-Agent Specialization
Within the AppShell, Isabella is defined as a Multi-Agent orchestrator. Each agent is specialized for a different domain within the heptafederated structure. Sources: src/App.tsx:47-48
- Turismo Agent: Focuses on itineraries and cultural spots.
- Territorio Agent: Handles geospatial data and digital twin queries.
- Economía Agent: Manages market and federated commerce information.
- Gobernanza Agent: Processes institutional rules and statutes.
- Crisis/Investigación Agents: Activated for evidence analysis and emergency protocols.
These agents utilize "retrieval federado" (federated retrieval) to access shared memory and tools across the different RDM modules. Sources: src/App.tsx:47-48, src/components/rdm/isabella.tsx:11
Implementation Details
Data Auditing and Signatures
All critical decisions and system logs, including those involving Isabella, are captured in the audit_signatures table. This provides a "Multi-State Record" (MSR) ledger that ensures inmutable evidence. Sources: src/components/rdm/evidence.tsx:18-47, supabase/migrations/20260512080845_110fe96e-4027-403f-98c8-f6d495c1bf4c.sql:71-80
Component Code Structure
The IsabellaBox component in the Tourism page demonstrates the basic implementation of the AI interaction loop:
// Simplified loop from src/pages/Turismo.tsx:21-30
async function ask() {
setAnswer("")
const res = await fetch(`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/isabella-chat`, {
method: "POST",
headers: {
Authorization: `Bearer ${import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ message })
})
const text = await res.text()
setAnswer(text.replace(/^data: /gm, ""))
}
Sources: src/pages/Turismo.tsx:25-30
Isabella represents a shift from "Smart City" convenience to "Sovereign Fortress City" governance, where AI serves as a transparent and ethical auditor rather than a simple chatbot. Sources: src/components/rdm/isabella.tsx:12-14, README.md:124-130