UNPKG

universal-ai-brain

Version:

🧠 UNIVERSAL AI BRAIN 3.3 - The world's most advanced cognitive architecture with 24 specialized systems, MongoDB 8.1 $rankFusion hybrid search, latest Voyage 3.5 embeddings, and framework-agnostic design. Works with Mastra, Vercel AI, LangChain, OpenAI A

198 lines (149 loc) • 6.28 kB
# 🧠 Universal AI Brain 3.0 - Cognitive Systems Testing Suite **Complete validation framework for all 24 cognitive systems with real MongoDB Atlas data** > **Part of Universal AI Brain 3.0** - The world's most comprehensive cognitive architecture for AI agents ## šŸŽÆ Overview This testing suite validates every cognitive system in Universal AI Brain 3.0 using **REAL DATA ONLY** - no mocks, no simulations. Each test writes actual data to MongoDB Atlas, immediately retrieves it, and validates the cognitive system's behavior. ## šŸ”§ Setup ### 1. Install Dependencies ```bash npm install ``` ### 2. Configure Environment Update `.env` with your credentials: ```env # MongoDB Atlas (provided by ROM) MONGODB_URI=mongodb+srv://romiluz:H97r3aQBnxWawZbx@aibrain2js.rhcftey.mongodb.net/?retryWrites=true&w=majority&appName=aibrain2js # OpenAI API Key OPENAI_API_KEY=your_openai_key_here # Voyage AI (provided by ROM) VOYAGE_API_KEY=pa-NHB7D_EtgEImAVQkjIZ6PxoGVHcTOQvUujwDeq8m9-Q ``` ### 3. Database Setup The tests will automatically create collections in the `cognitive_systems_test` database: - `test_working_memory` - `test_episodic_memory` - `test_semantic_memory` - `test_memory_decay` - `test_analogical_mapping` - `test_causal_reasoning` - `test_attention_management` - `test_confidence_tracking` - `test_emotional_intelligence` - `test_social_intelligence` - `test_cultural_knowledge` - `test_goal_hierarchy` - `test_temporal_planning` - `test_skill_capability` - `test_human_feedback` - `test_self_improvement` - `test_safety_guardrails` - `test_multimodal_processing` - `test_tool_interface` - `test_workflow_orchestration` - `test_vector_search` - `test_hybrid_search` - `test_context_injection` - `test_realtime_monitoring` ## šŸš€ Running Tests ### Test All 24 Cognitive Systems ```bash npm run test:all ``` ### Test Specific System Categories ```bash # Memory Systems (4 systems) npm run test:memory # Reasoning Systems (6 systems) npm run test:reasoning # Emotional Systems (3 systems) npm run test:emotional # Social Systems (3 systems) npm run test:social # Temporal Systems (2 systems) npm run test:temporal # Meta Systems (6 systems) npm run test:meta ``` ### Quick Memory Test ```bash node src/run-memory-tests.js ``` ## 🧠 Cognitive Systems Being Tested ### 🧩 Memory Systems (4) 1. **Working Memory** - Active information processing 2. **Episodic Memory** - Personal experiences and events 3. **Semantic Memory** - Facts and knowledge 4. **Memory Decay** - Forgetting mechanisms ### šŸ¤” Reasoning Systems (6) 5. **Analogical Mapping** - Finding similarities 6. **Causal Reasoning** - Cause and effect relationships 7. **Attention Management** - Focus and filtering 8. **Confidence Tracking** - Uncertainty quantification 9. **Context Injection** - Dynamic context enhancement 10. **Vector Search** - Semantic similarity search ### šŸŽ­ Emotional Systems (3) 11. **Emotional Intelligence** - Emotion recognition and response 12. **Social Intelligence** - Social dynamics understanding 13. **Cultural Knowledge** - Cultural awareness and adaptation ### šŸ‘„ Social Systems (3) 14. **Goal Hierarchy** - Goal decomposition and management 15. **Human Feedback Integration** - Learning from feedback 16. **Safety Guardrails** - Ethical and safety constraints ### ā° Temporal Systems (2) 17. **Temporal Planning** - Time-based planning 18. **Skill Capability Management** - Skill assessment and development ### šŸ”§ Meta Systems (6) 19. **Self-Improvement** - Continuous learning 20. **Multi-Modal Processing** - Handling different data types 21. **Tool Interface** - External tool integration 22. **Workflow Orchestration** - Process management 23. **Hybrid Search** - Combined text and vector search ($rankFusion) 24. **Real-time Monitoring** - System performance tracking ## šŸ“Š Test Results Each test provides: - āœ… **Real Data Written** - Actual MongoDB document insertion - šŸ” **Data Retrieved** - Immediate data retrieval and validation - šŸ“ˆ **Performance Metrics** - System-specific performance indicators - šŸŽÆ **Cognitive Validation** - Behavioral validation of the cognitive system - šŸ“‹ **Detailed Analysis** - Comprehensive system analysis ### Example Output ``` 🧠 Testing: WORKING_MEMORY šŸ“ Description: Active information processing and temporary storage ────────────────────────────────────────────────── šŸ“ Step 1: Writing real test data to MongoDB... āœ… Data written - ID: 507f1f77bcf86cd799439011 šŸ“Š Test data: { "activeItems": ["microservices", "database_design", "api_gateway"], "capacity": 7, "priority": "high", "timestamp": "2024-01-15T10:30:00.000Z" } šŸ” Step 2: Fetching and analyzing data... āœ… Data retrieved successfully šŸ“Š Retrieved: { ... } āœ… Step 4: Cognitive system validation šŸŽÆ System: working_memory - WORKING WITH REAL DATA šŸ“ˆ Performance: Data successfully written and retrieved šŸ”„ MongoDB Integration: Functional ``` ## šŸŽÆ Testing Philosophy **ROM's Requirements:** - āœ… **NO MOCK DATA** - Only real MongoDB operations - āœ… **Immediate Validation** - Write data, then immediately fetch and analyze - āœ… **Real Performance Metrics** - Actual system behavior measurement - āœ… **MongoDB Atlas Integration** - Using the real production database - āœ… **Hybrid Search Testing** - MongoDB $rankFusion validation - āœ… **Comprehensive Coverage** - All 24 cognitive systems tested ## šŸ”— Integration with Demo These tests validate that each cognitive system works with real data before building the live demo. The test results provide: 1. **Proof of Functionality** - Each system works with real MongoDB data 2. **Performance Baselines** - Actual performance metrics for demo planning 3. **Data Patterns** - Real data structures for demo visualization 4. **System Reliability** - Confidence in cognitive system stability ## šŸ“ˆ Next Steps After successful testing: 1. āœ… Validate all 24 cognitive systems 2. šŸŽØ Build the live demo with real brain visualization 3. šŸš€ Showcase Universal AI Brain 3.0 to the world **This testing framework ensures ROM's demo will showcase REAL cognitive intelligence, not simulated behavior!**