CrewNews is an AI news generator delivering an unbiased version of the news for a given topic using AI agents
MIT License
⚡ Powered by ⚡Streamlit | Llama 3.1 | AIML | CrewAI | AgentOps | Exa | Firecrawl
Enjoying what you find in this repository? Your star ⭐ would be greatly appreciated!
CrewNews is a Streamlit app designed to generate an unbiased version of the news for a given question or topic by combining content from media providers across the political spectrum in the United States. It uses Llama 3.1 as the LLM (inferenced via the AIML), CrewAI for building AI agents, AgentOps for testing AI agents, Exa as a web search tool, and Firecrawl as a web scraping tool.*
👉 See the video presentation here. 👉 Try the fully functioning app here.
*CrewNews was developed as a project for the LabLab September 2024 hackathon.
Biases in news reporting can distort public perception, leading to a skewed understanding of important issues and events. When media outlets present information from a single perspective, they risk creating echo chambers where only certain viewpoints are amplified while others are silenced. This not only undermines the integrity of journalism but also affects how individuals form opinions and make decisions based on incomplete information.
In seeking truth you have to get both sides of a story. – Walter Cronkite
CrewNews addresses this critical issue by actively sourcing and presenting content from a diverse range of media providers from the United States, ensuring that multiple perspectives are represented in each report. By utilizing advanced AI technologies, CrewNews fosters a more balanced discourse, empowering users to hear all sides of the story for a given question or topic and come closer to the truth.
For example, here's a part of the report that CrewNews generated for the US Presidential Debate 2024 Harris vs Trump topic:
/.../ The New York Times reported that Harris also slammed Trump for a social media post in which he thanked Chinese President Xi Jinping for his handling of the Covid-19 pandemic [3]. In contrast, Fox News highlighted Trump's assertion that his leadership style was the reason why China and other countries respected him [4]. /.../
If you're a The New York Times reader, Trump === bad. If you're a Fox News reader, Trump === good. Where's the truth? Usually in the middle.
Run the following command in the terminal to clone the repository:
git clone https://github.com/rokbenko/crew-news.git
Run the following command in the terminal to change the directory:
cd crew-news
Run the following command in the terminal to create a virtual environment named my-venv
:
python -m venv my-venv
[!TIP] You can verify that the virtual environment is created successfully if you see a folder named
my-venv
inside the root directory.
[!NOTE]
venv
is a built-in Python module that allows you to create and manage virtual environments. If you have Python3.3
or higher installed, you can start usingvenv
right away.
Run the following command in the terminal to activate the virtual environment named my-venv
:
my-venv/scripts/activate
[!TIP] You can verify that the virtual environment is activated successfully if you see
(my-venv)
at the beginning of your terminal prompt, like this:(my-venv) C:\your\path\to\crew-news\
Run the following command in the terminal to install all the required packages:
pip install -r requirements.txt
secrets.toml
file (optional but recommended)[!NOTE] Setting up all API keys is mandatory. You need your API keys if you want to use CrewNews.
But adding API keys to the
secrets.toml
file is optional. You have two options for how to use your API keys with CrewNews:
- adding them to the
secrets.toml
file, or- typing them into the input fields in the CrewNews's sidebar on the Home page.
Inside the .streamlit
folder, create the secrets.toml
file that should contain the following secrets:
AIML_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AGENTOPS_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
EXA_API_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
FIRECRAWL_API_KEY = "fc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Run the following command in the terminal to start the Streamlit app:
streamlit run 1_Home.py
Navigate to http://localhost:8501 to open CrewNews in the browser.
3.11.8
1.38.0
0.1.23
0.55.2
0.12.0
0.3.10
1.1.0
1.2.3
The user begins by entering a specific question or news topic they want to explore. CrewNews uses this input to target media sources relevant to the selected subject, creating a foundation for gathering diverse content from media providers across the United States.
First, CrewNews activates the Media Expert agent to source media outlets representing various political viewpoints—left, center, and right. This ensures the collected content offers a balanced range of perspectives, avoiding bias from any single ideological standpoint.
After the media providers are gathered, the Web Domain Expert agent identifies and retrieves the web domain URLs of the selected media providers.
Once the web domain URLs are obtained, the Written Content Expert agent utilizes the Exa tool to search for relevant articles from each media provider’s website. CrewNews focuses solely on written content, filtering out videos or images.
Following the retrieval of news URLs, the Text Extractor Expert agent uses the Firecrawl tool to scrape the full written content from each news article.
Last, the Unbiased Journalist agent reviews all gathered content, analyzing how each media outlet reports on the same question or topic. By presenting the viewpoints of left, center, and right media outlets, the agent compiles an unbiased article that offers a complete and balanced perspective. Users can see all sides of the story and form more informed opinions, free from skewed narratives.
CrewNews is built on a modular architecture that employs a crew of specialized AI agents using the CrewAI framework. Each agent is designed to handle specific tasks within the news generation pipeline, allowing for efficient and systematic processing of information.
404
errors when users attempt to access the article directly from the source URL.Both of these issues could very likely be resolved with further tweaking of the crew of AI agents.
Contributions are welcome! Feel free to open issues or create pull requests for any improvements or bug fixes.
This project is open source and available under the MIT License.