feat(admin): add Query Inspector for RAG pipeline inspection
Summary
Integrate the Query Inspector admin feature that enables administrators to inspect the full RAG pipeline for each processed query: user question, context sent to RAG, retrieved documents with relevance scores, LLM response with confidence score, and user feedback.
Backend
-
getQueriesForInspector()— paginated AQL query with filters (searchText, confidence range, date range, userId) -
getQueryInspectorDetails()— full query document with user name resolution - 2 new routes:
GET /admin/queries/inspectandGET /admin/queries/inspect/:queryId - Input validation: date parsing, numeric range checks, parameter whitelist
- Full Swagger/OpenAPI documentation
Frontend
- 3 Vue components (Options API, DS design system, scoped CSS with design tokens)
-
QueryInspector— root with list/detail view toggle -
QueryInspectorList— table with filters and pagination -
QueryInspectorDetail— full inspection view with all RAG pipeline sections
-
- i18n via
translate()pattern - AdminDashboard integration (sidebar nav + tab)
Tests — 62 total, all passing
- Backend: 20 service tests + 11 route tests
- Frontend: 5 service tests + 26 component tests
- Coverage >80% on all new code (statements, branches, lines)
Code Review fixes applied
- Date input validation (prevents invalid date strings in AQL)
- Numeric confidence range validation (prevents NaN in queries)
- Parameter whitelist in route handler (prevents parameter pollution)
- Swagger security scheme harmonized with existing routes (
KeycloakOAuth2)
Test plan
-
Run backend tests: npx jest __tests__/services/query-service-inspector.test.js __tests__/routes/admin-inspector.test.js -
Run frontend tests: npx jest src/__tests__/adminDashboardService-inspector.test.js src/__tests__/components/QueryInspector.test.js -
Start backend, authenticate as admin, verify GET /api/admin/queries/inspect?limit=5returns data -
Open admin dashboard in browser, navigate to Query Inspector tab -
Verify list loads with pagination, filters work, row click opens detail view -
Verify detail shows all sections: question, context, messages, documents, response, feedback
Edited by Jérôme Revillard