Generate knowledge base tests
Knowledge base testing focuses on ensuring that your LLM agents meet the specific requirements and expectations of your business domain. It evaluates the agentâs ability to provide accurate, reliable, and appropriate responses in normal usage scenarios based on your knowledge base.
In this section, we will walk you through how to generate knowledge base-focused test cases using the Hub interface.
AI systems in business environments must provide accurate, reliable responses that align with your organizationâs knowledge and policies. However, manually creating comprehensive test cases for every possible business scenario is impractical and often leaves critical failure modes undetected.
Giskard Hub solves this challenge by enabling business users to directly generate synthetic tests from knowledge bases without requiring coding skills.
Knowledge base tests generation
Section titled âKnowledge base tests generationâThe Giskard Hub provides an intuitive interface for synthetic test generation from your knowledge base. It generates legitimate user queries alongside their expected knowledge base context and answer, using the knowledge base as the ground truth. Your knowledge base documents are automatically clustered into key topics upon import. You can also re-use business topics that you set manually during knowledge base import.
Then, for each topic/cluster of knowledge base documents, it generates representative test cases, applying a set of perturbations to generate legitimate queries that mimic real user behavior.
These clusters and topics are then used to generate dedicated tests that challenge the agent to answer questions about specific topics in ways that might not align with your business rules.
Getting started
Section titled âGetting startedâTo begin, navigate to the Datasets page and click Generate in the upper-right corner of the screen. This will open a modal with two options: Knowledge Base, and Scenario. Select the Knowledge Base option.

Select a knowledge base
Section titled âSelect a knowledge baseâThe Knowledge Base tab allows you to generate a dataset with examples based on your knowledge base.

In this case, dataset generation requires two additional pieces of information:
Knowledge Base: Choose the knowledge base you want to use as a reference.Topics: Select the topics within the chosen knowledge base from which you want to generate examples.
Once you click on âGenerate,â you receive a dataset where:
- The groundedness check is enabled by default: the context for each test consists of the relevant knowledge documents needed to answer the query, ensuring the agentâs response is based on the provided ground truth.
- The correctness check is initially disabled, but the expected answer (reference output) is automatically prefilled by the Hub. To evaluate your agent with the correctness check, you can enable it manually for individual conversations or in bulk by selecting multiple conversations in the Dataset tab and enabling the correctness check for all of them.
Next steps
Section titled âNext stepsâ- Agentic vulnerability detection - Try Vulnerability Scanner
- Generate scenario tests - Try Scenario tests
- Review test cases - Make sure to Annotate