-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Description
Currently, when users encounter PPL/DQL query errors in the Logs/Observability interface, the AI Assistant/chatbot doesn't have access to the error context, limiting its ability to help users debug their queries independently.
Problem Statement

As shown in the screenshot, when a query fails with a syntax error (e.g., [d] is not a valid term at this part of the query: timestamp >= now() - 7d
), the error details are displayed in the UI but are not passed to the AI Assistant's context. This prevents the assistant from:
- Understanding the specific error the user encountered
- Providing targeted debugging assistance
- Suggesting the correct syntax fix
- Helping users resolve issues autonomously
Proposed Solution
Enhance the AI Assistant/Agent integration to automatically include query error details in the context when:
- A query fails with validation or syntax errors
- A user asks for help debugging their query
- The assistant is invoked from the logs/observability query interface
Implementation Considerations
The error context should include:
- Error message: The specific error text
- Query: The failed query string
- Error location: Position/line where error occurred (if available)
- Available fields: Context about valid fields/operators
- Query language: PPL, DQL, or other query language being used
Example User Flow
- User writes a PPL query with syntax error
- Query fails and error is displayed
- User asks Assistant: "Why did my query fail?"
- Assistant receives error context and responds with specific fix
- User corrects query based on Assistant's guidance
Benefits
- Improved UX: Users can resolve query errors without leaving the interface
- Self-service debugging: Reduces need for external documentation lookup
- Learning opportunity: Users learn correct syntax through interactive feedback
- Increased adoption: Better assistant experience drives usage of query features
Related Components
src/plugins/ai-agents/
- AI Agent pluginsrc/plugins/ai_chatbot/
orsrc/plugins/chat/
- Chatbot interfacesrc/plugins/context_provider/
- Context management- Query execution components in observability/logs
Acceptance Criteria
- Query errors are captured and structured for context injection
- Error context is automatically added to assistant conversation when relevant
- Assistant can parse error details and provide actionable debugging help
- Solution works for PPL, DQL, and other supported query languages
- Error context includes field suggestions and valid operators
- Documentation updated with examples of error debugging with Assistant
Priority
Medium-High - Significantly improves user experience and assistant utility
Labels
enhancement
, ai
, observability
, logs
, query-language