by veeramanikandan

AI-Powered Content Creation Pipeline

Project Overview

A sophisticated content automation system that leverages AI agents to research, analyze, and create engaging social media content.

System Components

Agents

Implementation Code Snippets

Agent Setup

# 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
)

Task Definition

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
)

Crew Orchestration

# Create and run the crew
crew = Crew(
    agents=[news_researcher, content_analyzer, linkedin_creator],
    tasks=[task1, task2, task3],
    verbose=2
)

result = crew.kickoff()

Content Storage

# 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)

System Architecture

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"]