Integrations · LangGraph
LangGraph
Add a search node to any LangGraph state machine.
Example search node
Wrap the You.com client in a node that updates graph state with retrieved context.
Python
from youdotcom import You
def search_node(state):
with You("<API_KEY>") as you:
res = you.search.unified(query=state["question"])
return {"context": [r.snippet for r in res.results.web or []]}