Inverse-RAG Synthetic Test Generation for Agentic AI Assistants in Intelligent Environments: A Mutation-Based Evaluation of Fault-Detection Effectiveness
Abstract Conversational agents that retrieve documents and call tools are being deployed to operate buildings, campuses and other intelligent environments, yet engineering teams rarely have labelled data with which to test them before real users arrive. Synthetic test generation is widely offered as a remedy, but there is little evidence on whether synthetic suites detect faults, which generation strategies matter, and whether automatically produced ground truth can be trusted. We present an inverse retrieval-augmented generation pipeline that turns knowledge-base context into persona-conditioned questions with verifiable answers, expands them along multi-hop, linguistic, edge-case, adversarial and privacy dimensions, and filters them with a claim-level critic. In a controlled study with a deterministic tool-using agent and a grammar-based teacher, synthetic suites of 100 tests detected 93% of fifteen design faults, against 29% for a rule-based suite and at most 40% for re-implemented Ragas- and PyRIT-style generators. On faults independent of the generator design the advantage was smaller: 92% versus 75-77% of 312 automatically generated code mutants, and 70% versus 54-62% of twelve faults from external taxonomies. Fault-level hypothesis tests confirmed the advantage on design faults and code mutants (Holm-adjusted ≤ 0.022), but not on the underpowered held-out set, and the code-mutant advantage lost significance when mutants were aggregated by function. A claim-level critic removed injected label errors in the structured corpus, but on paraphrased, outdated and cross-referenced documents it had to route 41% of items to human review to stay error-free. With a local 7B-parameter LLM agent on realistic facility documentation, a variant with an LLM teacher and critic detected 8 of 12 configuration faults against 4-5 for the other suites, although no difference among the pipeline's suites was statistically significant with 12 faults, while natively generated Ragas tests carried stale reference answers and garak/PyRIT probes detected none. Synthetic generation was therefore an effective bootstrap under the conditions studied, provided that its oracles are verified and its fault coverage is checked against independent faults.
Authors
- Cristian Rodríguez Rivero (ORCID: https://orcid.org/0000-0002-4315-7476)
- Paula Soledad Otano
Institutions
- National Technological University (AR)
- Fontys University of Applied Sciences (NL)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-13
- DOI
- https://doi.org/10.21203/rs.3.rs-11421050/v1
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- preprint
Funders
- Universidad Tecnológica Nacional