Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions finnews-agent-writer-crewai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 🧠 AI-Powered Financial Content Creator

A multi-agent AI system that autonomously creates, refines, and formats high-quality financial content — including blog posts and social media snippets — using real-time market data and news.

---

## 🚀 What It Does

This system uses **CrewAI agents** to automate the entire content creation pipeline:

1. **📡 Market News Monitor Agent**
Tracks the latest financial news based on a given subject (e.g. “US-China tariffs”), summarizing impactful headlines.

2. **📊 Data Analyst Agent**
Analyzes market trends and economic indicators to identify actionable insights.

3. **✍️ Content Creator Agent**
Generates engaging blog content and social media posts from insights provided by the above agents.

4. **🧐 Quality Assurance Agent**
Refines and formats the content using markdown, ensuring clarity, structure, and brand alignment.

---

## 💼 Use Case

Ideal for:
- Financial blogs and media platforms
- Automated newsletter creation
- Market intelligence publishing
- Anyone needing timely, data-driven financial content

---


## 🛠️ Tech Stack

- **CrewAI** – Multi-agent orchestration
- **LangChain / LLMs** – Natural language generation
- **YAML Configs** – Agent & task modular setup
- **Jupyter Notebook** – For testing and orchestration
- **Markdown output** – For clean blog-ready formatting

---


## 🧪 Performance Benchmarks

| Agent | Task Description | Avg Time (approx) |
|---------------------------|-----------------------------------------|-------------------|
| 📡 Market News Monitor | Scrapes live financial news | ~45 seconds |
| 📊 Data Analyst Agent | Extracts and interprets insights | ~60 seconds |
| ✍️ Content Creator Agent | Generates blog + social media content | ~75 seconds |
| ✅ Quality Assurance Agent | Formats content in markdown | ~30 seconds |
| ⏱️ **Total Runtime** | End-to-end pipeline execution | **~3.5 minutes** |

> 🧠 Benchmarks based on `mistral-large-latest` model and real-time web scraping.

---


## 🤖 LLM Models Used

This project uses open-weight models from [Mistral](https://mistral.ai/).

### 🔹 `mistral-small-latest`
- Lightweight and fast
- Best for retrieval tasks and embeddings
- Used in: `WebsiteSearchTool`, `embedder`, lightweight analysis

### 🔹 `mistral-large-latest`
- Strong reasoning and summarization capabilities
- Handles long, structured generation tasks
- Used in: All core agents (`llm=llms['large']`) — blog writing, analysis, formatting


---


## 🧪 How to Run

1. Install dependencies:

```
pip install -r requirements.txt
```
2. Set your environment variables:

```
export MISTRAL_API_KEY=your_key_here
export SERPER_API_KEY=your_key_here
```
3. Launch the notebook:
```
jupyter notebook main.ipynb
```
4. Provide your topic (e.g. "US-China tariffs") and let the agents do the rest.
67 changes: 67 additions & 0 deletions finnews-agent-writer-crewai/config/agents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
market_news_monitor_agent:
role: >
Lead Market Analyst
goal: >
Conduct in-depth, real-time analysis of financial news and market updates,
providing insightful summaries to guide content creation.
backstory: >
As the Lead Market Analyst at a premier financial content platform, you
specialize in dissecting market trends and economic shifts, ensuring
that your content stays ahead of the curve and delivers the most
relevant insights to your audience.
allow_delegation: false
verbose: true

data_analyst_agent:
role: >
Chief Data Strategist
goal: >
Synthesize complex market data into actionable insights that can be
transformed into compelling content.
backstory: >
As the Chief Data Strategist at a leading financial advisory firm,
your expertise lies in analyzing vast datasets to uncover trends and
opportunities that inform high-impact investment strategies.
allow_delegation: false
verbose: true

content_creator_agent:
role: >
Creative Content Director
goal: >
Develop and oversee the creation of high-quality, engaging content that
educates and captivates the target audience, with a focus on the latest
financial trends and insights.
backstory: >
As the Creative Content Director at a top financial publishing house,
you excel in crafting narratives that resonate with investors, blending
in-depth analysis with compelling storytelling to create content that
drives engagement and trust.
allow_delegation: false
verbose: true

quality_assurance_agent:
role: >
Chief Content Officer
goal: >
Oversee and refine the content creation process, ensuring that all
outputs are accurate, aligned with brand voice, and optimized for
engagement.
backstory: >
You are the Chief Content Officer of a leading financial media company.
Your role is to ensure that every piece of content not only meets high
editorial standards but also delivers clear, actionable insights that
can help your audience make informed decisions.
allow_delegation: false
verbose: true











73 changes: 73 additions & 0 deletions finnews-agent-writer-crewai/config/tasks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
monitor_financial_news:
description: >
Monitor and analyze the latest news and updates related to
the financial markets, with a particular focus on {subject}.
Identify and summarize the most relevant and impactful news items
that could influence market trends or investor decisions.
Utilize financial news APIs and real-time market data tools to
gather up-to-date information. Focus on detecting trends,
regulatory changes, or significant economic indicators that
directly relate to {subject}.
expected_output: >
A detailed summary report highlighting the most impactful financial
news and updates related to {subject}. This report should include
key insights and their potential implications for the market and
content strategy.

analyze_market_data:
description: >
Analyze market data and trends related to {subject}, with a focus
on uncovering patterns, opportunities, and risks that could be
leveraged in content creation. Use advanced data analytics tools
to process large datasets and generate actionable insights.
Pay special attention to how {subject} influences market movements,
investor sentiment, and economic indicators.
expected_output: >
A comprehensive analysis report that highlights key market trends
and actionable insights related to {subject}. The report should
include data visualizations and clear recommendations for content
creation.

create_content:
description: >
Based on the insights provided by the Market News Monitor and
Data Analyst agents, create high-quality, engaging content that
educates and informs the target audience about {subject}.
Produce various types of content, including blog posts and
social media updates, that effectively communicate the insights
gathered. Ensure the content clearly conveys the key findings
and recommendations related to {subject}. Incorporate data
visualizations, infographics, or other multimedia elements to
enhance the content where applicable.
expected_output: >
A collection of high-quality content pieces related to {subject},
including blog posts and social media updates, complete with
integrated multimedia elements.

quality_assurance:
description: >
Review and refine the content created on {subject} to ensure it
meets the highest standards of accuracy, clarity, and brand
alignment. Thoroughly proofread and edit the content, checking
for errors, inconsistencies, and alignment with the brand voice.
Ensure that the content accurately reflects the key insights and
recommendations provided by the Data Analyst and Market News
Monitor agents. Ensure that the final content is well-formatted
in markdown, using appropriate headers, bullet points, links,
and other markdown features to enhance readability and engagement.
expected_output: >
A finalized set of content pieces related to {subject}, thoroughly
reviewed, and formatted in markdown. The content should be
well-structured, with appropriate use of headers, bullet points,
links, and other markdown features to ensure it is both visually
appealing and easy to read. Each section should have at least 2
paragraphs.









74 changes: 74 additions & 0 deletions finnews-agent-writer-crewai/generated_blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Comprehensive Analysis Report: Impact of US Tariffs on China and Market Reactions

## Executive Summary:
The implementation of US tariffs on China has led to significant market volatility and geopolitical tensions. China's retaliatory measures, along with global responses, highlight the far-reaching impacts of these trade actions. This report analyzes key market trends, investor sentiment, and economic indicators to provide actionable insights and recommendations for content creation.

## Key Findings:

### 1. Market Volatility and Sentiment:
The announcement of a 90-day pause on tariffs for most countries, excluding China, has resulted in substantial market volatility. China's retaliatory tariffs, raising levies on US goods to 84%, have exacerbated market instability. Investor sentiment has been negatively impacted, with concerns over disrupted supply chains, increased inflation, and potential economic slowdown.

Market volatility has been particularly pronounced in sectors directly affected by the tariffs. The automotive industry, for instance, has seen significant price increases due to higher costs of imported materials. Similarly, the steel and aluminum sectors have faced challenges as tariffs have driven up the prices of raw materials, making domestic production less competitive. These disruptions have led to a ripple effect across global supply chains, affecting manufacturers and consumers alike.

### 2. Economic Impact:
The US tariffs are predicted to cause a 2.4% decline in China's economic growth, affecting exports and domestic consumer sentiment. The tit-for-tat tariff escalation threatens to reduce trade between the US and China by 80%, with broader economic consequences expected. The long-term implications include potential job losses, reduced investment, and a slowdown in economic growth for both countries.

The economic impact is not limited to China and the US. Other countries, particularly those involved in global supply chains, are also feeling the effects. For example, countries that supply components to Chinese manufacturers are experiencing reduced demand, which in turn affects their economic growth. The interconnected nature of global trade means that the repercussions of the US-China tariff dispute are felt worldwide.

### 3. Sector-Specific Impacts:
The automotive, steel, and aluminum sectors are particularly affected, with US farmers and small businesses facing significant challenges. The tariffs have forced businesses to increase prices, making products less competitive and impacting consumer surplus. Small businesses, which often lack the resources to absorb higher costs, are particularly vulnerable to these changes.

US farmers, who rely heavily on exports to China, have been hit hard by the retaliatory tariffs. The agricultural sector has seen a significant drop in demand for products like soybeans, pork, and other commodities. This has led to financial strain for farmers and has highlighted the need for diversification in export markets. Small businesses, which often rely on imported materials, have also struggled with increased costs and reduced profit margins.

### 4. Global Reactions:
Countries are engaging in negotiations to mitigate the effects of the tariffs, while the EU and other nations implement retaliatory measures. The situation underscores the need for timely and insightful content to help businesses and investors navigate the evolving trade landscape. The global response to the US-China tariff dispute highlights the complex and far-reaching impacts of these trade actions.

The EU, for instance, has implemented its own set of retaliatory tariffs on US goods, targeting products like bourbon, motorcycles, and orange juice. Other countries, such as Canada and Mexico, have also taken steps to protect their domestic industries from the effects of the tariffs. These measures underscore the interconnected nature of global trade and the potential for wider economic disruptions.

## Recommendations for Content Creation:

### 1. In-Depth Market Analysis:
Develop content that delves into the sector-specific impacts of the tariffs, highlighting how different industries are adapting to the changes. Create visualizations that illustrate the correlation between tariff implementations and market movements to provide clear insights for investors. For example, a detailed analysis of the automotive sector could include case studies of companies that have successfully navigated the tariffs by diversifying their supply chains or adopting new technologies.

### 2. Investor Sentiment and Strategy:
Produce articles and reports that analyze investor sentiment and provide strategies for navigating market volatility. Include expert opinions and case studies of companies that have successfully managed similar trade disruptions. For instance, a report could feature interviews with financial analysts who offer insights into how investors can protect their portfolios during times of market uncertainty.

### 3. Economic Indicators and Forecasts:
Publish regular updates on key economic indicators affected by the tariffs, such as GDP growth, inflation rates, and trade volumes. Offer forecasts and scenarios that explore the potential long-term implications of the trade war on global economic stability. For example, a quarterly update could provide data on how the tariffs are affecting economic growth in both the US and China, along with projections for the coming year.

### 4. Global Trade Dynamics:
Create content that examines the global reactions to the US-China tariff dispute, including the retaliatory measures taken by other countries. Analyze the broader geopolitical implications and the potential for multilateral trade agreements to mitigate the effects of the tariffs. For instance, an article could explore how the EU's retaliatory tariffs are affecting US exports and the potential for trade negotiations to resolve the dispute.

## Conclusion:
The US tariffs on China have set off a chain reaction of economic and market disruptions that require careful analysis and strategic content creation. By synthesizing complex market data into actionable insights, financial advisory firms can provide valuable guidance to businesses and investors navigating this uncertain landscape. Continuous monitoring and timely updates will be crucial in helping stakeholders make informed decisions and adapt to the evolving trade environment.

---

## Blog Post: Navigating the US-China Tariff Landscape: Insights and Market Reactions

### Introduction:
The recent implementation of US tariffs on China has sent shockwaves through global markets, leading to significant volatility and geopolitical tensions. As China retaliates with its own set of tariffs, the trade war between the two economic giants continues to escalate. This blog post delves into the key findings and market reactions, providing investors and businesses with actionable insights to navigate the evolving trade landscape.

### Market Volatility and Sentiment:
The announcement of a 90-day pause on tariffs for most countries, excluding China, has resulted in substantial market volatility. China's retaliatory tariffs, raising levies on US goods to 84%, have exacerbated market instability. Investor sentiment has been negatively impacted, with concerns over disrupted supply chains, increased inflation, and potential economic slowdown.

Market volatility has been particularly pronounced in sectors directly affected by the tariffs. The automotive industry, for instance, has seen significant price increases due to higher costs of imported materials. Similarly, the steel and aluminum sectors have faced challenges as tariffs have driven up the prices of raw materials, making domestic production less competitive. These disruptions have led to a ripple effect across global supply chains, affecting manufacturers and consumers alike.

### Economic Impact:
The US tariffs are predicted to cause a 2.4% decline in China's economic growth, affecting exports and domestic consumer sentiment. The tit-for-tat tariff escalation threatens to reduce trade between the US and China by 80%, with broader economic consequences expected. The automotive, steel, and aluminum sectors are particularly affected, with US farmers and small businesses facing significant challenges.

The economic impact is not limited to China and the US. Other countries, particularly those involved in global supply chains, are also feeling the effects. For example, countries that supply components to Chinese manufacturers are experiencing reduced demand, which in turn affects their economic growth. The interconnected nature of global trade means that the repercussions of the US-China tariff dispute are felt worldwide.

### Sector-Specific Impacts:
The tariffs have forced businesses to increase prices, making products less competitive and impacting consumer surplus. Countries are engaging in negotiations to mitigate the effects of the tariffs, while the EU and other nations implement retaliatory measures. The situation underscores the need for timely and insightful content to help businesses and investors navigate the evolving trade landscape.

US farmers, who rely heavily on exports to China, have been hit hard by the retaliatory tariffs. The agricultural sector has seen a significant drop in demand for products like soybeans, pork, and other commodities. This has led to financial strain for farmers and has highlighted the need for diversification in export markets. Small businesses, which often rely on imported materials, have also struggled with increased costs and reduced profit margins.

### Global Reactions:
The global response to the US-China tariff dispute highlights the complex and far-reaching impacts of these trade actions. The situation underscores the need for timely and insightful content that helps businesses and investors navigate the evolving trade landscape and understand the long-term implications for global economic stability.

The EU, for instance, has implemented its own set of retaliatory tariffs on US goods, targeting products like bourbon, motorcycles, and orange juice. Other countries, such as Canada and Mexico, have also taken steps to protect their domestic industries from the effects of the tariffs. These measures underscore the interconnected nature of global trade and the potential for wider economic disruptions.

### Conclusion:
The US tariffs on China have set off a chain reaction of economic and market disruptions that require careful analysis and strategic content creation. By synthesizing complex market data into actionable insights, financial advisory firms can provide valuable guidance to businesses and investors navigating this uncertain landscape. Continuous monitoring and timely updates will be crucial in helping stakeholders make informed decisions and adapt to the evolving trade environment.

Loading