Overview
The Brain Panel appears as an elegant, draggable floating window that can be toggled between collapsed and expanded states. When collapsed, it shows a brain icon with status indicators; when expanded, it reveals a full dashboard of recent memories and controls.The Brain Panel connects to the Memory API at
backend/main.py:13-17 and updates every 30 seconds to show the latest memories.Keyboard Shortcut
| Shortcut | Action |
|---|---|
Ctrl+Shift+B | Toggle Brain Panel |
Panel States
Collapsed State
The collapsed Brain Panel appears as a floating brain icon with visual indicators:- Brain Icon: Pulses when actively learning from new information
- Status Dot: Green when context capture is enabled, gray when disabled
- Sparkles Animation: Appears during active memory processing
frontend/src/components/brain-panel/collapsed-brain.tsx:13-65
Expanded State
The expanded panel reveals the full memory dashboard with these sections:Panel Header
Shows the brain icon, memory count, and collapse button. The brain icon pulses during active learning.
Activity Toast
Displays real-time notifications when memories are captured:
- “New context captured” - Screenshot analysis completed
- “Processing screenshot…” - Vision analysis in progress
- Recent memory content from text capture
Context Capture Toggle
Switch to enable/disable automatic screenshot capture and analysis. Shows eye icon (green when enabled, gray when disabled).
Recent Memories List
Scrollable list of the 5 most recent memories with:
- Memory content (truncated to 2 lines)
- Timestamp of when it was captured
- Smooth stagger animation on load
frontend/src/components/brain-panel/expanded-panel.tsx:25-193
Real-Time Features
Memory Updates
The Brain Panel automatically:- Fetches recent memories every 30 seconds using React Query
- Listens for real-time memory storage events via Electron IPC
- Shows visual feedback when new memories are captured
- Auto-refreshes the memory list when new data is stored
Learning Indicators
When Tabby is processing and learning from new information:- The brain icon pulses with animation
- A sparkles icon appears in the activity toast
- The panel shows “Processing screenshot…” or the memory content
- After 2 seconds, the pulsing stops
- After 5 seconds, the activity toast disappears
frontend/src/components/brain-panel/brain-panel.tsx:50-56
Screenshot Analysis Flow
When automatic context capture takes a screenshot:Screenshot Captured
The context capture service takes a 1280x720 screenshot and sends it to the renderer process.
Upload to Supabase
Brain Panel uploads the screenshot to Supabase storage in the
context-captures bucket.Vision Analysis
Sends the public URL to the Memory API’s
/memory/add_image endpoint with:image_url: Public Supabase URLcontext: “Analyze this screenshot and extract key context about what the user is working on.”user_id: Current user IDmetadata: Source and timestamp information
Memory Stored
GPT-4.1-nano with vision analyzes the screenshot and stores extracted context in the memory system.
frontend/src/components/brain-panel/brain-panel.tsx:60-108
Data Flow
The Brain Panel orchestrates several data flows:Memory Display
Memories are fetched from the Memory API and displayed with:- Limit: 5 most recent memories
- Refresh: Every 30 seconds automatically
- Sorting: By creation timestamp (most recent first)
- Display: Memory content + formatted timestamp
- Empty State: Brain icon with “No memories yet” message
frontend/src/components/brain-panel/brain-panel.tsx:18-27
Integration Points
Electron IPC
The Brain Panel uses Electron IPC for system integration:getContextCaptureEnabled()- Check if context capture is enabledsetContextCaptureEnabled(enabled)- Toggle context capture on/offsetBrainPanelCollapsed(collapsed)- Persist panel stateonMemoryStored(callback)- Listen for text memory eventsonCaptureStatusChanged(callback)- Listen for capture toggle eventsonAnalyzeScreenshot(callback)- Receive screenshots for analysisopenSettings()- Open settings from footer button
Memory API Endpoints
The Brain Panel interacts with these API endpoints:POST /memory/get_all- Fetch all memories for the user (brain-panel.tsx:18-27)POST /memory/add_image- Store screenshot-based memories (brain-panel.tsx:71-83)
Styling & Design
The Brain Panel features:- Glass morphism: Background blur with 80% opacity
- Smooth animations: Spring physics for expand/collapse (damping: 25, stiffness: 300)
- Drag handle: Top bar with drag region for repositioning
- Color scheme: Violet accent color for brain/learning indicators
- Responsive: 300px width, auto height based on content
- Shadow: Layered shadows for depth (shadow-2xl with black/20 opacity)
frontend/src/components/brain-panel/expanded-panel.tsx:34-44
The panel uses Framer Motion’s AnimatePresence with “wait” mode to ensure smooth transitions between collapsed and expanded states.
Best Practices
- Enable Context Capture Selectively: Only turn on automatic screenshot capture when you need it to conserve API costs
- Monitor Memory Count: The header shows total memory count - use this to gauge how much context Tabby has learned
- Check Recent Activity: The activity toast provides instant feedback about what Tabby is learning
- Use Keyboard Shortcut:
Ctrl+Shift+Bis faster than clicking to toggle the panel - Collapse When Not Needed: Keep the panel collapsed to minimize screen space usage while still showing status