From 9ed9b45afb54fc0e4cdf86cd028d3a0f1ea8a340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AD=D0=BC=D0=B8=D0=BB=D1=8C=20=D0=90=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 28 May 2026 16:47:33 +0000 Subject: [PATCH] add documents/langgraph_notes.txt --- documents/langgraph_notes.txt | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 documents/langgraph_notes.txt diff --git a/documents/langgraph_notes.txt b/documents/langgraph_notes.txt new file mode 100644 index 0000000..d293c73 --- /dev/null +++ b/documents/langgraph_notes.txt @@ -0,0 +1,52 @@ +# LangGraph Notes + +## What is LangGraph? + +LangGraph is a library for building stateful, multi-actor applications with LLMs. It extends LangChain's capabilities by providing: + +- State management for complex workflows +- Support for cycles in agent workflows +- Built-in persistence for long-running applications +- Integration with LangChain tools and models + +## Key Concepts + +### State +State in LangGraph is represented as a dictionary that flows through the graph nodes. Each node can modify the state. + +### Nodes +Nodes are individual processing units that can be: +- LLM calls +- Tool calls +- Custom functions + +### Edges +Edges connect nodes and can be: +- Direct connections +- Conditional routing based on state + +## Example Usage + +```python +from langgraph.graph import StateGraph, END + +# Define state +class AgentState: + messages: List + next_action: str + +# Build graph +graph = StateGraph(AgentState) +graph.add_node("agent", call_llm) +graph.add_node("tool", call_tool) +graph.add_edge("agent", "tool") +graph.add_edge("tool", "agent") +graph.add_edge("agent", END) +``` + +## Benefits + +- More control over agent behavior +- Better for complex, multi-step reasoning +- Native support for human-in-the-loop workflows +- Easy to add memory and state persistence \ No newline at end of file