What is LangGraph?
A framework for building stateful, multi-step AI agent workflows as graphs. Built on top of LangChain for complex agentic applications.
Searching YouTube Playlists with LangGraph
This integration lets your LangGraph agent search YouTube Playlists in real time via the Scavio API. The agent gets back structured JSON with playlist title, video count, creator, last updated — ready for reasoning and decision-making.
Setup
pip install langgraph langchain-scavio langchain-openaiCode Example
Here is a complete LangGraph agent that searches YouTube Playlists using Scavio:
from langgraph.prebuilt import create_react_agent
from langchain_scavio import ScavioSearch
from langchain_openai import ChatOpenAI
tool = ScavioSearch(api_key="your_scavio_api_key")
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, [tool])
result = agent.invoke({
"messages": [{"role": "user", "content": "Search YouTube Playlists for best rag tutorials playlist"}]
})
print(result["messages"][-1].content)Full Working Example
A production-ready example with error handling:
"""
LangGraph agent that searches YouTube Playlists via Scavio.
"""
from langgraph.prebuilt import create_react_agent
from langchain_scavio import ScavioSearch
from langchain_openai import ChatOpenAI
tool = ScavioSearch(api_key="your_scavio_api_key")
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, [tool])
result = agent.invoke({
"messages": [{"role": "user", "content": "Search YouTube Playlists for best rag tutorials playlist"}]
})
for message in result["messages"]:
if hasattr(message, "content") and message.content:
print(f"{message.type}: {message.content[:200]}")Pricing
Scavio offers a free tier with 500 credits/month (1 credit per search). No credit card required. This is enough to build and test your LangGraph integration. Paid plans start at $30/month for higher volumes.