Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7d21ab4
Create CRUD for experiments, and basic vibe coded support - to clean …
aldenhallak Nov 21, 2025
ad3222c
Add save template dialog and section for backend templates.
aldenhallak Nov 24, 2025
af74909
Make template saving more visible
aldenhallak Nov 24, 2025
50f7b86
Add update template functionality.
aldenhallak Nov 24, 2025
471b964
Ensure that templates have unique names.
aldenhallak Nov 24, 2025
295c558
prettier + lint
aldenhallak Nov 24, 2025
c28a971
Add documentation for experiments.
aldenhallak Nov 24, 2025
35bcfbd
Merge branch 'main' into experiments
aldenhallak Nov 24, 2025
3d769aa
Merge remote-tracking branch 'upstream/main' into experiments
aldenhallak Nov 25, 2025
005be48
Merge origin/experiments and resolve conflicts, keeping research temp…
aldenhallak Nov 25, 2025
4fcdbd2
Fix broken stage_builder_dialog.ts by restoring from correct state
aldenhallak Nov 25, 2025
7a5ddc7
Remove the specification of collection from standard experiment endpo…
aldenhallak Nov 25, 2025
5042f58
Update button to be in header and to have save new template as dropdown.
aldenhallak Nov 25, 2025
a94b480
remove passed in collection name and ensure typing is strong.
aldenhallak Nov 25, 2025
c1f0e45
Merge branch 'main' into experiments
aldenhallak Nov 26, 2025
d06ce1f
Add template update/reset logic, loading state to save button, and me…
aldenhallak Nov 26, 2025
8d38d62
Merge branch 'main' into experiments
aldenhallak Dec 3, 2025
e6cb7b2
Use variables instead of hardcoded values, so they will match system …
aldenhallak Dec 3, 2025
7c23567
Add tooltip.
aldenhallak Dec 3, 2025
03ecb03
Merge branch 'main' into experiments
cjqian Dec 3, 2025
6b5811d
Add template sharing functionality with public, private, and shared v…
aldenhallak Dec 4, 2025
b448d07
Merge branch 'experiments' of https://github.com/aldenhallak/delibera…
aldenhallak Dec 4, 2025
7aca98d
Share Template -> Modify Sharing Settings. Only the creator can modif…
aldenhallak Dec 4, 2025
25587f9
extract experiment builder dialog styles to dedicated SCSS files and …
aldenhallak Dec 9, 2025
3a355f3
Merge branch 'main' into experiments
vivtsai Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/_data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
url: /researchers/getting-started
- title: Create an experiment
url: /researchers/create-experiment
- title: Create a template
url: /researchers/templates
- title: Run an experiment
url: /researchers/run-experiment
- title: Add LLM mediators to chat
Expand Down
3 changes: 3 additions & 0 deletions docs/researchers/create-experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ from the home page gallery.
alt="Screenshot of Deliberate Lab experiment editor with stages"
/>

### Using templates
You can also start from a template to quickly set up your experiment. See [Experiment templates](./templates) for more information on how to use, save, and update templates.

## Edit or fork experiment
To edit an experiment, click on its card in the home page gallery.

Expand Down
44 changes: 44 additions & 0 deletions docs/researchers/templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Experiment templates
layout: default
---

# Experiment templates

Experiment templates allow you to quickly create new experiments based on pre-defined configurations. You can use built-in templates or create your own.

## Loading a template

When building an experiment, you can load a template to populate the stages and settings.

1. In the experiment builder, click the **Load template** button in the left sidebar.
2. Browse the gallery of available templates.
* **Built-in Templates**: Pre-defined templates included with Deliberate Lab.
* **Saved Templates**: Templates you or your team have created and saved.
3. Click on a template to apply it to your current experiment. **Warning: This will overwrite your current stages and settings.**

## Saving a new template

You can save your current experiment configuration as a new template for future use.

1. In the experiment builder, click the **Save as template** button in the top right corner.
2. Enter a name and description for your template.
3. Click **Save**.

## Updating a template

If you have loaded a template and made changes, you can update the original template with your new configuration.

1. Load a template.
2. Make your desired changes to the stages or settings.
3. Click the **Update template** button in the top right corner.
4. Confirm the update in the dialog.

## Deleting a template

You can delete saved templates that are no longer needed.

1. Click the **Load template** button in the left sidebar.
2. Find the template you want to delete in the **Saved Templates** section.
3. Click the delete icon (trash can) on the template card.
4. Confirm the deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
gap: common.$spacing-medium;
}

.actions {
@include common.flex-row-align-center;
gap: common.$spacing-medium;
}
.left {
flex-grow: 1;
}
Expand Down
55 changes: 53 additions & 2 deletions frontend/src/components/experiment_builder/experiment_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import './agent_persona_editor';
import './experiment_builder_nav';
import './experiment_settings_editor';
import './stage_builder_dialog';
import './save_template_dialog';
import './share_template_dialog';
import './variable_editor';

import {MobxLitElement} from '@adobe/lit-mobx';
Expand Down Expand Up @@ -79,9 +81,24 @@ export class ExperimentBuilder extends MobxLitElement {
return html`
${this.renderPanelView()} ${this.renderExperimentConfigBuilder()}
${this.renderExperimenterSettings()} ${this.renderStageBuilderDialog()}
${this.renderSaveTemplateDialog()} ${this.renderShareTemplateDialog()}
`;
}

private renderShareTemplateDialog() {
if (this.experimentEditor.showShareTemplateDialog) {
return html`<share-template-dialog></share-template-dialog>`;
}
return nothing;
}

private renderSaveTemplateDialog() {
if (this.experimentEditor.showSaveTemplateDialog) {
return html`<save-template-dialog></save-template-dialog>`;
}
return nothing;
}

private renderStageBuilderDialog() {
if (this.experimentEditor.showStageBuilderDialog) {
return html`<stage-builder-dialog
Expand Down Expand Up @@ -268,7 +285,38 @@ export class ExperimentBuilder extends MobxLitElement {
}}
>
</pr-icon-button>
</pr-tootipt>
</pr-tooltip>
`;
}

private renderSaveTemplateButton() {
return html`
${this.experimentEditor.loadedTemplateId
? html`
<pr-button
icon="update"
color="neutral"
variant="outlined"
?disabled=${!this.experimentEditor.canEditStages}
@click=${() => {
this.experimentEditor.setShowSaveTemplateDialog(true, 'update');
}}
>
Update template
</pr-button>
`
: nothing}
<pr-button
icon="save"
color="neutral"
variant="outlined"
?disabled=${!this.experimentEditor.canEditStages}
@click=${() => {
this.experimentEditor.setShowSaveTemplateDialog(true, 'new');
}}
>
Save as template
</pr-button>
`;
}

Expand Down Expand Up @@ -481,7 +529,10 @@ export class ExperimentBuilder extends MobxLitElement {
return html`
<experiment-builder-nav></experiment-builder-nav>
<div class="experiment-builder">
<div class="header">${this.renderTitle()} ${this.renderActions()}</div>
<div class="header">
${this.renderTitle()}
<div class="actions">${this.renderActions()}</div>
</div>
${this.renderVariableCheck()}
<div class="content">${this.renderContent()}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@use '../../sass/typescale';

:host {
display: block;
}

.dialog-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.32);
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
}

.dialog {
background: var(--md-sys-color-surface);
border-radius: 8px;
width: 500px;
max-width: 90%;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
color: var(--md-sys-color-on-surface);
}

.header {
padding: 16px;
border-bottom: 1px solid var(--md-sys-color-outline-variant);
display: flex;
justify-content: space-between;
align-items: center;
}

.title {
@include typescale.title-large;
}

.body {
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}

.footer {
padding: 16px;
border-top: 1px solid var(--md-sys-color-outline-variant);
display: flex;
justify-content: flex-end;
gap: 8px;
}

pr-textarea {
width: 100%;
}

.error-message {
@include typescale.label-small;
color: var(--md-sys-color-error);
margin-top: 4px;
}

.form-group {
display: flex;
flex-direction: column;
gap: 4px;

label {
@include typescale.label-medium;
}
}

select {
@include typescale.label-medium;
width: 100%;
padding: 8px;
border: 1px solid var(--md-sys-color-outline);
border-radius: 4px;
background: var(--md-sys-color-surface);
color: var(--md-sys-color-on-surface);
}
Loading