by veeramanikandan
A sophisticated content automation system that leverages AI agents to research, analyze, and create engaging social media content.
# Initialize News Researcher Agent
news_researcher = Agent(
role='Tech News Researcher',
goal='Find viral tech news stories',
backstory="""Expert tech journalist identifying significant
developments in AI and technology.""",
tools=[
Tool(name="search_internet",
func=search_tools.search_internet),
Tool(name="browse_and_summarize",
func=search_tools.browse_and_summarize)
],
llm=llm
)
task1 = Task(
description="""Find today's most viral tech news story.
Format the output with:
- Title and Source
- Key Statistics
- Industry Impact""",
agent=news_researcher
)
# Create and run the crew
crew = Crew(
agents=[news_researcher, content_analyzer, linkedin_creator],
tasks=[task1, task2, task3],
verbose=2
)
result = crew.kickoff()
# Save results with timestamp
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
run_dir = os.path.join(posts_dir, timestamp)
os.makedirs(run_dir)
with open(os.path.join(run_dir, 'full_output.txt'), 'w') as f:
f.write(result)
graph TD
A["News Researcher"] -->|Finds Stories| B["Content Analyzer"]
B -->|Provides Analysis| C["LinkedIn Creator"]
C -->|Generates Post| D["Content Storage"]
D -->|Saves| E["Output Files"]