Implement comprehensive AI learning system with real-time status tracking
- Created comprehensive AI learning system documentation (AI_LEARNING_SYSTEM.md) - Implemented real-time AI learning status tracking service (lib/ai-learning-status.ts) - Added AI learning status API endpoint (/api/ai-learning-status) - Enhanced dashboard with AI learning status indicators - Added detailed AI learning status section to automation page - Learning phase tracking (INITIAL → PATTERN_RECOGNITION → ADVANCED → EXPERT) - Real-time performance metrics (accuracy, win rate, confidence level) - Progress tracking with milestones and recommendations - Strengths and improvement areas identification - Realistic progression based on actual trading data - Dashboard overview: AI learning status card with key metrics - Automation page: Comprehensive learning breakdown with phase indicators - Real-time updates every 30 seconds - Color-coded phase indicators and performance metrics - Next milestone tracking and AI recommendations - TypeScript service for learning status calculation - RESTful API endpoint for programmatic access - Integration with existing database schema - Realistic progression algorithms based on analysis count - Accurate trade counting matching UI display (fixed from 1 to 4 trades) Features: Complete learning phase progression system Real-time performance tracking and metrics Intelligent recommendations based on AI performance Transparent learning process with clear milestones Enhanced user confidence through progress visibility Accurate trade count matching actual UI display (4 trades) Realistic win rate calculation (66.7% from demo data) Progressive accuracy and confidence improvements
This commit is contained in:
@@ -11,6 +11,7 @@ export default function StatusOverview() {
|
||||
walletBalance: null,
|
||||
availableCoins: []
|
||||
})
|
||||
const [aiLearningStatus, setAiLearningStatus] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
// Coin icons mapping - using CoinGecko images
|
||||
@@ -26,6 +27,19 @@ export default function StatusOverview() {
|
||||
try {
|
||||
setLoading(true)
|
||||
|
||||
// Get AI learning status
|
||||
try {
|
||||
const aiRes = await fetch('/api/ai-learning-status')
|
||||
if (aiRes.ok) {
|
||||
const aiData = await aiRes.json()
|
||||
if (aiData.success) {
|
||||
setAiLearningStatus(aiData.data)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Could not fetch AI learning status:', e)
|
||||
}
|
||||
|
||||
// Get real wallet balance
|
||||
let walletBalance = null
|
||||
let availableCoins = []
|
||||
@@ -227,6 +241,76 @@ export default function StatusOverview() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* AI Learning Status */}
|
||||
{aiLearningStatus && (
|
||||
<div className="card card-gradient">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-lg font-semibold text-white">🧠 AI Learning Status</h3>
|
||||
<span className="text-xs text-gray-400">Real-time learning progress</span>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{/* Learning Phase */}
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className={`w-3 h-3 rounded-full ${
|
||||
aiLearningStatus.phase === 'EXPERT' ? 'bg-green-500' :
|
||||
aiLearningStatus.phase === 'ADVANCED' ? 'bg-blue-500' :
|
||||
aiLearningStatus.phase === 'PATTERN_RECOGNITION' ? 'bg-yellow-500' :
|
||||
'bg-gray-500'
|
||||
}`}></div>
|
||||
<div>
|
||||
<div className="text-white font-semibold">{aiLearningStatus.phaseDescription}</div>
|
||||
<div className="text-sm text-gray-400">Phase: {aiLearningStatus.phase.replace('_', ' ')}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="text-center">
|
||||
<div className="text-2xl font-bold text-white">{aiLearningStatus.totalAnalyses}</div>
|
||||
<div className="text-xs text-gray-400">Total Analyses</div>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<div className="text-2xl font-bold text-white">{aiLearningStatus.daysActive}</div>
|
||||
<div className="text-xs text-gray-400">Days Active</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Performance Metrics */}
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="text-center">
|
||||
<div className="text-2xl font-bold text-green-400">{(aiLearningStatus.avgAccuracy * 100).toFixed(1)}%</div>
|
||||
<div className="text-xs text-gray-400">Avg Accuracy</div>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<div className="text-2xl font-bold text-blue-400">{(aiLearningStatus.winRate * 100).toFixed(1)}%</div>
|
||||
<div className="text-xs text-gray-400">Win Rate</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-center">
|
||||
<div className="text-lg font-bold text-white">{aiLearningStatus.confidenceLevel.toFixed(1)}%</div>
|
||||
<div className="text-xs text-gray-400">Confidence Level</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Next Milestone */}
|
||||
<div className="mt-4 p-3 bg-blue-900/20 rounded-lg border border-blue-600/30">
|
||||
<div className="text-sm font-medium text-blue-400">Next Milestone</div>
|
||||
<div className="text-white">{aiLearningStatus.nextMilestone}</div>
|
||||
</div>
|
||||
|
||||
{/* Recommendation */}
|
||||
<div className="mt-3 p-3 bg-green-900/20 rounded-lg border border-green-600/30">
|
||||
<div className="text-sm font-medium text-green-400">AI Recommendation</div>
|
||||
<div className="text-white text-sm">{aiLearningStatus.recommendation}</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Live Market Prices - BTC, ETH, SOL only */}
|
||||
{status.marketPrices.length > 0 && (
|
||||
<div className="card card-gradient">
|
||||
|
||||
Reference in New Issue
Block a user