Tutorial · Legal workflow

Deposition summary API: build a legal workflow

A useful deposition summary is not a shorter transcript. It is an indexed set of testimony, organized by topic and question, with a page and line for every statement a lawyer may need to quote.

Short answer. Preserve the transcript's own page and line grid, map speakers from the caption and colloquy, extract topics and question-answer pairs, and require an exact page:line citation for every factual statement. Keep privilege review and the final work product with a lawyer.

Define the output before you build

Lawyers search a deposition summary for an admission, a contradiction, a foundation for an exhibit or a quote for a brief. The contract should reflect that work.

FieldWhat it holdsWhy it matters
witnessName, role and capacitySeparates personal, corporate and expert testimony
topicShort label and scopeBuilds an index a lawyer can scan
qa[]Question, answer, speaker and summaryPreserves the examination structure
citationPage and line rangeLets the reader verify the source
flags[]Objection, privilege, exhibit, uncertaintyRoutes passages to review

Keep summary and source separate. The summary is a finding aid; the certified transcript is the evidence. An unverifiable citation is worse than none because it looks authoritative.

Ingest without losing the grid

Depositions arrive as text, PDF, word-processing files and court-reporting exports. The format matters less than the grid: every page has lines, and lines are how the record is cited. Extract text without reflowing paragraphs, because a reflow destroys line numbers. For a scan, OCR page by page and keep the page image next to the text.

Normalize each segment to page, line_start, line_end, speaker, role, text and source_hash. Preserve form feeds, headers and exhibit stamps. If the format is proprietary, export text through the court reporter's tool instead of reverse-engineering it, and ask for page and line markers.

Do not let the model rewrite the transcript. The prompt should return references and short summaries, not a regenerated Q&A. A paraphrase where a quote should be is a liability.

Map speakers from the record

Most transcripts use Q. and A. for the examining attorney and witness, with occasional MR., MS. or THE WITNESS: labels. Map the roles explicitly:

  • Examining attorney: asks questions; objections and instructions are not testimony.
  • Witness: answers; distinguish knowledge from “I don't know” and from a document read into the record.
  • Defending attorney: objections and speaking objections are colloquy, not evidence.
  • Interpreter: the rendition is not a separate factual statement by the witness.

Do not infer a speaker from style. If labels are ambiguous, keep the label and add an uncertain flag. Speaker errors change who admitted what.

Extract topics and Q&A pairs

Ask for a topic index and Q&A units. A topic has a short label, a scope note and a supporting citation range. A Q&A unit has the question, answer, speaker, a one-sentence summary and the exact range.

import json
from openai import OpenAI

client = OpenAI(api_key="YOUR_KEY", base_url="https://api.plugsky.com/v1")
segments = [json.loads(line) for line in open("transcript.jsonl", encoding="utf-8")]
lines = {f"{s['page']}:{s['line_start']}-{s['line_end']}": s["text"] for s in segments}
numbered = "\n".join(
    f"[{s['page']}:{s['line_start']}-{s['line_end']}] {s['speaker']}: {s['text']}"
    for s in segments)
schema = {"topics": [{"label": "string", "citations": ["page:line-line"]}],
          "qa": [{"question": "string", "answer_summary": "string",
                  "citations": ["page:line-line"], "flags": ["string"]}]}
response = client.chat.completions.create(
    model="plugsky-pro", response_format={"type": "json_object"},
    messages=[{"role": "system", "content": "Summarize only from the numbered transcript. "
               "Every item needs a page:line-line citation. Objections are not testimony. Return JSON."},
              {"role": "user", "content": json.dumps({"schema": schema, "transcript": numbered})}])
result = json.loads(response.choices[0].message.content)
for item in result["topics"] + result["qa"]:
    assert item["citations"] and all(c in lines for c in item["citations"])

The check rejects a range the transcript does not contain. It does not prove the summary is supported. Add a quote field and verify it is a substring of the cited segment.

Citations and verification

Cite the printed page and line of the certified transcript, not a PDF viewer page or paragraph index. If the PDF has a cover page, printed and PDF numbers may differ. Store both and cite the printed number.

  • Range: the page exists, start ≤ end, and both lines exist on that page.
  • Quote: the language appears in the range after normalization. Flag near matches.
  • Speaker: testimony is attributed to the witness, not counsel.
  • Completeness: each indexed topic has a Q&A unit, and changed testimony cross-references the earlier passage.

Report exact matches, near matches and items sent to review.

Privilege and confidentiality

Transcripts can contain privileged colloquy, health information, trade secrets and material under a protective order. A summary is often attorney work product. Before sending any of it to a model, decide who may see it, where it is processed, whether the provider retains it and whether it trains on it.

ABA Formal Opinion 512 discusses competence, confidentiality, communication, fees and supervision for generative AI. It is not a safe harbor and does not replace your own professional-responsibility analysis. State bar guidance and protective orders may add requirements. Counsel review is required before production use, and privilege review must happen before a draft circulates.

Use matter-level access control, encryption, no training on client data, a retention schedule, export audit logs and a human gate before any summary leaves the firm.

Evaluation and cost per 100 pages

Evaluate on transcripts your lawyers have already summarized. Measure citation validity, citation support, speaker accuracy, topic recall, omission or contradiction, and privilege leakage.

pages = 100
input_tokens = pages * measured_input_tokens_per_page
output_tokens = pages * measured_output_tokens_per_page
review_cost = pages * review_minutes_per_page / 60 * loaded_hourly_rate
token_cost = input_tokens * input_rate + output_tokens * output_rate
cost_per_100_pages = token_cost + review_cost + ocr_cost + storage_cost

On Plugsky, main text models have a 262,144-token context and paid plans start at $8 per month; Hobby includes 2 million tokens per day. A 100-page transcript at an assumed 700 tokens per page is about 70,000 input tokens before output, which fits in one context. The bill movers are passes, output length and human review. See pricing.

This is an engineering guide, not legal advice. Privilege, confidentiality and protective-order obligations require counsel review. Verify the current rules and provider data terms before processing real matter data.

FAQ

What should a deposition summary API output?

A structured index of topics and question-answer units, each with the speaker, a short summary, flags for objections or privilege, and an exact page:line citation. Keep the certified transcript as the source of truth.

How do I preserve page and line citations?

Extract text without reflowing pages, store printed page and line numbers, and validate each citation range. Keep the page image so a reviewer can check the quote.

Can AI identify speakers in a deposition transcript?

It can follow explicit Q/A labels and the appearances page, but it should not guess identities from context. Keep ambiguous labels flagged for human review, and treat objections and attorney colloquy as separate roles.

Is a deposition summary privileged?

It may be attorney work product, and the transcript may contain privileged or protective-order material. Privilege depends on the matter, the participants and the applicable order. Counsel review is required before circulating a draft.

How much does a 100-page deposition summary cost?

Add OCR or transcription, model input and output tokens, citation verification, human review and storage. Measure tokens and review minutes on your own transcripts; a 100-page transcript is roughly 70,000 input tokens at 700 tokens per page, before output and review.

Sources: ABA Formal Opinion 512, “Generative Artificial Intelligence Tools” (29 July 2024), and Federal Rule of Civil Procedure 30(e) on deposition review. Both checked 20 November 2026. Reviewed 20 November 2026. This page is not legal advice; privilege, confidentiality and professional-responsibility requirements need counsel review.