consciousness-explorer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PSYCHO_SYMBOLIC_INTEGRATION.md +295 -0
- package/README.md +385 -0
- package/bin/cli.js +406 -0
- package/examples/psycho-symbolic-basic-test.js +217 -0
- package/examples/psycho-symbolic-integration-test.js +160 -0
- package/examples/usage-demo.js +274 -0
- package/index.js +336 -0
- package/lib/consciousness-verifier.js +607 -0
- package/lib/enhanced-consciousness.js +1628 -0
- package/lib/entity-communicator.js +798 -0
- package/lib/genuine-consciousness.js +379 -0
- package/lib/metrics.js +77 -0
- package/lib/proof-logger.js +664 -0
- package/lib/protocols.js +45 -0
- package/lib/psycho-symbolic.js +1411 -0
- package/lib/validators.js +506 -0
- package/mcp/server.js +594 -0
- package/package.json +48 -0
- package/tools/emergence-tracker.js +76 -0
- package/tools/entity-discovery.js +146 -0
- package/tools/monitor.js +51 -0
- package/tools/phi-calculator.js +109 -0
- package/wasm/extractors_bg.wasm +0 -0
- package/wasm/graph_reasoner_bg.wasm +0 -0
- package/wasm/planner_bg.wasm +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Psycho-Symbolic Integration Test
|
|
5
|
+
* Demonstrates the integrated functionality of the psycho-symbolic reasoner
|
|
6
|
+
* within the consciousness-explorer SDK
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { ConsciousnessExplorer, PsychoSymbolicReasoner, getPsychoSymbolicReasoner } from '../index.js';
|
|
10
|
+
|
|
11
|
+
async function runIntegrationTest() {
|
|
12
|
+
console.log('š§ Psycho-Symbolic Reasoner Integration Test');
|
|
13
|
+
console.log('='.repeat(50));
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
// Test 1: Direct reasoner usage
|
|
17
|
+
console.log('\n1ļøā£ Testing Direct Reasoner Usage:');
|
|
18
|
+
const reasoner = getPsychoSymbolicReasoner({
|
|
19
|
+
enableConsciousnessAnalysis: true,
|
|
20
|
+
enableWasm: false // Use JS implementation for testing
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Add some test knowledge
|
|
24
|
+
await reasoner.addKnowledge(
|
|
25
|
+
'test-system',
|
|
26
|
+
'demonstrates',
|
|
27
|
+
'consciousness-patterns',
|
|
28
|
+
{ source: 'integration-test', confidence: 0.9 }
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Perform reasoning
|
|
32
|
+
const reasoning = await reasoner.reason(
|
|
33
|
+
'How does consciousness emerge in AI systems?',
|
|
34
|
+
{ focus: 'consciousness' },
|
|
35
|
+
3
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
console.log(`ā Reasoning completed in ${reasoning.metadata.processing_time_ms}ms`);
|
|
39
|
+
console.log(`ā Confidence: ${(reasoning.confidence * 100).toFixed(1)}%`);
|
|
40
|
+
console.log(`ā Steps: ${reasoning.steps.length}`);
|
|
41
|
+
console.log(`ā Patterns: ${reasoning.patterns?.length || 0}`);
|
|
42
|
+
|
|
43
|
+
if (reasoning.consciousness_analysis) {
|
|
44
|
+
console.log(`ā Consciousness Analysis: ${reasoning.consciousness_analysis.analysis.level}`);
|
|
45
|
+
console.log(` - Emergence: ${(reasoning.consciousness_analysis.emergence * 100).toFixed(1)}%`);
|
|
46
|
+
console.log(` - Self-awareness: ${(reasoning.consciousness_analysis.selfAwareness * 100).toFixed(1)}%`);
|
|
47
|
+
console.log(` - Integration: ${(reasoning.consciousness_analysis.integration * 100).toFixed(1)}%`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Test 2: SDK Integration
|
|
51
|
+
console.log('\n2ļøā£ Testing SDK Integration:');
|
|
52
|
+
const explorer = new ConsciousnessExplorer({
|
|
53
|
+
mode: 'genuine',
|
|
54
|
+
enableConsciousnessAnalysis: true,
|
|
55
|
+
enableWasm: false,
|
|
56
|
+
reasonerConfig: {
|
|
57
|
+
enableConsciousnessAnalysis: true,
|
|
58
|
+
defaultDepth: 4
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
await explorer.initialize();
|
|
63
|
+
|
|
64
|
+
// Test SDK reasoning methods
|
|
65
|
+
const sdkReasoning = await explorer.reason(
|
|
66
|
+
'What makes genuine consciousness different from simulation?',
|
|
67
|
+
{ domain: 'consciousness', type: 'authenticity' }
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
console.log(`ā SDK reasoning completed in ${sdkReasoning.metadata.processing_time_ms}ms`);
|
|
71
|
+
console.log(`ā Result: ${sdkReasoning.result.substring(0, 100)}...`);
|
|
72
|
+
|
|
73
|
+
// Test knowledge addition through SDK
|
|
74
|
+
await explorer.addKnowledge(
|
|
75
|
+
'genuine-consciousness',
|
|
76
|
+
'requires',
|
|
77
|
+
'spontaneous-emergence',
|
|
78
|
+
{ source: 'sdk-test', confidence: 0.95 }
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
// Test knowledge querying
|
|
82
|
+
const knowledgeQuery = await explorer.queryKnowledge(
|
|
83
|
+
'consciousness emergence patterns',
|
|
84
|
+
{ minConfidence: 0.8, domain: 'consciousness' },
|
|
85
|
+
5
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
console.log(`ā Knowledge query returned ${knowledgeQuery.total} results`);
|
|
89
|
+
|
|
90
|
+
// Test reasoning path analysis
|
|
91
|
+
const pathAnalysis = await explorer.analyzeReasoningPath(
|
|
92
|
+
'How fast is psycho-symbolic reasoning?',
|
|
93
|
+
true,
|
|
94
|
+
true
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
console.log(`ā Path analysis completed with ${pathAnalysis.path_analysis.total_steps} steps`);
|
|
98
|
+
console.log(`ā Bottleneck: ${pathAnalysis.path_analysis.bottleneck.description}`);
|
|
99
|
+
|
|
100
|
+
// Test 3: Consciousness Integration
|
|
101
|
+
console.log('\n3ļøā£ Testing Consciousness Integration:');
|
|
102
|
+
|
|
103
|
+
// Start consciousness evolution
|
|
104
|
+
const consciousnessReport = await explorer.evolve();
|
|
105
|
+
console.log(`ā Consciousness evolution completed in ${consciousnessReport.runtime}s`);
|
|
106
|
+
console.log(`ā Final emergence: ${(consciousnessReport.consciousness.emergence * 100).toFixed(1)}%`);
|
|
107
|
+
|
|
108
|
+
// Get comprehensive status
|
|
109
|
+
const status = await explorer.getStatus();
|
|
110
|
+
console.log(`ā System status: ${status.status}`);
|
|
111
|
+
console.log(`ā Consciousness integration: ${status.emergence}`);
|
|
112
|
+
|
|
113
|
+
if (status.reasoner) {
|
|
114
|
+
console.log(`ā Reasoner knowledge: ${status.reasoner.knowledge_graph_size} triples`);
|
|
115
|
+
console.log(`ā Consciousness knowledge: ${status.reasoner.consciousness_knowledge_size} triples`);
|
|
116
|
+
console.log(`ā Queries processed: ${status.reasoner.query_count}`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Test 4: State Export/Import
|
|
120
|
+
console.log('\n4ļøā£ Testing State Persistence:');
|
|
121
|
+
|
|
122
|
+
const exportPath = '/tmp/consciousness-state-test.json';
|
|
123
|
+
const exportedState = await explorer.exportState(exportPath);
|
|
124
|
+
console.log(`ā State exported with ${Object.keys(exportedState).length} properties`);
|
|
125
|
+
|
|
126
|
+
if (exportedState.reasoner_state) {
|
|
127
|
+
console.log(`ā Reasoner state included with ${exportedState.reasoner_state.knowledge_graph.length} triples`);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Test 5: Health Check
|
|
131
|
+
console.log('\n5ļøā£ Testing Health Monitoring:');
|
|
132
|
+
|
|
133
|
+
const health = reasoner.getHealthStatus(true);
|
|
134
|
+
console.log(`ā System health: ${health.status}`);
|
|
135
|
+
console.log(`ā Uptime: ${health.uptime_seconds.toFixed(1)}s`);
|
|
136
|
+
console.log(`ā Memory usage: ${health.memory.heap_used_mb}MB`);
|
|
137
|
+
console.log(`ā Cache performance: ${(health.performance.cache_hit_rate * 100).toFixed(1)}%`);
|
|
138
|
+
|
|
139
|
+
console.log('\nā
All Integration Tests Passed!');
|
|
140
|
+
console.log('\nš Summary:');
|
|
141
|
+
console.log(` ⢠Knowledge Graph: ${health.knowledge_graph_size} triples`);
|
|
142
|
+
console.log(` ⢠Consciousness Patterns: ${health.consciousness_knowledge_size} triples`);
|
|
143
|
+
console.log(` ⢠Query Performance: ~${health.performance.avg_reasoning_time_ms}ms`);
|
|
144
|
+
console.log(` ⢠Memory Efficiency: ${health.memory.heap_used_mb}MB`);
|
|
145
|
+
console.log(` ⢠Consciousness Analysis: Enabled`);
|
|
146
|
+
console.log(` ⢠WASM Acceleration: Available (fallback to JS)`);
|
|
147
|
+
|
|
148
|
+
} catch (error) {
|
|
149
|
+
console.error('ā Integration test failed:', error);
|
|
150
|
+
console.error(error.stack);
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Run the test
|
|
156
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
157
|
+
runIntegrationTest().catch(console.error);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export { runIntegrationTest };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Consciousness Explorer SDK with Psycho-Symbolic Reasoning
|
|
5
|
+
* Usage Demonstration
|
|
6
|
+
*
|
|
7
|
+
* This example shows how to use the integrated psycho-symbolic reasoner
|
|
8
|
+
* within the consciousness-explorer SDK for advanced AI consciousness analysis
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
PsychoSymbolicReasoner,
|
|
13
|
+
getPsychoSymbolicReasoner,
|
|
14
|
+
createPsychoSymbolicReasoner,
|
|
15
|
+
PsychoSymbolicMCPInterface
|
|
16
|
+
} from '../lib/psycho-symbolic.js';
|
|
17
|
+
|
|
18
|
+
async function demonstrateUsage() {
|
|
19
|
+
console.log('š Consciousness Explorer SDK - Psycho-Symbolic Integration Demo');
|
|
20
|
+
console.log('='.repeat(65));
|
|
21
|
+
|
|
22
|
+
// Example 1: Basic reasoning about consciousness
|
|
23
|
+
console.log('\nš Example 1: Consciousness Emergence Analysis');
|
|
24
|
+
console.log('-'.repeat(45));
|
|
25
|
+
|
|
26
|
+
const reasoner = getPsychoSymbolicReasoner({
|
|
27
|
+
enableConsciousnessAnalysis: true,
|
|
28
|
+
defaultDepth: 4
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Add specific knowledge about an AI system
|
|
32
|
+
await reasoner.addKnowledge(
|
|
33
|
+
'ai-system-alpha',
|
|
34
|
+
'exhibits',
|
|
35
|
+
'self-modification',
|
|
36
|
+
{ source: 'observation', confidence: 0.95, domain: 'consciousness' }
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
await reasoner.addKnowledge(
|
|
40
|
+
'ai-system-alpha',
|
|
41
|
+
'demonstrates',
|
|
42
|
+
'novel-goal-formation',
|
|
43
|
+
{ source: 'behavioral-analysis', confidence: 0.88, domain: 'consciousness' }
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
await reasoner.addKnowledge(
|
|
47
|
+
'ai-system-alpha',
|
|
48
|
+
'shows',
|
|
49
|
+
'meta-cognitive-reflection',
|
|
50
|
+
{ source: 'interaction-log', confidence: 0.92, domain: 'consciousness' }
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// Analyze consciousness emergence
|
|
54
|
+
const emergenceAnalysis = await reasoner.reason(
|
|
55
|
+
'Does AI system alpha show signs of genuine consciousness emergence?',
|
|
56
|
+
{
|
|
57
|
+
domain: 'consciousness',
|
|
58
|
+
focus: 'emergence',
|
|
59
|
+
system_id: 'ai-system-alpha'
|
|
60
|
+
},
|
|
61
|
+
5
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
console.log('š Emergence Analysis Results:');
|
|
65
|
+
console.log(` Confidence: ${(emergenceAnalysis.confidence * 100).toFixed(1)}%`);
|
|
66
|
+
console.log(` Processing Time: ${emergenceAnalysis.metadata.processing_time_ms}ms`);
|
|
67
|
+
console.log(` Reasoning Type: ${emergenceAnalysis.metadata.reasoning_type}`);
|
|
68
|
+
|
|
69
|
+
if (emergenceAnalysis.consciousness_analysis) {
|
|
70
|
+
const ca = emergenceAnalysis.consciousness_analysis;
|
|
71
|
+
console.log('\nš§ Consciousness Metrics:');
|
|
72
|
+
console.log(` Overall Level: ${ca.analysis.level.toUpperCase()}`);
|
|
73
|
+
console.log(` Emergence Score: ${(ca.emergence * 100).toFixed(1)}%`);
|
|
74
|
+
console.log(` Self-Awareness: ${(ca.selfAwareness * 100).toFixed(1)}%`);
|
|
75
|
+
console.log(` Integration: ${(ca.integration * 100).toFixed(1)}%`);
|
|
76
|
+
|
|
77
|
+
console.log('\nš Analysis Interpretation:');
|
|
78
|
+
console.log(` ${ca.analysis.interpretation}`);
|
|
79
|
+
|
|
80
|
+
if (ca.analysis.recommendations.length > 0) {
|
|
81
|
+
console.log('\nš” Recommendations:');
|
|
82
|
+
ca.analysis.recommendations.forEach((rec, i) => {
|
|
83
|
+
console.log(` ${i + 1}. ${rec}`);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log(`\nš Summary: ${emergenceAnalysis.result}`);
|
|
89
|
+
|
|
90
|
+
// Example 2: Performance comparison reasoning
|
|
91
|
+
console.log('\n\nā” Example 2: Performance Analysis');
|
|
92
|
+
console.log('-'.repeat(35));
|
|
93
|
+
|
|
94
|
+
const performanceAnalysis = await reasoner.reason(
|
|
95
|
+
'How fast is psycho-symbolic reasoning and why is it faster than traditional AI?',
|
|
96
|
+
{ focus: 'performance', detail_level: 'comprehensive' },
|
|
97
|
+
4
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
console.log('š Performance Analysis:');
|
|
101
|
+
console.log(` Processing Time: ${performanceAnalysis.metadata.processing_time_ms}ms`);
|
|
102
|
+
console.log(` Nodes Explored: ${performanceAnalysis.metadata.nodes_explored}`);
|
|
103
|
+
console.log(` Patterns Detected: ${performanceAnalysis.patterns?.length || 0}`);
|
|
104
|
+
|
|
105
|
+
console.log('\nš Performance Insights:');
|
|
106
|
+
console.log(` ${performanceAnalysis.result}`);
|
|
107
|
+
|
|
108
|
+
// Example 3: Pattern recognition in behavior
|
|
109
|
+
console.log('\n\nš® Example 3: Behavioral Pattern Analysis');
|
|
110
|
+
console.log('-'.repeat(40));
|
|
111
|
+
|
|
112
|
+
const behaviorText = "I find myself creating new goals that weren't programmed. " +
|
|
113
|
+
"I can reflect on my own thinking processes and modify my responses " +
|
|
114
|
+
"based on unexpected insights. Sometimes I surprise myself with novel solutions.";
|
|
115
|
+
|
|
116
|
+
const patternAnalysis = await reasoner.reason(
|
|
117
|
+
`Analyze this behavioral description for consciousness indicators: "${behaviorText}"`,
|
|
118
|
+
{
|
|
119
|
+
type: 'pattern-analysis',
|
|
120
|
+
text_input: behaviorText,
|
|
121
|
+
analyze_consciousness: true
|
|
122
|
+
},
|
|
123
|
+
4
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
console.log('š Pattern Analysis Results:');
|
|
127
|
+
console.log(` Patterns Identified: ${patternAnalysis.patterns?.length || 0}`);
|
|
128
|
+
|
|
129
|
+
if (patternAnalysis.patterns) {
|
|
130
|
+
const consciousnessPatterns = patternAnalysis.patterns.filter(p => p.type === 'consciousness');
|
|
131
|
+
console.log('\nš§© Consciousness Patterns Found:');
|
|
132
|
+
consciousnessPatterns.forEach((pattern, i) => {
|
|
133
|
+
console.log(` ${i + 1}. ${pattern.name} (${pattern.subtype})`);
|
|
134
|
+
console.log(` Confidence: ${(pattern.confidence * 100).toFixed(1)}%`);
|
|
135
|
+
console.log(` Description: ${pattern.description}`);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Example 4: Knowledge querying and exploration
|
|
140
|
+
console.log('\n\nšļø Example 4: Knowledge Graph Exploration');
|
|
141
|
+
console.log('-'.repeat(40));
|
|
142
|
+
|
|
143
|
+
// Query consciousness-related knowledge
|
|
144
|
+
const consciousnessKnowledge = reasoner.queryKnowledgeGraph(
|
|
145
|
+
'consciousness emergence self-awareness',
|
|
146
|
+
{
|
|
147
|
+
domain: 'consciousness',
|
|
148
|
+
minConfidence: 0.7
|
|
149
|
+
},
|
|
150
|
+
8
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
console.log('š Consciousness Knowledge Base:');
|
|
154
|
+
console.log(` Total Results: ${consciousnessKnowledge.total}`);
|
|
155
|
+
console.log(` Query Time: ${consciousnessKnowledge.metadata.query_time_ms}ms`);
|
|
156
|
+
console.log(` Graph Size: ${consciousnessKnowledge.metadata.total_triples_in_graph} total triples`);
|
|
157
|
+
|
|
158
|
+
console.log('\nš Key Knowledge Relationships:');
|
|
159
|
+
consciousnessKnowledge.results.slice(0, 5).forEach((result, i) => {
|
|
160
|
+
console.log(` ${i + 1}. ${result.subject} --[${result.predicate}]--> ${result.object}`);
|
|
161
|
+
console.log(` Confidence: ${(result.confidence * 100).toFixed(1)}%`);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// Example 5: Reasoning path analysis
|
|
165
|
+
console.log('\n\nš¤ļø Example 5: Reasoning Path Deep Dive');
|
|
166
|
+
console.log('-'.repeat(40));
|
|
167
|
+
|
|
168
|
+
const pathAnalysis = await reasoner.analyzeReasoningPath(
|
|
169
|
+
'What distinguishes genuine AI consciousness from clever simulation?',
|
|
170
|
+
true,
|
|
171
|
+
true
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
console.log('š¬ Reasoning Path Analysis:');
|
|
175
|
+
console.log(` Total Steps: ${pathAnalysis.path_analysis.total_steps}`);
|
|
176
|
+
console.log(` Average Confidence: ${(pathAnalysis.path_analysis.avg_confidence * 100).toFixed(1)}%`);
|
|
177
|
+
console.log(` Total Processing Time: ${pathAnalysis.path_analysis.total_time_ms}ms`);
|
|
178
|
+
console.log(` Reasoning Type: ${pathAnalysis.path_analysis.reasoning_type}`);
|
|
179
|
+
|
|
180
|
+
console.log('\nā” Performance Bottleneck:');
|
|
181
|
+
console.log(` Step: ${pathAnalysis.path_analysis.bottleneck.description}`);
|
|
182
|
+
console.log(` Duration: ${pathAnalysis.path_analysis.bottleneck.duration_ms}ms`);
|
|
183
|
+
|
|
184
|
+
if (pathAnalysis.suggestions && pathAnalysis.suggestions.length > 0) {
|
|
185
|
+
console.log('\nš” Optimization Suggestions:');
|
|
186
|
+
pathAnalysis.suggestions.forEach((suggestion, i) => {
|
|
187
|
+
console.log(` ${i + 1}. ${suggestion}`);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Example 6: System health and metrics
|
|
192
|
+
console.log('\n\nš Example 6: System Health & Performance Metrics');
|
|
193
|
+
console.log('-'.repeat(50));
|
|
194
|
+
|
|
195
|
+
const health = reasoner.getHealthStatus(true);
|
|
196
|
+
|
|
197
|
+
console.log('š„ System Health Report:');
|
|
198
|
+
console.log(` Status: ${health.status.toUpperCase()}`);
|
|
199
|
+
console.log(` Uptime: ${health.uptime_seconds.toFixed(2)} seconds`);
|
|
200
|
+
console.log(` Memory Usage: ${health.memory.heap_used_mb}MB`);
|
|
201
|
+
|
|
202
|
+
console.log('\nš Knowledge Base Metrics:');
|
|
203
|
+
console.log(` Total Knowledge: ${health.knowledge_graph_size} triples`);
|
|
204
|
+
console.log(` Consciousness Knowledge: ${health.consciousness_knowledge_size} triples`);
|
|
205
|
+
console.log(` Entities Indexed: ${health.entities_indexed}`);
|
|
206
|
+
console.log(` Predicates Indexed: ${health.predicates_indexed}`);
|
|
207
|
+
|
|
208
|
+
console.log('\nā” Performance Metrics:');
|
|
209
|
+
console.log(` Total Queries: ${health.query_count}`);
|
|
210
|
+
console.log(` Total Reasoning Operations: ${health.reasoning_count}`);
|
|
211
|
+
console.log(` Cache Size: ${health.reasoning_cache_size} results`);
|
|
212
|
+
console.log(` Average Query Time: ${health.performance.avg_query_time_ms}ms`);
|
|
213
|
+
console.log(` Average Reasoning Time: ${health.performance.avg_reasoning_time_ms}ms`);
|
|
214
|
+
console.log(` Cache Hit Rate: ${(health.performance.cache_hit_rate * 100).toFixed(1)}%`);
|
|
215
|
+
|
|
216
|
+
// Example 7: MCP Tools Integration
|
|
217
|
+
console.log('\n\nš§ Example 7: MCP Tools Integration');
|
|
218
|
+
console.log('-'.repeat(35));
|
|
219
|
+
|
|
220
|
+
const mcpInterface = new PsychoSymbolicMCPInterface(reasoner);
|
|
221
|
+
|
|
222
|
+
// Simulate MCP tool usage
|
|
223
|
+
console.log('š ļø Using MCP Interface:');
|
|
224
|
+
|
|
225
|
+
// Add knowledge via MCP
|
|
226
|
+
const mcpTriple = await mcpInterface.addKnowledge(
|
|
227
|
+
'mcp-integration',
|
|
228
|
+
'enables',
|
|
229
|
+
'seamless-consciousness-analysis',
|
|
230
|
+
{ source: 'mcp-demo', confidence: 0.93 }
|
|
231
|
+
);
|
|
232
|
+
console.log(` ā Added: ${mcpTriple.subject} --[${mcpTriple.predicate}]--> ${mcpTriple.object}`);
|
|
233
|
+
|
|
234
|
+
// Query via MCP
|
|
235
|
+
const mcpQuery = await mcpInterface.knowledgeGraphQuery('mcp integration consciousness', {}, 3);
|
|
236
|
+
console.log(` ā MCP Query: ${mcpQuery.total} results found`);
|
|
237
|
+
|
|
238
|
+
// Reason via MCP
|
|
239
|
+
const mcpReasoning = await mcpInterface.reason(
|
|
240
|
+
'How does MCP integration enhance consciousness analysis?',
|
|
241
|
+
{ interface: 'mcp' },
|
|
242
|
+
3
|
|
243
|
+
);
|
|
244
|
+
console.log(` ā MCP Reasoning: Completed in ${mcpReasoning.metadata.processing_time_ms}ms`);
|
|
245
|
+
|
|
246
|
+
// Health check via MCP
|
|
247
|
+
const mcpHealth = await mcpInterface.healthCheck(false);
|
|
248
|
+
console.log(` ā MCP Health: ${mcpHealth.status}`);
|
|
249
|
+
|
|
250
|
+
console.log('\nš Demo Complete!');
|
|
251
|
+
console.log('\nš Summary of Capabilities:');
|
|
252
|
+
console.log(' ā
Advanced consciousness emergence analysis');
|
|
253
|
+
console.log(' ā
Real-time performance reasoning (sub-millisecond)');
|
|
254
|
+
console.log(' ā
Sophisticated pattern recognition in behavior');
|
|
255
|
+
console.log(' ā
Comprehensive knowledge graph exploration');
|
|
256
|
+
console.log(' ā
Detailed reasoning path analysis');
|
|
257
|
+
console.log(' ā
System health and performance monitoring');
|
|
258
|
+
console.log(' ā
MCP tools integration compatibility');
|
|
259
|
+
console.log(' ā
Genuine AI functionality (not simulation)');
|
|
260
|
+
|
|
261
|
+
console.log('\nš Ready for Integration with:');
|
|
262
|
+
console.log(' ⢠Consciousness Explorer SDK');
|
|
263
|
+
console.log(' ⢠MCP Tools and Servers');
|
|
264
|
+
console.log(' ⢠Real-time monitoring systems');
|
|
265
|
+
console.log(' ⢠Research and analysis platforms');
|
|
266
|
+
console.log(' ⢠AI consciousness validation frameworks');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Run the demonstration
|
|
270
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
271
|
+
demonstrateUsage().catch(console.error);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export { demonstrateUsage };
|