An autonomous LangGraph agent that pulls a YouTube video, understands everything said and everything shown on screen, retrieves the specific regulatory/platform rules that apply, and returns a structured PASS/FAIL compliance report β served through a REST API or a CLI.
Brand and legal teams manually scrub sponsored video content for FTC disclosure violations and platform ad-policy breaches β a slow process that doesn't scale with volume. Video-Authenticator (referred to internally, in the code and API title, as Brand Guardian AI) automates the first pass: give it a YouTube URL, and it downloads the video, extracts the spoken transcript and on-screen text, retrieves the exact compliance rules that are relevant via RAG, and returns a categorized, severity-tagged violation report.
- π₯ Automated ingestion β pulls YouTube videos directly via
yt-dlp, no manual upload step - π§ Multimodal understanding β extracts the spoken transcript and on-screen OCR text using Azure AI Video Indexer
- π Retrieval-augmented auditing β embeds the video's content and retrieves the most relevant rules from a real compliance knowledge base (the FTC's Disclosures 101 for Social Media Influencers + YouTube's ad specifications) via Azure AI Search
- βοΈ Structured LLM verdicts β Azure OpenAI returns severity-tagged, categorized violations as strict JSON, not free text
- β‘ Production-shaped API β FastAPI service with Pydantic request/response validation, auto-generated Swagger docs, and a
/healthendpoint - π Built-in observability β requests are traced end-to-end via Azure Monitor OpenTelemetry when configured
- π Secure by default β every Azure call authenticates through a service principal (
ClientSecretCredential); no hardcoded keys anywhere in the codebase - π§© Modular graph design β a typed LangGraph
StateGraphmakes it straightforward to add new audit nodes (e.g. visual moderation, logo detection) without touching existing ones
flowchart TD
Start(["POST /audit β video_url"]) --> Indexer
subgraph Indexer["Indexer Node"]
A["Download video<br/>(yt-dlp)"] --> B["Upload to Azure<br/>AI Video Indexer"]
B --> C["Poll until processed"]
C --> D["Extract transcript +<br/>on-screen OCR text"]
end
Indexer --> Auditor
subgraph Auditor["Auditor Node"]
E["Embed transcript + OCR<br/>(Azure OpenAI Embeddings)"] --> F[("Azure AI Search<br/>compliance knowledge base")]
F --> G["Retrieve top-3<br/>relevant rules"]
G --> H["GPT compliance review<br/>(Azure OpenAI)"]
end
Auditor --> Finish(["JSON report<br/>PASS/FAIL + violations"])
The workflow is a two-node LangGraph StateGraph:
START β indexer (video β transcript + OCR) β auditor (RAG + LLM β verdict) β END
Design notes:
- Typed, mergeable state β
compliance_resultsanderrorsare declared asAnnotated[List, operator.add]reducers in a sharedVideoAuditState, so additional nodes can append findings without overwriting each other - No hardcoded secrets β every Azure call authenticates via a service principal; all configuration lives in environment variables
- Defensive JSON parsing β the LLM is prompted for strict JSON, with a regex fallback that strips markdown code fences before parsing
- Explicit failure states β a failed download, failed indexing, or quarantined video all resolve to a clean
FAILstatus rather than an unhandled exception
| Layer | Technology |
|---|---|
| Agent orchestration | LangGraph, LangChain |
| LLM & embeddings | Azure OpenAI (chat deployment + text-embedding-3-small) |
| Retrieval (RAG) | Azure AI Search |
| Video intelligence | Azure AI Video Indexer (transcript + OCR) |
| Video acquisition | yt-dlp |
| API | FastAPI Β· Uvicorn Β· Pydantic |
| Auth | Azure Identity (service principal) |
| Observability | Azure Monitor OpenTelemetry |
| Tooling | uv Β· Python 3.13 |
Runs the full compliance workflow against a YouTube video.
curl -X POST http://localhost:8000/audit \
-H "Content-Type: application/json" \
-d '{"video_url": "https://youtu.be/dT7S75eYhcQ"}'Example response:
{
"session_id": "ce6c43bb-c71a-4f16-a377-8b493502fee2",
"video_id": "vid_ce6c43bb",
"status": "FAIL",
"final_report": "Video contains 2 critical violations...",
"compliance_results": [
{
"category": "Misleading Claims",
"severity": "CRITICAL",
"description": "Absolute guarantee at 00:32"
}
]
}Lightweight liveness check for load balancers and uptime monitors.
Interactive Swagger docs are auto-generated at /docs once the server is running.
- Python 3.13+
- uv package manager
- An Azure subscription with:
- An Azure AI Video Indexer account (ARM-based)
- An Azure OpenAI resource with a chat deployment + embedding deployment
- An Azure AI Search service with an index populated from
backend/data/ - An Azure AD App Registration (service principal) with access to the above
- (Optional) Application Insights for telemetry
backend/scripts/index_documents.pyβ which will automate loading the PDFs inbackend/data/into Azure AI Search β is a work in progress (see Roadmap). Until then, the index needs to be populated by another method.
git clone https://github.com/NilBangoriya/Video-Authenticator.git
cd Video-Authenticator
uv syncCreate a .env file in the project root:
# Azure AD service principal
AZURE_TENANT_ID=
AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP=
# Azure AI Video Indexer
AZURE_VI_ACCOUNT_ID=
AZURE_VI_LOCATION=
AZURE_VI_NAME=project-brand-guardian-001
# Azure OpenAI
AZURE_OPENAI_CHAT_DEPLOYMENT=
AZURE_OPENAI_API_VERSION=
# Azure AI Search
AZURE_SEARCH_ENDPOINT=
AZURE_SEARCH_API_KEY=
AZURE_SEARCH_INDEX_NAME=
# Optional β telemetry is skipped if unset
APPLICATIONINSIGHTS_CONNECTION_STRING=# REST API
uv run uvicorn backend.src.api.server:app --reload
# β http://localhost:8000/docs
# or the CLI demo (runs one sample video end-to-end)
uv run python main.pyVideo-Authenticator/
βββ backend/
β βββ data/ # Compliance knowledge base source docs
β β βββ 1001a-influencer-guide-508_1.pdf # FTC "Disclosures 101"
β β βββ youtube-ad-specs.pdf # YouTube ad specifications
β βββ scripts/
β β βββ index_documents.py # Ingests data/ into Azure AI Search (WIP)
β βββ src/
β βββ api/
β β βββ server.py # FastAPI app β /audit, /health
β β βββ telemetry.py # Azure Monitor OpenTelemetry setup
β βββ graph/
β β βββ workflow.py # LangGraph StateGraph wiring
β β βββ nodes.py # indexer + auditor node logic
β β βββ state.py # Typed shared state schema
β βββ services/
β βββ video_indexer.py # Azure AI Video Indexer + yt-dlp client
βββ main.py # CLI entry point
βββ pyproject.toml
βββ uv.lock
- Implement
index_documents.pyto auto-chunk and embed compliance docs into Azure AI Search - Add a
pytestsuite covering graph nodes and API contracts - Dockerize +
docker-composefor one-command local setup - GitHub Actions CI (lint, test, build)
- Extra graph node for frame-level visual moderation (logo/brand detection)
- Hosted demo on Azure Container Apps
No license has been specified yet. Consider adding a LICENSE file (MIT is a common, permissive default for portfolio projects) so others know how they're allowed to use this code.