Whitepaper · Prototipo validadoWhitepaper · Validated prototype

PAIPIA

Una arquitectura cognitiva híbrida y homeostática para la memoria episódica infinita mediante mitosis de nodos.A hybrid, homeostatic cognitive architecture for infinite episodic memory through node mitosis.

Autor / Author Óscar Tejada Fernández FechaDate Enero 2026January 2026 EstadoStatus Prototipo validadoValidated prototype · v1.5 LicenciaLicense CC BY 4.0
Descargar PDF (ES)Download PDF (ES)
Resumen

Los grandes modelos de lenguaje (LLMs) actuales enfrentan limitaciones críticas inherentes a su diseño monolítico: la "amnesia catastrófica" derivada de ventanas de contexto finitas, y la "fragilidad operativa" por la dependencia de inferencia centralizada. Este documento presenta PAIPIA (Personal Artificial Intelligence & Psycho-Integrative Architecture), una arquitectura local-first que desacopla el almacenamiento de memoria del motor de inferencia. PAIPIA introduce tres mecanismos novedosos: (1) mitosis de memoria, un algoritmo de discretización de grafos donde los nodos de almacenamiento se dividen físicamente al alcanzar un umbral de saturación; (2) regulación homeostática (τ), un modelo dinámico que modula las estrategias de recuperación de información en función del estrés del sistema; y (3) resiliencia híbrida, una topología de inferencia conmutada entre nube (Gemini) y borde (Ollama). Los resultados experimentales demuestran persistencia indefinida de los datos y operación continua en hardware de consumo.

01

Introducción

El paradigma predominante en la memoria de IA se basa en bases de datos vectoriales (RAG) o en la expansión bruta de la ventana de contexto (T → ∞). Sin embargo, el coste computacional de la atención crece de forma cuadrática, O(n²), con la longitud del contexto, lo que hace insostenible la memoria perfecta a largo plazo.

PAIPIA propone una alternativa biomimética: modelar la memoria no como un búfer continuo, sino como un tejido vivo de celdas discretas (nodos JSON). Al trasladar la complejidad del modelo a la arquitectura del sistema, se logra una funcionalidad cercana a una AGI (inteligencia artificial general) acotada, ejecutable en el borde (edge computing) con coste marginal nulo.

02

Arquitectura del sistema y formalización matemática

2.1. La célula de memoria (discretización física)

A diferencia de los registros conversacionales monolíticos, PAIPIA estructura la información en objetos discretos denominados "esferas" (S). Cada esfera se define como una tupla:

Si = ⟨ Hi , Pi ⟩

Donde:

  • Hi (memoria blanda). Metadatos ligeros cargados en RAM: palabras clave, marca temporal y grafo de conexiones.
  • Pi (memoria dura). El contenido narrativo en bruto (payload), cargado mediante lazy loading solo bajo demanda.

Algoritmo de mitosis (división celular)

Para evitar el desbordamiento de contexto, definimos una función de masa μ(Si) que representa la carga cognitiva (bytes o turnos de conversación) del nodo actual. Sea θ el umbral crítico de saturación, fijado experimentalmente en 5 interacciones o 1 MB. La transición de estado del sistema se define como:

μ(Si) ≥ θ  ⟹  Mitosis(Si) → { Sicerrado , Si+1activo }

Durante la mitosis:

  1. El nodo padre Si se sella (solo lectura).
  2. Se instancia el nodo hijo Si+1, que hereda el perfil de usuario U y las palabras clave.
  3. Se establece una arista dirigida E(Si, Si+1) con un peso semántico ω ≈ 1.0, lo que garantiza la continuidad temporal del grafo.

2.2. Núcleo homeostático (dinámica de la variable τ)

PAIPIA implementa una variable de control, τ (tau), que representa el estado "psicológico" del sistema, acotada en τ ∈ [0, 1].

τ → 0Supervivencia

Baja entropía: respuestas deterministas y foco estrecho.

τ → 1Creatividad

Alta entropía: búsqueda estocástica y relajación.

La evolución de τ en el tiempo t se modela como una ecuación en diferencias finitas basada en el estímulo de entrada It:

τt+1 = τt + α·[ It ∈ Relax ] − β·[ It ∈ Stress ] + γ(0.5 − τt)

Donde [ · ] es la función indicadora de la naturaleza del input (análisis de sentimiento o urgencia); α y β son coeficientes de sensibilidad a estímulos positivos y negativos respectivamente, con β > α para simular el sesgo de negatividad biológico; y γ(0.5 − τt) es el término de fuerza restauradora que tiende a devolver el sistema al equilibrio (homeostasis) en ausencia de estímulos.

Recuperación termodinámica (simulated annealing)

La variable τ modula el radio de búsqueda R en el grafo de memoria:

R(τ) ∝ eτ

En estados de estrés (τ ≈ 0), el sistema minimiza R e ignora los nodos latentes para optimizar la latencia. En estados de calma, R aumenta, lo que permite "alucinaciones controladas" y asociaciones creativas lejanas.

2.3. El puente híbrido (resiliencia fail-fast)

Para resolver la "fragilidad de la nube", PAIPIA implementa una función de inferencia compuesta F(x), donde x es el prompt:

F(x) = { Gemini(x, τ) si estado_API = 200 Ollama(x, τ) si estado_API ∈ {429, 500} ∨ Latencia > δ

El sistema prioriza el modelo de nube (mayor capacidad de razonamiento), pero conmuta de forma instantánea al modelo local cuantizado (Llama 3.2) ante errores de cuota o de red, garantizando una disponibilidad del 99,9 %.

03

Estudio de caso: "recuperación Tell-Colón"

Se realizó un experimento longitudinal para validar la persistencia de la memoria episódica en sesiones disjuntas.

Configuración experimental

  • Fase A. Interacción sobre "Guillermo Tell" (t₀). El sistema genera los nodos S1592 y S70cf.
  • Fase B. Cambio de contexto a "Cristóbal Colón" (t₁). El sistema genera el nodo Sbcd7.
  • Perturbación. En t₂, dentro del contexto de Colón, se consulta sobre el tópico de la fase A.

Resultados

  1. Indexación. El sistema almacenó correctamente los contextos ortogonales en nodos separados.
  2. Recuperación latente. Al recibir la consulta, el motor de búsqueda (con τ ≈ 0.9) escaneó los nodos "fríos" (T < 0.1), identificó las palabras clave en S1592 e inyectó el resumen de "Tell" en la ventana de atención actual.
  3. Metacognición. En el nodo S1592, la IA reconoció un patrón repetitivo ("bucle monotemático") y ejecutó una corrección de trayectoria, evidenciando una capacidad de autorregulación basada en el historial.
04

Visualización de estados

La arquitectura expone su estado interno mediante una interfaz WebGL (Three.js), lo que permite la observabilidad cognitiva:

  • Topología. Visualización de grafos dirigidos por fuerza.
  • Termodinámica visual. Los nodos se renderizan con un gradiente de color C(Ti), donde Ti es la temperatura de acceso reciente (rojo → azul).
05

Conclusión

PAIPIA demuestra que la persistencia tipo AGI no requiere infraestructura de hiperescala. Mediante la mitosis celular para la gestión de datos y un motor híbrido para la resiliencia, hemos creado una arquitectura cognitiva robusta, escalable y respetuosa con la privacidad. Este enfoque de "baja tecnología, alto concepto" ofrece un camino sostenible hacia la inteligencia artificial personal.

06

Referencias y código fuente

El código fuente, los logs de memoria en JSON y los algoritmos del kernel están disponibles para su revisión en los anexos adjuntos:

  • Lógica del kernel homeostático (kernel_v*.py).
  • Asignador de memoria y mitosis (paipia_memory_allocator.py).
  • Logs experimentales del sistema de archivos Cortex (*.json).
Abstract

Today's large language models (LLMs) face critical limitations inherent to their monolithic design: the "catastrophic amnesia" that comes from finite context windows, and the "operational fragility" of depending on centralised inference. This document presents PAIPIA (Personal Artificial Intelligence & Psycho-Integrative Architecture), a local-first architecture that decouples memory storage from the inference engine. PAIPIA introduces three novel mechanisms: (1) memory mitosis, a graph-discretisation algorithm in which storage nodes physically split on reaching a saturation threshold; (2) homeostatic regulation (τ), a dynamic model that modulates information-retrieval strategies according to system stress; and (3) hybrid resilience, a switched inference topology between cloud (Gemini) and edge (Ollama). Experimental results show indefinite data persistence and continuous operation on consumer hardware.

01

Introduction

The prevailing paradigm for AI memory rests on vector databases (RAG) or on brute expansion of the context window (T → ∞). However, the computational cost of attention grows quadratically, O(n²), with context length, which makes perfect long-term memory unsustainable.

PAIPIA proposes a biomimetic alternative: modelling memory not as a continuous buffer but as a living tissue of discrete cells (JSON nodes). By shifting complexity from the model to the system architecture, it achieves functionality close to a bounded AGI (artificial general intelligence), runnable at the edge with near-zero marginal cost.

02

System architecture and mathematical formalisation

2.1. The memory cell (physical discretisation)

Unlike monolithic conversational logs, PAIPIA structures information into discrete objects called "spheres" (S). Each sphere is defined as a tuple:

Si = ⟨ Hi , Pi ⟩

Where:

  • Hi (soft memory). Lightweight metadata held in RAM: keywords, timestamp and connection graph.
  • Pi (hard memory). The raw narrative content (payload), loaded via lazy loading only on demand.

Mitosis algorithm (cell division)

To prevent context overflow, we define a mass function μ(Si) representing the cognitive load (bytes or conversation turns) of the current node. Let θ be the critical saturation threshold, set experimentally at 5 interactions or 1 MB. The system's state transition is defined as:

μ(Si) ≥ θ  ⟹  Mitosis(Si) → { Siclosed , Si+1active }

During mitosis:

  1. The parent node Si is sealed (read-only).
  2. The child node Si+1 is instantiated, inheriting the user profile U and the keywords.
  3. A directed edge E(Si, Si+1) is established with semantic weight ω ≈ 1.0, guaranteeing the temporal continuity of the graph.

2.2. Homeostatic core (dynamics of the τ variable)

PAIPIA implements a control variable, τ (tau), representing the system's "psychological" state, bounded in τ ∈ [0, 1].

τ → 0Survival

Low entropy: deterministic responses and narrow focus.

τ → 1Creativity

High entropy: stochastic search and relaxation.

The evolution of τ over time t is modelled as a finite-difference equation based on the input stimulus It:

τt+1 = τt + α·[ It ∈ Relax ] − β·[ It ∈ Stress ] + γ(0.5 − τt)

Where [ · ] is the indicator function of the input's nature (sentiment or urgency analysis); α and β are sensitivity coefficients to positive and negative stimuli respectively, with β > α to simulate the biological negativity bias; and γ(0.5 − τt) is the restoring-force term that tends to return the system to equilibrium (homeostasis) in the absence of stimuli.

Thermodynamic retrieval (simulated annealing)

The τ variable modulates the search radius R within the memory graph:

R(τ) ∝ eτ

In stress states (τ ≈ 0), the system minimises R, ignoring latent nodes to optimise latency. In calm states, R grows, allowing "controlled hallucinations" and distant creative associations.

2.3. The hybrid bridge (fail-fast resilience)

To address "cloud fragility", PAIPIA implements a composite inference function F(x), where x is the prompt:

F(x) = { Gemini(x, τ) if API status = 200 Ollama(x, τ) if API status ∈ {429, 500} ∨ Latency > δ

The system prioritises the cloud model (greater reasoning capacity) but switches instantly to the quantised local model (Llama 3.2) on quota or network errors, guaranteeing 99.9% availability.

03

Case study: "Tell-Colón recovery"

A longitudinal experiment was run to validate the persistence of episodic memory across disjoint sessions.

Experimental setup

  • Phase A. Interaction about "William Tell" (t₀). The system generates nodes S1592 and S70cf.
  • Phase B. Context switch to "Christopher Columbus" (t₁). The system generates node Sbcd7.
  • Perturbation. At t₂, within the Columbus context, the phase-A topic is queried.

Results

  1. Indexing. The system correctly stored the orthogonal contexts in separate nodes.
  2. Latent retrieval. On receiving the query, the search engine (with τ ≈ 0.9) scanned the "cold" nodes (T < 0.1), identified the keywords in S1592 and injected the "Tell" summary into the current attention window.
  3. Metacognition. In node S1592, the AI recognised a repetitive pattern (a "single-topic loop") and executed a trajectory correction, evidencing a capacity for self-regulation based on history.
04

State visualisation

The architecture exposes its internal state through a WebGL (Three.js) interface, enabling cognitive observability:

  • Topology. Force-directed graph visualisation.
  • Visual thermodynamics. Nodes are rendered with a colour gradient C(Ti), where Ti is the recent-access temperature (red → blue).
05

Conclusion

PAIPIA shows that AGI-like persistence does not require hyperscale infrastructure. Through cellular mitosis for data management and a hybrid engine for resilience, we have built a cognitive architecture that is robust, scalable and privacy-respecting. This "low technology, high concept" approach offers a sustainable path towards personal artificial intelligence.

06

References and source code

The source code, the JSON memory logs and the kernel algorithms are available for review in the attached appendices:

  • Homeostatic kernel logic (kernel_v*.py).
  • Memory allocator and mitosis (paipia_memory_allocator.py).
  • Experimental logs from the Cortex file system (*.json).
Más investigaciónMore research Descargar PDF (ES)Download PDF (ES)