An automated, sequential AI pipeline built with LangGraph and Groq that transforms raw text into highly engaging, production-ready video scripts localized in Hinglish.
This project demonstrates state-oriented LLM orchestration, utilizing a multi-node architecture to ensure high-quality, focused generation at each step of the content creation process.
The pipeline utilizes a sequential StateGraph where data flows through three specialized AI agents[cite: 3]:
- Editor Node: Acts as an expert copyeditor. It processes the
raw_inputto fix grammatical errors, correct spelling mistakes, and smooth out the transition flow while preserving the core message. - Scriptwriter Node: Takes the cleaned
edited_textand transforms it into a charismatic, conversational YouTube video hook[cite: 2, 4]. It focuses on making the content punchy and engaging[cite: 2]. - Hinglish Translator Node: Localizes the
script_textfor the Indian market[cite: 2, 4]. It expertly alternates between Hindi and English phrases, generating a natural, high-energy script typical of top tech educators[cite: 2].
- Orchestration: LangGraph (
StateGraph)[cite: 3] - LLM Framework: LangChain (
langchain_groq)[cite: 2] - Model: Llama 3.3 70B Versatile (
llama-3.3-70b-versatile)[cite: 2] - State Management: Python
TypedDict[cite: 4]
The pipeline maintains a strict state using a TypedDict to track the transformation of the data at every stage[cite: 4]:
raw_input: The initial text provided by the user[cite: 4].edited_text: The output from the Editor Node[cite: 4].script_text: The output from the Scriptwriter Node[cite: 4].final_output: The localized Hinglish script[cite: 4].
- Python 3.8+
- A Groq API Key