- Method 1: Press the
Bkey anywhere in Redstring - Method 2: Click the brain icon (🧠) in the header next to the bookmark icon
- Expected: A panel should slide in from the right side
- Look for the connection indicator in the AI panel header
- Should show "Connected" with a green dot
- If "Disconnected", check browser console for errors
Symptoms: Pressing 'B' or clicking brain icon does nothing
Solutions:
- Check Console: Open browser dev tools (F12) and look for errors
- Verify Import: The AI panel is now inline in
src/Panel.jsx(left tab: AI) - Check State: Verify
showAICollaborationstate is properly initialized - Refresh Page: Sometimes React state gets stuck
Debug Commands (in browser console):
// Check if AI panel state exists
console.log('AI Panel State:', window.showAICollaboration);
// Manually toggle AI panel
window.toggleAIPanel = () => {
const event = new KeyboardEvent('keydown', { key: 'b' });
document.dispatchEvent(event);
};Symptoms: Panel shows "Disconnected" or connection errors
Solutions:
- Check MCP Provider: Verify
mcpProvider.jsis properly imported - Check MCP Client: Verify
mcpClient.jsis properly imported - Check Store: Make sure
useGraphStoreis accessible
Debug Commands:
// Test MCP connection manually
import('./src/services/mcpClient.js').then(module => {
const client = module.default;
client.initialize().then(result => {
console.log('MCP Connection:', result);
}).catch(error => {
console.error('MCP Error:', error);
});
});Symptoms: Chat works but AI operations return errors
Solutions:
- Check Graph Data: Make sure there are nodes in the active graph
- Check Store State: Verify graph store has data
- Check Tool Registration: Verify MCP tools are properly registered
Debug Commands:
// Check graph store state
import('./src/store/graphStore.jsx').then(module => {
const store = module.default;
const state = store.getState();
console.log('Graph Store State:', {
activeGraphId: state.activeGraphId,
graphsCount: state.graphs.size,
nodesCount: state.nodes.size
});
});Symptoms: Panel appears but looks broken or unstyled
Solutions:
- Check CSS Import: Verify
src/ai/AICollaborationPanel.cssis imported insrc/Panel.jsx - Check CSS Classes: Verify CSS classes are properly applied
- Check Z-Index: Panel might be behind other elements
Debug Commands:
// Check if CSS is loaded
const styles = document.styleSheets;
const aiStyles = Array.from(styles).find(sheet =>
sheet.href && sheet.href.includes('AICollaborationPanel.css')
);
console.log('AI CSS Loaded:', !!aiStyles);Run these in the browser console to test different aspects:
// Test 1: Basic Panel Toggle
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'b' }));
// Test 2: MCP Connection
import('./src/services/mcpClient.js').then(m => m.default.initialize());
// Test 3: Graph Store Access
import('./src/store/graphStore.jsx').then(m => console.log(m.default.getState()));
// Test 4: AI Operations
import('./src/services/mcpClient.js').then(async m => {
const client = m.default;
await client.initialize();
const result = await client.exploreKnowledge('test', { maxDepth: 1 });
console.log('AI Operation Result:', result);
});- Press 'B' key → Panel appears
- Click brain icon → Panel toggles
- Panel shows "Connected" status
- Chat input accepts text
- AI responds to messages
- Operations mode shows available tools
- Insights mode displays AI insights
- Advanced options show session info
Enable debug logging by adding this to the browser console:
// Enable debug logging
localStorage.setItem('ai-debug', 'true');
console.log('AI Debug Mode Enabled');
// Check debug logs
const debugLogs = [];
const originalLog = console.log;
console.log = (...args) => {
if (args[0] && args[0].includes('[AI')) {
debugLogs.push(args);
}
originalLog.apply(console, args);
};If you're still having issues:
- Check Console: Look for error messages in browser dev tools
- Check Network: Look for failed requests in Network tab
- Check React DevTools: Inspect component state and props
- Check File Structure: Verify all files are in the correct locations
src/
├── Panel.jsx (contains inline AI panel) ✅
├── ai/AICollaborationPanel.css ✅
├── services/
│ ├── mcpProvider.js ✅
│ └── mcpClient.js ✅
└── NodeCanvas.jsx ✅ (updated with AI integration)
Module not found: Check file paths and importsCannot read property of undefined: Check component propsMCP connection failed: Check MCP server initializationGraph store not found: Check Zustand store setup
When everything is working correctly, you should see:
- Visual: Brain icon in header, panel slides in from right
- Console:
[AI Collaboration] Initializing connection...messages - Status: "Connected" with green indicator in panel
- Functionality: Can send messages and receive AI responses
- Performance: Smooth animations and responsive UI
Remember: The AI integration is designed to be robust and self-healing. Most issues can be resolved by refreshing the page or checking the console for specific error messages.