Skip to main content
Build a complete deposition processing workflow: transcribe audio, identify speakers, store in a searchable vault, and find contradictions across witnesses.

What you’ll build

  • Transcribe deposition audio with speaker labels
  • Store transcripts in a searchable vault
  • Cross-reference testimony across witnesses
  • Generate impeachment reports

Quick start

import Casedev from 'casedev';

const client = new Casedev({ apiKey: process.env.CASEDEV_API_KEY });

async function processDeposition(audioUrl: string, witnessName: string) {
  // 1. Transcribe with speaker labels
  const job = await client.voice.transcription.create({
    audio_url: audioUrl,
    speaker_labels: true,
    auto_chapters: true
  });
  
  // Wait for completion
  let result = await client.voice.transcription.retrieve(job.id);
  while (result.status !== 'completed') {
    await new Promise(r => setTimeout(r, 10000));
    result = await client.voice.transcription.retrieve(job.id);
  }
  
  console.log(`✅ Transcribed ${witnessName}: ${result.text.length} characters`);
  console.log(`   Speakers: ${result.utterances.map(u => u.speaker).filter((v, i, a) => a.indexOf(v) === i).join(', ')}`);
  
  return result;
}

async function findContradictions(vaultId: string, topic: string) {
  // Search across all testimony for the topic
  const results = await client.vault.search(vaultId, {
    query: topic,
    method: 'hybrid',
    topK: 20
  });
  
  // Group by witness
  const byWitness: Record<string, string[]> = {};
  for (const chunk of results.chunks) {
    const witness = chunk.metadata?.witness || chunk.filename;
    if (!byWitness[witness]) byWitness[witness] = [];
    byWitness[witness].push(chunk.text);
  }
  
  // Use AI to find contradictions
  const analysis = await client.llm.v1.chat.createCompletion({
    model: 'anthropic/claude-sonnet-4.5',
    messages: [
      {
        role: 'system',
        content: 'You are a litigation attorney. Analyze testimony from multiple witnesses and identify contradictions. Cite specific quotes.'
      },
      {
        role: 'user',
        content: `Topic: ${topic}\n\nTestimony by witness:\n${Object.entries(byWitness).map(([w, texts]) => `\n## ${w}\n${texts.join('\n')}`).join('\n')}`
      }
    ]
  });
  
  return analysis.choices[0].message.content;
}

Example contradiction report

## CONTRADICTION IDENTIFIED

### Topic: When the CEO learned of the data breach

**CEO Testimony (Johnson Depo, pg 45):**
> "I was not informed of any security incident until July 15th, 
> when our IT director called me at home."

**CTO Testimony (Smith Depo, pg 12):**
> "I sent an urgent email to the entire executive team, including 
> the CEO, on July 12th explicitly detailing the intrusion and 
> recommending immediate action."

**IT Director Testimony (Williams Depo, pg 23):**
> "The CTO instructed me to brief the CEO on July 12th. I called 
> his office but was told he was unavailable. I left a detailed 
> voicemail."

### Analysis
The CEO claims no knowledge until July 15th, but both the CTO and 
IT Director indicate notification attempts on July 12th—three days 
earlier. The CTO claims direct email notification, and the IT 
Director confirms a voicemail was left.

### Impeachment Strategy
1. Introduce July 12th email as Exhibit A
2. Subpoena CEO's voicemail records for July 12th
3. Confront CEO with CTO and IT Director testimony
Coming soon: Full cookbook with batch processing, timeline generation, and exhibit linking.