LLMOpsThe LLMOps lifecycle · MLflow 3 · FastAPI · Docker · AWS/Azure
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
50 small wins to finish your pathNext lesson →

The graph state the project passes around

Every node in the project reads and writes one shared object: the graph state. It is a TypedDict called VideoAuditState, holding the video URL and the id and file path the indexer produces, the transcript and on-screen text, the violations found, any system errors, and the final verdict. The video is deliberate that it is a TypedDict, not a Pydantic model.

Last updated: 15 Oct, 2026 · LLMOps

The knowledge base prepared the rules. Before the nodes can run, they need a shared shape to pass work along in. That shape is the state.

Defining the video audit state · from the End to End Multimodal LLMOps Project video · 1:44:00 to 1:47:00

What the state holds

python
from typing import TypedDict, Optional

class ComplianceIssue(TypedDict):
    category: str          # e.g. FTC disclosure, misleading claim
    severity: str          # critical or warning
    description: str       # the specific detail of the violation
    timestamp: Optional[str]   # where in the video, if known

class VideoAuditState(TypedDict):
    video_url: str             # the request's input
    video_id: str              # the id Video Indexer assigns
    local_file_path: Optional[str]   # the downloaded file, while it exists
    transcript: str            # what is said, from Video Indexer
    ocr_text: str              # the text on screen
    video_metadata: dict
    compliance_results: list[ComplianceIssue]
    system_errors: list[str]   # downloads that failed, timeouts
    status: str                # pass or fail
    final_report: str

The violation shape is fixed deliberately: every issue must carry a category, a severity and a description, and the video notes this is what stops the model from returning free-form text the rest of the system cannot act on. The timestamp is optional, the one field that may be missing.

The VideoAuditState TypedDict as a list of fields, each labelled with the node that fills it: video_url comes from the request; transcript, ocr_text and video_metadata are filled by the index node; compliance_results, status and final_report by the auditor node; and system_errors, drawn in red, by any node when something fails. A note says it is a TypedDict, not Pydantic: a declared shape LangGraph passes and merges rather than a runtime check.

Why a TypedDict, not Pydantic

  • A TypedDict is a plain dict with a declared shape. LangGraph passes it from node to node, each node returning the keys it filled in, and the graph merges them.
  • It documents the contract without validating at runtime, which is what the video wants here: a clear shape the nodes agree on, not a validation layer.
  • The structured violation type is the part that is enforced, later, by asking the model for exactly that shape of JSON.
Watch out. A TypedDict does not check types at runtime; it is a hint. If a node writes a string where the state declares a list, nothing stops it until something downstream breaks. The enforcement that matters here is on the model's output, covered in the auditor lesson, not on the state.
Try it yourself
  • Name which node fills each field of VideoAuditState.
  • Explain why the timestamp is the only optional field in a ComplianceIssue.

This is what real progress feels like.