Compare first, then build + memory
Scroll: course-full-framework.html
Raw SDK · LangChain · LangGraph · CrewAI · OpenClaw
| LC | LG |
|---|---|
| Linear chain | Graph + cycles |
| DIY loop | SqliteSaver |
retriever | prompt | llm | parser
rag_chain = (
{"context": retriever, "question": RunnablePassthrough()}
| prompt | llm | StrOutputParser()
)
rag_chain.invoke("Refund window?")StateGraph · ToolNode · conditional_edges
g = StateGraph(AgentState)
g.add_node("agent", call_model)
g.add_node("tools", ToolNode([search_docs]))
g.add_conditional_edges("agent", tools_condition)
app = g.compile(checkpointer=SqliteSaver(...))interrupt_before=["tools"]
cfg = {"configurable": {"thread_id": "u1"}}
app.invoke({"messages": [...]}, cfg)
# same thread_id later → remembers ORD-99conditional_edges(START, route_intent)
order → order_agent · else → rag_agent
| Checkpoint | Store | |
|---|---|---|
| Key | thread_id | namespace |
| New chat? | Lost | Recalled |
Scroll: #lab + full code
Scroll lab: course-full-framework.html#lab
Next: ⑥ MCP & A2A