Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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.









Loading