Getting Started

Get up and running with Khwand AI in minutes

1Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 18+ or Python 3.8+
  • Git
  • A GitHub or GitLab account

2Install Khwand SDK

Install the Khwand SDK using your preferred package manager:

npm
npm install @khwand/sdk
yarn
yarn add @khwand/sdk
pnpm
pnpm add @khwand/sdk
python
pip install khwand-sdk

3Initialize Your Project

Initialize Khwand in your project directory:

cli
npx khwand init

4Configure GitHub Integration

Connect your GitHub repository to enable automated testing on PRs:

setup
npx khwand setup github

Quick Start Guide

1

Create Your First Test

Create a test file for your AI agent:

Code
// tests/agent.test.ts
import { testAgent } from '@khwand/sdk';

testAgent('customer-support-agent', {
  scenarios: [
    {
      input: 'What is your refund policy?',
      expected: 'mentions 30-day refund window',
    },
    {
      input: 'I want to speak to a human',
      expected: 'offers human handoff',
    },
  ],
});
2

Run Tests Locally

Execute your test suite locally:

Code
npx khwand test
3

Push to GitHub

Push your changes to trigger automated testing:

Code
git push origin main
4

View Results

Check your GitHub PR for test results and stability scores:

Code
# Results appear in your PR checks

Configuration

khwand.config.ts

Main configuration file for Khwand

khwand.config.ts
export default {
  // Test configuration
  tests: {
    timeout: 30000, // 30 seconds per test
    parallel: true, // Run tests in parallel
    retries: 2, // Retry failed tests twice
  },

  // Model configuration
  models: {
    primary: 'gpt-4',
    fallback: ['claude-3-opus', 'gemini-pro'],
  },

  // Reporting
  reporting: {
    format: ['json', 'html'],
    output: './khwand-reports',
  },
};