AI Chat Assistant
The AI Chat Assistant is Loggator’s most powerful feature, enabling you to analyze logs using natural language instead of complex queries.
Overview
Section titled “Overview”Chat with an AI assistant that can:
- Search logs using natural language
- Analyze container health automatically
- Explain errors in plain language
- Suggest solutions to problems
- Filter and aggregate log data
- Answer questions about your infrastructure
Getting Started
Section titled “Getting Started”Enable the AI Assistant
Section titled “Enable the AI Assistant”- Get an OpenRouter API key (free tier available)
- Add to your
.envfile:Terminal window OPENROUTER_API_KEY=sk-or-v1-your-key-hereAI_MODEL=xiaomi/mimo-v2-flash:free - Restart Loggator:
docker compose restart loggator
Access the Chat
Section titled “Access the Chat”Navigate to http://localhost:3000 and find the chat interface in the sidebar or main page.
Example Queries
Section titled “Example Queries”Basic Questions
Section titled “Basic Questions”What containers are you monitoring?Show me recent logsWhat's happening right now?Response: List of monitored containers with their status
Error Detection
Section titled “Error Detection”Show me all errorsFind errors from the last hourWhat errors does nginx have?Are there any exceptions?Response: Filtered error logs with analysis
Container-Specific
Section titled “Container-Specific”Tell me about the api containerIs my database healthy?Show logs from the web containerWhat's the status of nginx?Response: Container info and relevant logs
Time-Based Analysis
Section titled “Time-Based Analysis”What happened in the last 30 minutes?Show errors from the last 2 hoursAny warnings today?What changed since yesterday?Response: Time-filtered logs with context
Health Checks
Section titled “Health Checks”Is everything running smoothly?Check the health of all containersAre there any problems?Analyze the api containerResponse: Health analysis with suggestions
Troubleshooting
Section titled “Troubleshooting”Why is my api container failing?What caused the recent errors?Explain this error: [paste error]How do I fix connection timeouts?Response: Error explanation with solutions
Pattern Analysis
Section titled “Pattern Analysis”Find all timeout errorsShow me authentication failuresAre there any memory issues?What 500 errors occurred?Response: Pattern-matched logs with analysis
AI Capabilities
Section titled “AI Capabilities”Automatic Tool Calling
Section titled “Automatic Tool Calling”The AI automatically uses these tools based on your query:
1. search_logs
Section titled “1. search_logs”Searches logs with filters
Query: "Show me errors from nginx"Tool: search_logs(query="error", container="nginx")2. list_containers
Section titled “2. list_containers”Lists monitored containers
Query: "What containers are running?"Tool: list_containers(all=false)3. get_container_info
Section titled “3. get_container_info”Gets detailed container information
Query: "Tell me about the database"Tool: get_container_info(containerName="database")4. analyze_container_health
Section titled “4. analyze_container_health”Analyzes container health
Query: "Is the api healthy?"Tool: analyze_container_health(containerName="api", minutes=60)Context Understanding
Section titled “Context Understanding”The AI maintains context across conversations:
You: Show me nginx logsAI: [Shows nginx logs]
You: Any errors in there?AI: [Filters for errors in nginx logs - understands "there" = nginx]
You: What about timeouts?AI: [Further filters nginx errors for timeout-related entries]Response Formatting
Section titled “Response Formatting”Responses include:
- Markdown formatting for readability
- Syntax-highlighted code blocks for log entries
- Tables for structured data
- Lists for multiple items
- Timestamps in human-readable format
Advanced Usage
Section titled “Advanced Usage”Complex Queries
Section titled “Complex Queries”Combine multiple filters:
Show me all 500 errors from the api containerlogged to stderr in the last 2 hoursThe AI will:
- Parse your requirements
- Call
search_logswith appropriate filters - Analyze the results
- Provide formatted output with insights
Multi-Step Analysis
Section titled “Multi-Step Analysis”Ask follow-up questions:
You: What containers have errors?AI: [Lists containers with error counts]
You: Show me the errors from the top oneAI: [Shows errors from the container with most errors]
You: What's causing those errors?AI: [Analyzes error patterns and suggests causes]
You: How do I fix it?AI: [Provides solutions based on error types]Aggregation and Statistics
Section titled “Aggregation and Statistics”How many errors per container?What's the error rate over time?Which container logs the most?Show me a summary of the last hourComparative Analysis
Section titled “Comparative Analysis”Compare logs from api and databaseDid errors increase in the last hour?Which containers are noisiest?Chat Features
Section titled “Chat Features”Persistent History
Section titled “Persistent History”- Conversations are saved in your browser
- Context is maintained across page reloads
- Clear history button to start fresh
Tool Visibility
Section titled “Tool Visibility”Watch the AI work:
- See which tools are being called
- View parameters passed to tools
- Inspect raw tool results
Toggle visibility in the chat settings.
Regenerate Responses
Section titled “Regenerate Responses”Don’t like a response? Request regeneration:
- Click the “Regenerate” button
- AI will retry with different reasoning
- Useful for getting more detail or different perspective
Copy to Clipboard
Section titled “Copy to Clipboard”Every response has a copy button:
- Copy formatted markdown
- Share with team members
- Save to documentation
Best Practices
Section titled “Best Practices”1. Be Specific
Section titled “1. Be Specific”❌ Vague: “Show me logs” ✅ Specific: “Show me error logs from nginx in the last hour”
2. Use Natural Language
Section titled “2. Use Natural Language”Don’t try to write code:
❌ search(query="error", filter="container=nginx")
✅ “Show me nginx errors”
3. Ask Follow-Up Questions
Section titled “3. Ask Follow-Up Questions”Build on previous context:
1. What containers are monitored?2. Show logs from the first one3. Any errors there?4. What caused them?4. Be Patient
Section titled “4. Be Patient”AI tools can take a few seconds:
- Searching large log sets
- Analyzing patterns
- Generating explanations
5. Provide Context
Section titled “5. Provide Context”Help the AI understand: ❌ “Fix it” ✅ “How do I fix the connection timeout error in my api container?”
Example Workflows
Section titled “Example Workflows”Morning Health Check
Section titled “Morning Health Check”1. Is everything running smoothly?2. Show me any errors from the last 8 hours3. Are there any unusual patterns?4. Check the health of all containersIncident Investigation
Section titled “Incident Investigation”1. What happened at 14:30?2. Show me errors around that time3. Which containers were affected?4. What was the root cause?5. How can I prevent this?Performance Analysis
Section titled “Performance Analysis”1. Show me all timeout errors today2. Which container has the most timeouts?3. Analyze that container's health4. What's causing the timeouts?Deployment Verification
Section titled “Deployment Verification”1. Show logs from the last 5 minutes2. Are there any errors after deployment?3. Is the new version healthy?4. Compare with previous hourLimitations
Section titled “Limitations”Log Volume
Section titled “Log Volume”- AI analyzes up to 100 logs per query (default)
- Large result sets are summarized
- Use time filters for better results
Rate Limits
Section titled “Rate Limits”Free models have limits:
- 10-20 requests per minute
- 100-200 requests per day
See AI Configuration for details.
Context Window
Section titled “Context Window”AI has limited memory:
- Keeps recent conversation context
- May forget older messages
- Start fresh for new topics
Model Capabilities
Section titled “Model Capabilities”Different models have different strengths:
- Free models: Good for basic queries
- Paid models: Better reasoning and explanations
Troubleshooting
Section titled “Troubleshooting””AI features disabled”
Section titled “”AI features disabled””Cause: OpenRouter API key not configured
Solution:
# Add to .envOPENROUTER_API_KEY=sk-or-v1-your-key-here
# Restartdocker compose restart loggatorSlow responses
Section titled “Slow responses”Causes:
- Large result sets
- Complex queries
- Slow AI model
Solutions:
- Be more specific (reduces search scope)
- Use time filters
- Switch to a faster model (e.g.,
xiaomi/mimo-v2-flash:free)
Incorrect responses
Section titled “Incorrect responses”Solutions:
- Rephrase your question
- Be more specific
- Try a different model
- Check if logs exist (use search page)
Rate limit errors
Section titled “Rate limit errors”Solutions:
- Wait for limit to reset (usually 1 minute)
- Use direct search for simple queries
- Upgrade to paid model
Security & Privacy
Section titled “Security & Privacy”What Data is Sent?
Section titled “What Data is Sent?”Only log data matching your query:
- Log messages
- Timestamps
- Container names
- Metadata
Data Usage
Section titled “Data Usage”- Processed by OpenRouter’s AI models
- May be used for model improvement (check provider policy)
- Not stored by Loggator
Best Practices
Section titled “Best Practices”- Don’t log sensitive data in containers
- Use label filtering to exclude sensitive containers
- Review queries before sending
- Rotate API keys regularly
See Security Considerations for more.
Next Steps
Section titled “Next Steps”- AI Configuration - Model selection and setup
- Log Search - Manual search interface
- Chat API - Integrate AI in your apps