Scribe Agent
Note Style/Template Creation
Objective
Enable users to easily create custom note styles or templates intuitively.
Note: "Style" and "template" are used interchangeably.
Background
At present, Sully offers a simple method for creating note styles through a free-form text area. This can be overwhelming due to unclear starting points and the expertise required in prompt design.
Solution
Introduce a user-friendly wizard to guide through template creation. This should be intuitive and support voice input. The design consists of three parts:
Frontend creation flow
Structured representation of the note template
Template creation and execution logic
Structured Representation
The template will be a JSON object stored in GCS:
{
"id": "<template-id>",
"title": "Test Template",
"sections": [
{
"id": "<section-id>",
"title": "<section-title>",
"descp": "<section description>",
"templates": [
{
"voice_trigger": "<voice-trigger>",
"text": "<template-text>",
"text_file": "<gcs-path>"
},
{
...
}
]
},
...
]
}Template metadata will be stored in Firebase, with JSON in GCS:
Firebase Path:/copilot/trial/users/<user-email>/note_templates/<template-id>/…
Firebase Map:
{ "title": "<title>", "template_path": "<gcs-path>" }GCS JSON Path:<bucket>/<user-email>/note_templates/<template-id>.json
Each section converts to an LLMChain for execution, integrating inputs like transcripts and patient charts. All chains execute in parallel, and the results are merged for the final note.
finalNote = generateNote(noteTemplate, transcript, ph)
llmChain = getLLMChain(noteTemplate, transcript, ph)
llmChain.execute()Sully-designed prompts are hosted and versioned on Autoblocks.
Frontend Wizard
An intuitive wizard will help create templates and define sections, saving the resulting JSON in Firebase and GCS.
Note Generation/Execution
Upon recording a visit, users select the note template via dropdown. Only the template ID is sent in requests, and the server constructs the template.
Server-side actions:
Retrieve the template JSON from Firebase using
templateId.Access the template JSON from GCS using
templateIdorgcsPath.Process voice-triggered templates from their GCS paths, ready to be converted to an LLMChain.
Template: LLMChain Structure
{
"chainId": "template.id",
"name": "template.title",
"execution": "parallel",
"tasks": [...] // tasks can be LLMChain or LLMTask
}Section: LLMTask/LLMChain Structure
{
"chainId": "section.id",
"name": "section.title",
"execution": "sequential",
"tasks": [...]
}A section-level LLMChain identifies which template to trigger based on voice prompts and executes necessary tasks sequentially.
Last updated
