๐Ÿš€
๐Ÿ•ธ๏ธ LangGraph
2. Hello World Graph
AI

Hello World Graph ๐ŸŒ

1. Understand and define the AgentState structure

Mar 202510 min read

Hello World Graph ๐ŸŒ

Objectives โœ…
  1. Understand and define the AgentState structure
  2. Create simple node functions to process and update statte
  3. Set up a basic LangGraph structure
  4. Compile and invoke a LangGraph graph
  5. Understand how data flows through a single-node in LangGraph
from typing import Dict, TypedDict
 
from langgraph.graph import StateGraph
class AgentState(TypedDict): # Our State Schema
    message: str
 
def greeting_node(state: AgentState) -> AgentState:
    '''Simple node that adds a greeting message to the state.'''
 
    state['message'] = "Hey " + state['message'] + ", how is your day going!"
    return state
graph = StateGraph(AgentState)
 
graph.add_node("greeter", greeting_node)
 
# START
graph.set_entry_point("greeter")
 
# END
graph.set_finish_point("greeter")
 
app = graph.compile()
result = app.invoke({"message": "Alice"})
 
result['message']

"hello world graph"

OUTPUT:
 
'Hey Alice, how is your day going!'

ยฉ 2026 Driptanil Datta. All rights reserved.

Software Developer & Engineer

Disclaimer:The content provided on this blog is for educational and informational purposes only. While I strive for accuracy, all information is provided "as is" without any warranties of completeness, reliability, or accuracy. Any action you take upon the information found on this website is strictly at your own risk.

Copyright & IP:Certain technical content, interview questions, and datasets are curated from external educational sources to provide a centralized learning resource. Respect for original authorship is maintained; no copyright infringement is intended. All trademarks, logos, and brand names are the property of their respective owners.

System Operational

Built with Love โค๏ธ | Last updated: Mar 16 2026