Skip to Content
GlossaryKnowledge - Glossary

Knowledge

Back to GlossaryConfiguration

Domain context and source materials used to generate context-aware test scenarios for your AI application.

Also known as: knowledge base, context

Overview

Knowledge sources provide domain-specific context that Rhesis uses to generate relevant, realistic test scenarios. By importing your documentation, FAQs, or domain knowledge, you can create tests that reflect actual use cases.

Knowledge Sources

  • Text documents: Upload documentation or guides
  • FAQs: Common questions and answers
  • Use cases: Real customer scenarios
  • Domain expertise: Industry-specific knowledge

Using Sources with SDK: The SDK can extract content from various sources to generate contextually relevant tests:

python
from rhesis.sdk.services.extractor import SourceSpecification, SourceType
from rhesis.sdk.synthesizers import PromptSynthesizer

# Define knowledge sources
sources = [
      SourceSpecification(
          type=SourceType.WEBSITE,
          name="API Docs",
          metadata={"url": "https://example.com/docs"},
      ),
      SourceSpecification(
          type=SourceType.DOCUMENT,
          name="Knowledge Base",
          metadata={"path": "./knowledge_base.pdf"},
      ),
]

# Generate tests from sources
synthesizer = PromptSynthesizer(
      prompt="Generate tests based on the provided documentation",
      sources=sources,
)
test_set = synthesizer.generate(num_tests=50)

Benefits

Using knowledge sources ensures your tests reflect real-world scenarios based on actual domain expertise. The system automatically generates tests covering different aspects of your domain, letting you create hundreds of test cases quickly. When your knowledge base evolves, you can simply update the source material and regenerate tests rather than manually updating each one.

Best Practices

  • Keep updated: Refresh knowledge as your product evolves
  • Be comprehensive: Include edge cases and exceptions
  • Structure well: Organize knowledge by topic or feature
  • Validate generated tests: Review AI-generated tests for quality

Documentation

Related Terms