An AI-powered log analysis assistant that helps developers and system administrators analyze application logs, network logs, and syslog data through an intuitive chat interface.
TraceAgent combines the power of AI with comprehensive log analysis capabilities to help teams quickly identify and resolve issues in their systems. The application features a dual-interface design with a log table on the left and an AI chat interface on the right.
traceagent/
βββ frontend/ # React-based frontend application
β βββ src/
β β βββ components/
β β β βββ LogTable.tsx # Log display and filtering
β β β βββ ChatInterface.tsx # AI chat interface
β β βββ services/
β β β βββ api.ts # Backend API integration
β β βββ App.tsx # Main application component
β βββ README.md # Frontend documentation
βββ backend/ # Flask-based backend API
β βββ app.py # Main Flask application
β βββ log_fetcher.py # Log data fetching service
β βββ models.py # Data models
β βββ config.py # Configuration
β βββ README.md # Backend documentation
βββ README.md # This file
- Multi-source Log Analysis: Application logs, network logs, and syslog
- AI-Powered Chat Interface: Natural language queries for log analysis
- Real-time Log Display: Interactive table with search and filtering
- Smart Log Classification: Automatic categorization by level and source
- Export Functionality: Download filtered log data
- Multi-client Support: Switch between different client organizations
- Error Detection: Identify and categorize errors across all log sources
- Performance Monitoring: Analyze response times and latency patterns
- Security Analysis: Detect suspicious activities and authentication issues
- Network Diagnostics: Monitor connectivity and packet loss
- Trend Analysis: Identify patterns and anomalies in log data
- Natural Language Queries: Ask questions about your logs in plain English
- Contextual Responses: AI understands log analysis terminology
- Smart Suggestions: Get recommendations for common log analysis tasks
- Interactive Analysis: Follow-up questions and detailed investigations
- React 18 with TypeScript
- Material-UI (MUI) for component library
- Lucide React for modern icons
- Dark Theme optimized for log analysis workflows
- Flask with Flask-RESTX for API
- CORS enabled for frontend integration
- Multi-Provider AI integration (Deepseek, OpenAI, Anthropic, Google AI)
- S3 Log Storage for real log data
- Swagger UI for API documentation
- Docker and Docker Compose
- OR Node.js 16+ and Python 3.8+ (for local development)
The easiest way to run TraceAgent is using Docker Compose:
- Configure LLM Provider (Optional):
# Copy example environment file
cp env.example .env
# Edit .env and configure your preferred AI provider
# See LLM_CONFIGURATION.md for detailed instructions- Start the development environment:
docker compose up- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
- Backend Swagger: http://localhost:5001/swagger/
- View logs:
docker compose logs -f- Stop services:
docker compose downTraceAgent supports multiple AI providers for the chat interface. You can configure your preferred provider using environment variables:
- Deepseek AI (default) - Free tier available
- OpenAI - GPT-3.5-turbo, GPT-4
- Anthropic Claude - Claude-3 models
- Google AI - Gemini Pro
# Using OpenAI
export LLM_PROVIDER=openai
export OPENAI_API_KEY=your-api-key-here
# Using Claude
export LLM_PROVIDER=anthropic
export ANTHROPIC_API_KEY=your-api-key-here
# Using Google AI
export LLM_PROVIDER=google
export GOOGLE_API_KEY=your-api-key-hereFor detailed configuration instructions, see LLM_CONFIGURATION.md.
docker compose up # Start services with hot reloading
docker compose up -d # Start services in background
docker compose down # Stop services
docker compose logs -f # View logs in real-time
docker compose build # Rebuild images
docker compose restart # Restart servicesIf you prefer to run services locally without Docker:
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.template .env
# Edit .env and add your Deepseek API key- Start the backend server:
python app.pyThe backend will be available at:
- API: http://localhost:5001
- Swagger UI: http://localhost:5001/swagger/
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm start- Open http://localhost:3000 in your browser
The system supports multiple client organizations:
- Maze Bank - Financial services
- LifeInvader Social - Social media platform
- Trevor Phillips & Associates - Consulting firm
Each client has access to:
- Application Logs - API endpoints, user activities, authentication
- Network Logs - Connection attempts, security actions, traffic analysis
- System Logs - Host activities, process monitoring, system health
The frontend communicates with the backend through the following endpoints:
GET /api/health- Health checkGET /api/config- Get available clientsGET /api/logs/{client_id}/{log_type}- Fetch log dataPOST /api/chat- Send messages to AI assistantGET /api/admin/all-logs- Admin access to all logs
- Real-time Log Fetching: Logs are fetched from S3 storage
- Dynamic Client Selection: Switch between different organizations
- AI Chat Integration: Real AI responses based on log analysis
- Error Handling: Graceful fallbacks for connection issues
- Loading States: Visual feedback during data fetching
- "Show me all errors from the last hour"
- "Analyze performance issues in the application logs"
- "Check for security events in the network logs"
- "Find database connection failures"
- "What's causing the high latency?"
- Search for specific error messages or patterns
- Filter by log level (ERROR, WARNING, INFO, DEBUG)
- Filter by source (application, network, syslog)
- Switch between different client organizations
- Export filtered results for further analysis
- API Endpoints: Add new endpoints in
app.py - Log Fetching: Modify
log_fetcher.pyfor different data sources - AI Integration: Update
vulnerable_agent.pyfor AI responses - Configuration: Update
config.pyfor new clients or settings
- Components: Add new components in
src/components/ - API Service: Update
src/services/api.tsfor new endpoints - Styling: Use Material-UI's
sxprop for component styling - TypeScript: Add proper types for all new features
- Frontend Development: Work in the
frontend/directory - Backend Development: Work in the
backend/directory - Documentation: Keep README files updated
- Code Quality: Follow TypeScript and Python best practices
- Testing: Ensure all features are thoroughly tested
This project is part of the TraceAgent log analysis platform.