From dd720851141ded00daa8ec727d62a5c531ca2ef5 Mon Sep 17 00:00:00 2001 From: Oyasumi Gitea Date: Thu, 19 Feb 2026 21:51:18 +0800 Subject: [PATCH] content: LangGraph learn log --- content/Others/LangGraph Learn Log.md | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 content/Others/LangGraph Learn Log.md diff --git a/content/Others/LangGraph Learn Log.md b/content/Others/LangGraph Learn Log.md new file mode 100644 index 0000000..b7f1ef4 --- /dev/null +++ b/content/Others/LangGraph Learn Log.md @@ -0,0 +1,47 @@ +--- +date: 2026-02-19 +--- +I need to learn LangGraph because of my graduation project. It's about an LLM-based SQL tools, including features like SQL generation, explain and optimize. + +This file serve as a log for my learning process. + +# Todo + +- [ ] Explore `pydantic` usage with LangGraph +- [ ] Learn about Streaming in LangGraph (brief) +# Log + +## 2.19 + +It seems that we should at least use `TypedDict` as the basic scaffold. We need a structure that support partial update. + +Maybe we could use a state wrapper like below: + +```python +class MyState(BaseModel): + """ + The actual state class I want to use. In another word, + this is where the actual data stored. + """ + pass + + +class State(TypedDict): + """ + The state used by LangGraph. Serve as a wrapper. + """ + state: + +def some_lang_graph_node_func(wrapper: State): + # parse the actual state + st = MyState(wrapper.state) + + # some operations + return Command( + update={state: st} + ) +``` + +> [!note] +> +> After discussing with AI, it seems `pydantic` will work with LangGraph. More research and experiments needed.