import './BrainProcess.css'; const STAGES = [ { id: 'reflect', label: 'Reflect', region: 'Prefrontal Cortex', desc: 'Sets cognitive direction, interprets intent', phases: ['perception'], color: '#d4a853', /* amber */ }, { id: 'retrieve', label: 'Retrieve', region: 'Hippocampus', desc: 'Searches sensory, semantic & episodic stores', phases: ['recall', 'association'], color: '#4ecdc4', /* teal */ }, { id: 'synthesize', label: 'Synthesize', region: 'Neocortex', desc: 'Weaves memories into language & response', phases: ['synthesis', 'reasoning'], color: '#e07a38', /* fire */ }, ]; const MEMORY_LAYERS = [ { id: 'sensory', label: 'Sensory', tech: 'ChromaDB', detail: 'Vector embeddings', key: 'sensoryDocuments', color: '#4ecdc4' }, { id: 'semantic', label: 'Semantic', tech: 'Neo4j', detail: 'Knowledge graph', key: 'graphRelations', color: '#a87ecf' }, { id: 'episodic', label: 'Episodic', tech: 'SQLite', detail: 'Temporal log', key: null, color: '#d4a853' }, { id: 'working', label: 'Working', tech: 'Context', detail: 'Active buffer', key: 'workingMemory', color: '#e07a38' }, ]; function getActiveStage(traces, isLoading) { if (!isLoading || !traces?.length) return null; const last = traces[traces.length - 1]; for (const s of STAGES) { if (s.phases.includes(last?.phase)) return s.id; } return null; } // 3D card tilt on mouse move function tiltCard(e) { const el = e.currentTarget; const r = el.getBoundingClientRect(); const dx = (e.clientX - (r.left + r.width / 2)) / (r.width / 2); const dy = (e.clientY - (r.top + r.height / 2)) / (r.height / 2); el.style.setProperty('--tx', `${dy * -7}deg`); el.style.setProperty('--ty', `${dx * 7}deg`); } function resetTilt(e) { e.currentTarget.style.setProperty('--tx', '0deg'); e.currentTarget.style.setProperty('--ty', '0deg'); } function BrainProcess({ brainState, messageCount = 0 }) { const isActive = brainState.isLoading; const activeId = getActiveStage(brainState.traces, isActive); const traces = (brainState.traces || []).slice(-6); const hasSparks = brainState.sparks?.length > 0; const showIdle = !isActive && traces.length === 0 && !brainState.reflection && !hasSparks; return (
{stage.desc}
{brainState.reflection}
Background dreaming — spontaneous associations
{s.content}
Send a message to watch
the cognitive process unfold live.