How It Works
synkro.generate() — the Logic Extractor, Golden Scenario Generator, and Trace Verifier.
Quick Start
Agent Signature
Your agent is a plain callable. It receives OpenAI-format messages and returns a string:Inspecting Results
Saving Results
Controlling the Simulation
Number of Scenarios
Thescenarios parameter controls how many test cases are auto-generated from the policy. Synkro produces a balanced mix of positive, negative, edge-case, and irrelevant scenarios.
Conversation Turns
Theturns parameter sets the maximum number of user-agent exchanges per scenario. The simulated user may end the conversation early if it reaches a natural conclusion.
Model Selection
By default, Synkro auto-detects available models. You can specify which model to use for the simulated user and scenario generation, and optionally a separate (stronger) model for verification.Using the Simulator Class
For more control, use theSimulator class directly:
Async Usage
Example: Testing a LangChain Agent
Example: Testing a RAG Pipeline
What Gets Verified
The verifier checks each conversation against the extracted policy rules:| Check | Description |
|---|---|
| Skipped rules | Rules that should have been applied but weren’t |
| Hallucinated rules | Rules cited that don’t exist or don’t apply |
| Contradictions | Logical inconsistencies in the agent’s responses |
| DAG compliance | Dependency order between rules was respected |
| Outcome alignment | Response matches the expected outcome for the scenario |
SimulationResult includes the full VerificationResult with details: