Appearance
Legal Dictation
Specialized pipeline for legal document transcription and formatting.
Overview
The legal-dictation template is optimized for legal professionals, with citation detection, proper formatting, and compliance features.
Configuration
yaml
template: legal-dictation
stt:
model: whisper-1
language: en
word_timestamps: true
llm:
model: gpt-5.2
system_prompt: |
You are a legal document formatter.
Tasks:
- Format dictation as proper legal documents
- Identify and format case citations (e.g., Smith v. Jones, 123 U.S. 456)
- Identify and format statute citations
- Apply proper legal paragraph numbering
- Maintain formal legal language
- Correct obvious dictation errors while preserving meaning
max_tokens: 2000
temperature: 0.3
formatting:
style: legal
citations: detect_and_format
paragraphs: numbered
output_format: docx
compliance:
audit_log: true
data_classification: confidentialFeatures
Citation Detection
Automatically identifies and formats:
- Case citations: Smith v. Jones, 123 U.S. 456 (1990)
- Statute citations: 42 U.S.C. § 1983
- Regulatory citations: 17 C.F.R. § 240.10b-5
- Court rules: Fed. R. Civ. P. 12(b)(6)
Legal Formatting
- Numbered paragraphs
- Proper indentation
- Block quotes for lengthy citations
- Signature blocks
- Caption formatting
Usage
Basic Transcription
python
from gateflow_mcp import MCPClient
import base64
client = MCPClient(agent_id="agent_legal", api_key="gf-agent-...")
with open("deposition_clip.mp3", "rb") as f:
audio_b64 = base64.b64encode(f.read()).decode()
result = client.call_tool(
name="voice/pipeline",
arguments={
"audio": audio_b64,
"template": "legal-dictation"
}
)
print("Formatted Document:")
print(result["formatted_document"])
print(f"\nCitations found: {result['citations']}")Memo Dictation
python
result = client.call_tool(
name="voice/pipeline",
arguments={
"audio": audio_b64,
"template": "legal-dictation",
"overrides": {
"llm": {
"system_prompt": """Format as a legal memorandum with:
- TO/FROM/DATE/RE header
- Issue section
- Brief Answer
- Facts
- Analysis
- Conclusion"""
},
"formatting": {
"document_type": "memorandum"
}
}
}
)Contract Clause Dictation
python
result = client.call_tool(
name="voice/pipeline",
arguments={
"audio": audio_b64,
"template": "legal-dictation",
"context": "Formatting contract language for a software licensing agreement.",
"overrides": {
"formatting": {
"document_type": "contract",
"numbering_style": "1.1.1"
}
}
}
)Response Format
json
{
"transcription": "The defendant in Smith versus Jones argued that under 42 USC section 1983...",
"formatted_document": "1. The defendant in *Smith v. Jones*, 123 U.S. 456 (1990), argued that under 42 U.S.C. § 1983...",
"citations": [
{
"type": "case",
"text": "Smith v. Jones, 123 U.S. 456 (1990)",
"formatted": "*Smith v. Jones*, 123 U.S. 456 (1990)"
},
{
"type": "statute",
"text": "42 USC section 1983",
"formatted": "42 U.S.C. § 1983"
}
],
"document_structure": {
"paragraphs": 5,
"citations_count": 3,
"word_count": 450
},
"compliance": {
"audit_id": "audit_xyz789",
"classification": "confidential"
},
"usage": {
"stt_seconds": 120,
"llm_tokens": {"prompt": 500, "completion": 800}
}
}Document Types
| Type | Format | Best For |
|---|---|---|
memorandum | Legal memo | Research memos |
brief | Court brief | Motion practice |
contract | Agreement | Transactional |
letter | Correspondence | Client letters |
deposition | Q&A format | Depositions |
pleading | Court filing | Complaints, answers |
Deposition Format
python
result = client.call_tool(
name="voice/pipeline",
arguments={
"audio": deposition_audio,
"template": "legal-dictation",
"overrides": {
"formatting": {
"document_type": "deposition",
"speaker_labels": True,
"line_numbers": True,
"timestamp": True
}
}
}
)Output:
DEPOSITION OF JOHN DOE
February 16, 2026
Page 1
1 Q. (By Mr. Smith) Please state your name for the record.
2 A. John Doe.
3 Q. And where do you currently reside?
4 A. 123 Main Street, Boston, Massachusetts.Compliance Features
Audit Trail
Every transcription is logged:
json
{
"audit_id": "audit_xyz789",
"timestamp": "2026-02-16T10:00:00Z",
"agent_id": "agent_legal",
"template": "legal-dictation",
"audio_duration_seconds": 120,
"output_hash": "sha256:abc123...",
"classification": "confidential"
}Data Classification
python
result = client.call_tool(
name="voice/pipeline",
arguments={
"audio": audio_b64,
"template": "legal-dictation",
"overrides": {
"compliance": {
"classification": "attorney_client_privilege",
"matter_id": "CASE-2026-001",
"client_id": "client_xyz"
}
}
}
)Best For
- Depositions - Transcription with speaker labels
- Legal memos - Research memoranda
- Contract drafting - Clause dictation
- Court filings - Pleadings and motions
- Client correspondence - Formal letters
Permissions Required
yaml
permissions:
tools:
- voice/pipeline
models:
- whisper-1
- gpt-5.2
pipelines:
- legal-dictation
data_classification:
- confidential
- attorney_client_privilegeNext Steps
- Ambient Scribe - Medical transcription
- Custom Templates - Build your own
- Compliance - Compliance features