Creating Sessions
Parameters
| Parameter | Type | Description |
|---|---|---|
policy | str | Policy text to extract rules from |
session_id | str | Optional session identifier (auto-generated if not provided) |
db_url | str | Optional database URL (defaults to SQLite at ~/.synkro/sessions.db) |
Loading Sessions
Resume a previously saved session:Pipeline Methods
Run pipeline steps with automatic persistence:HITL Refinement Methods
Refine rules, scenarios, and taxonomy with natural language commands:refine_rules()
refine_scenarios()
refine_taxonomy()
refine_trace()
Show Commands
Inspect session state at any time:done()
Complete the pipeline in one call - synthesizes traces, verifies them, and optionally exports:Parameters
| Parameter | Type | Description |
|---|---|---|
output | str | Optional output file path |
count | int | Optional number of traces to generate |
Session Management
list_sessions()
delete()
undo()
status()
Cost Tracking
Every session tracks LLM calls, costs, and timing - including all HITL refinement calls:extract_rules()→ extraction phasegenerate_scenarios()→ scenarios phaserefine_rules(),refine_scenarios(),refine_taxonomy(),refine_trace()→ hitl phasesynthesize_traces()→ traces phaseverify_traces()→ verification phase
Remote Database (Postgres)
Use Postgres instead of SQLite for multi-user or production deployments:- Neon
- Supabase
- AWS RDS
- Self-hosted Postgres
Complete Example
Properties
| Property | Type | Description |
|---|---|---|
session_id | str | Session identifier |
policy | Policy | Policy document |
logic_map | LogicMap | Extracted rules |
scenarios | list[GoldenScenario] | Generated scenarios |
traces | list[Trace] | Generated traces |
verified_traces | list[Trace] | Verified traces |
model | Model | Generation model |
grading_model | Model | Grading model |
dataset_type | DatasetType | Output dataset type |