How to use BrightBean with CrewAI for YouTube research
TL;DR
CrewAI lets you build multi-agent systems where specialized AI agents collaborate on complex tasks. For YouTube research, you define BrightBean endpoints as CrewAI tools, create agents with specific roles (researcher, analyst, strategist), and orchestrate them into a crew that produces thorough content intelligence. The multi-agent approach outperforms single-agent workflows for complex research because each agent focuses on its specialty. BrightBean provides the YouTube intelligence tools that give each agent access to real data.
How to use BrightBean with CrewAI for YouTube research
CrewAI takes a different approach to AI agents than frameworks like LangChain. Instead of a single agent with many tools, CrewAI creates multiple specialized agents that collaborate, each with its own role, backstory, and tool set. This mirrors how human research teams work: one person handles data collection, another does analysis, and a third synthesizes recommendations. For YouTube research, this specialization produces higher-quality output than a single generalist agent.
The first step is defining your tools. CrewAI tools wrap external API calls with descriptions that help agents understand when to use them. Each BrightBean endpoint becomes a tool that any agent in the crew can access, though you typically assign specific tools to specific agents based on their role.
Next, you define your agents. A YouTube research crew might include a Niche Researcher (responsible for identifying content gaps and trending topics), a Content Analyst (responsible for evaluating competition and scoring titles), and a Strategy Advisor (responsible for synthesizing research into practical recommendations). Each agent has a role description, a goal, and a backstory that shapes its behavior. The backstory is more than flavor text. It affects how the LLM approaches its tasks, making agent output more focused and consistent.
Tasks define what each agent does. A task specifies the work to be done, which agent handles it, the expected output format, and any context from previous tasks. Tasks can be sequential (the analyst waits for the researcher to finish) or parallel (the researcher and trend monitor work simultaneously). This task dependency system is what makes CrewAI particularly good for complex multi-step research workflows.
The crew orchestration layer manages the collaboration. When you kick off a crew, it routes tasks to the appropriate agents, passes results between them, and aggregates the final output. The Strategy Advisor receives research from the Niche Researcher and analysis from the Content Analyst, then produces a unified recommendation that accounts for both data streams.
How BrightBean helps
BrightBean endpoints integrate naturally with CrewAI’s tool system. Here is a complete example showing how to set up a YouTube research crew with BrightBean tools.
from crewai import Agent, Task, Crew, Process
from crewai.tools import BaseTool
import requests
API = "https://api.brightbean.com"
HEADERS = {"Authorization": "Bearer bb_your_api_key"}
class ContentGapTool(BaseTool):
name: str = "Content Gap Finder"
description: str = "Find underserved YouTube topics in a niche with high demand and low competition"
def _run(self, niche: str) -> str:
resp = requests.post(f"{API}/content-gaps",
json={"niche": niche, "max_competition": 0.4},
headers=HEADERS)
return str(resp.json())
class TitleScorerTool(BaseTool):
name: str = "Title Scorer"
description: str = "Score a YouTube title for click-through potential in a specific niche"
def _run(self, title: str, niche: str) -> str:
resp = requests.post(f"{API}/score/title",
json={"title": title, "niche": niche},
headers=HEADERS)
return str(resp.json())
class ChannelBenchmarkTool(BaseTool):
name: str = "Channel Benchmark"
description: str = "Compare a YouTube channel against niche performance averages"
def _run(self, channel_id: str, niche: str) -> str:
resp = requests.post(f"{API}/benchmark",
json={"channel_id": channel_id, "niche": niche},
headers=HEADERS)
return str(resp.json())
# Define agents
researcher = Agent(
role="YouTube Niche Researcher",
goal="Identify the highest-opportunity content gaps in the target niche",
backstory="You are a data-driven YouTube researcher who specializes in finding underserved topics.",
tools=[ContentGapTool(), ChannelBenchmarkTool()]
)
strategist = Agent(
role="Content Strategy Advisor",
goal="Transform research findings into an actionable content plan with optimized titles",
backstory="You are a YouTube strategist who creates data-backed content calendars.",
tools=[TitleScorerTool()]
)
# Define tasks
research_task = Task(
description="Research the home espresso niche. Find 10 content gaps and benchmark top 3 channels.",
agent=researcher,
expected_output="List of content gaps with scores and competitive landscape summary"
)
strategy_task = Task(
description="Create a 4-week content plan from the research. Score and optimize titles for each video.",
agent=strategist,
expected_output="Content calendar with scored titles and strategic rationale",
context=[research_task]
)
crew = Crew(agents=[researcher, strategist], tasks=[research_task, strategy_task], process=Process.sequential)
result = crew.kickoff()
Key takeaways
- CrewAI’s multi-agent approach lets specialized agents collaborate on complex YouTube research tasks
- Agent roles, goals, and backstories shape behavior and improve output quality over generic single-agent setups
- Task dependencies ensure research flows logically from data collection through analysis to strategy
- BrightBean tools integrate directly with CrewAI’s tool system using simple class definitions
- Multi-agent workflows produce more thorough results than single-agent approaches for complex research
Related questions
Get structured YouTube intelligence
BrightBean delivers content gaps, title scores, thumbnail analysis, and hook classification via API and MCP server.
Get early access →