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.
What the state holds
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: strThe 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.
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.
Related
- Previous: The knowledge base: rules into Azure AI Search
- Next: Node one: indexing the video
- See also: State
- 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.