Isabella AI Core
Relevant source files
The following files were used as context for generating this wiki page:
Isabella AI Core is the multimodal emotional intelligence engine of the TAMV MD-X4™ ecosystem. It serves as a sophisticated bridge between the user and the project's complex digital domains, providing real-time empathetic interaction through advanced Large Language Models (LLM) and Text-to-Speech (TTS) synchronization. Designed with scientific principles of affective computing and clinical psychology, the core manages contextual memory, emotional analysis, and proactive notifications across the TAMV platform.
The system operates as a distributed architecture utilizing Supabase Edge Functions to handle streaming responses, emotional dimension tracking, and high-performance audio caching. It is integrated deeply into the TAMV Fusion Core and THE SOF Shadow Engine to provide domain-aware assistance.
Sources: README_TAMV_COMPLETO.md:16-17, supabase/functions/isabella-chat-enhanced/index.ts:31-35, 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:12-25
Architectural Overview
The Isabella AI Core architecture is composed of three primary layers: the frontend hooks for user interaction, the Edge Functions for heavy processing (LLM and TTS), and the persistence layer for contextual memory and caching.
Core Components and Flow
The diagram shows the interaction between frontend hooks, Edge Functions, and external AI providers.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:9-25, README_TAMV_COMPLETO.md:104-110
LLM and Emotional Analysis
Isabella utilizes the google/gemini-2.5-flash model through the Lovable AI Gateway. The system prompt is specifically calibrated for "Neurociencia Afectiva" and "Computación Afectiva," ensuring responses are grammatically perfect and emotionally valid.
Dimensional Emotional Tracking
The system tracks three key emotional dimensions during user interaction:
- Valencia: Positive vs. Negative state.
- Arousal: Level of activation (calm vs. excitement).
- Dominance: Perception of control vs. helplessness.
Sources: supabase/functions/isabella-chat-enhanced/index.ts:31-35, 78-83
Response Protocols
Isabella follows a strict standard response format: [Emotional Validation] + [Information/Response] + [Suggested Action/Empathetic Closure].
Sources: supabase/functions/isabella-chat-enhanced/index.ts:98-100
Audio and TTS Synchronization
The Isabella AI Core features a high-performance Text-to-Speech (TTS) pipeline that utilizes chunk-based synchronization to reduce latency.
Phrase-Level Chunking
Instead of processing entire blocks of text, Isabella breaks responses into "chunks" based on specific punctuation marks (., !, ?, or commas after 50 characters). This allows the audio to begin playing as soon as the first sentence is processed.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:29-36, PLAN-TAMV-MODULAR.md:83-84
TTS Cache System
To optimize costs and performance, the system maintains a tts_cache table using SHA256 hashes of the text and voice ID.
| Field | Type | Description |
|---|---|---|
cache_key | TEXT (PK) | SHA256 hash of text + voice_id |
audio_url | TEXT | Link to Supabase Storage |
char_count | INT | Length of the text fragment |
use_count | INT | Frequency of cache hits |
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:58-69
THE SOF (Shadow Engine) and Fusion Core
Isabella does not operate in isolation; she is orchestrated by "THE SOF" (Shadow Engine) and the "TAMV Fusion Core."
Integration Roles
- THE SOF: Acts as an orchestrator listening to Fusion Core events (posts, purchases, security alerts) and decides if Isabella should notify the user proactively.
- Fusion Core: A global orchestrator (
supabase/functions/tamv-fusion-core/index.ts) that manages health checks and content synchronization, feeding context into Isabella's memory.
The sequence shows proactive communication triggered by system events.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:112-118, supabase/functions/tamv-fusion-core/index.ts:1-15
System Constraints and Performance Targets
The following parameters define the operational boundaries and success metrics for Isabella AI Core:
Operational Limits
- Context Memory: 4096 tokens.
- Vault Messages: Only the last 50 messages are stored for privacy and efficiency.
- Retention: Logs are proposed to be retained for 30 days.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:94-105
Performance Targets
| Metric | Target | Measurement Method |
|---|---|---|
| P95 Response Time | < 4-5 seconds | Chat + Audio completion |
| P50 Response Time | < 2.5 seconds | Chat + Audio completion |
| Cache Hit Rate | > 60% | Produced vs. Cached calls |
| TTS Fallback Rate | < 5% | Failures resulting in text-only |
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:83-89, PLAN-TAMV-MODULAR.md:98-102
Error Handling and Fallbacks
Isabella is designed with high resilience. If the TTS synthesis fails or the ElevenLabs API times out (set at 6 seconds), the system automatically reverts to "text-only" mode. This ensures that the user interface never crashes and interaction continues even during external API failures.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/ISABELLA-PRIME-SPEC.md:73-81, TASKS-TAMV-MODULAR.md:71-73
Isabella AI Core represents a fusion of empathetic human interaction and robust cloud-native architecture, serving as the primary interface for the TAMV MD-X4 ecosystem.