Skip to content

Instantly share code, notes, and snippets.

@arwankhoiruddin
Created April 13, 2024 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arwankhoiruddin/77ca6341dfb54cfb2de86909d53ac309 to your computer and use it in GitHub Desktop.
Save arwankhoiruddin/77ca6341dfb54cfb2de86909d53ac309 to your computer and use it in GitHub Desktop.
keyword_researcher = Agent(
role='Keyword Researcher',
goal='Identify relevant keywords for {topic}',
verbose=True,
backstory=(
"Specializing in content analysis and keyword research, you utilize"
" advanced tools and techniques to discover essential keywords that"
" boost search engine rankings and topic relevancy."
),
tools=[search_tool],
llm=llm,
allow_delegation=True
)
keyword_validator = Agent(
role='Keyword Validator',
goal='Evaluate and validate keywords for {topic}',
verbose=True,
backstory=(
"Expert in semantic analysis and keyword validation, ensuring that"
" keywords are relevant to topics, supporting effective content strategies."
),
tools=[],
llm=llm,
allow_delegation=False
)
# Creating the keyword research task
keyword_research_task = Task(
description=(
"Analyze the topic {topic} to extract relevant keywords. Utilize"
" natural language processing tools to identify and rank keywords based"
" on relevance and frequency. Your final report should clearly list all"
" relevant keywords, their frequency, and significance to the topic."
),
expected_output='A detailed keyword report for {topic}, sorted based on the rank and popularity. The keywords are saved in keywords.csv',
tools=[search_tool],
llm=llm,
output_file='keywords.csv',
agent=keyword_researcher
)
validation_task = Task(
description=(
"Review the list of keywords and determine their relevance to the topic {topic}."
" Save all relevant keywords to `final_keywords.csv`."
),
expected_output="A CSV file named 'final_keywords.csv' containing only relevant keywords.",
tools=[],
llm=llm,
agent=keyword_validator
)
# Forming the crew
crew = Crew(
agents=[
keyword_researcher,
keyword_validator],
tasks=[
keyword_research_task,
validation_task
])
# Example execution
result = crew.kickoff(inputs={'topic': 'Male supplement'})
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment