Skip to content

AstraBert/newsreport-ai

Repository files navigation

NewsReport AI

News about any topic, already digested for you📰

If you find NewsReport AI useful, please consider to support us through donation:

GitHub Sponsors Badge

NewsReport AI Logo

NewsReport AI is a multi-agent news report framework written with LlamaIndex and powered by Tavily, Gradio and FastAPI.

Install and launch🚀

The first step, common to both the Docker and the source code setup approaches, is to clone the repository and access it:

git clone https://github.com/AstraBert/newsreport-ai.git
cd newsreport-ai/

Once there, you can choose one of the two following approaches:

Docker (recommended)🐋

Required: Docker and docker compose

mv .env.example .env
  • Launch the Docker application:
docker compose up -d

You will see the application running on http://localhost:8000/chat and you will be able to use it. Depending on your connection and on your hardware, the set up might take some time (up to 30 mins to set up) - but this is only for the first time your run it!

Source code🗎

Required: conda

mv .env.example .env
cp .env scripts/
  • Set up LlamaIndex Docs Agent using the dedicated script:
# For MacOs/Linux users
bash setup.sh
# For Windows users
.\setup.ps1
  • Or you can do it manually, if you prefer:
conda env create -f environment.yml
conda activate news-report

cd scripts/
uvicorn main:app --host 0.0.0.0 --port 8000

conda deactivate

You will see the application running on http://localhost:8000/chat and you will be able to use it.

How it works

LlamaIndex Docs Agent workflow

Whenever the user asks a question from the Gradio chat interface running on http://localhost:8000/chat, this question is processed by the /report endpoint of the FastAPI-managed API to which the Gradio app is attached. The /report endpoint passes the user message to the multi-agent framework, which:

  • Activates NewsSearchAgent, which searches for news on the web with Tavily and produces some notes about the news content
  • NewsSearchAgent hands on the notes to the WriteAgent:
    • If the information is sufficient, the WriteAgent writes a report about the news
    • If not, the WriteAgent asks NewsSearchAgent for more information
  • WriteAgent hands on the report to ReviewAgent, which can:
    • Accept the report and return it to the user
    • Reject the report and hand it back to the WriteAgent

Contributing

Contributions are always welcome! Follow the contributions guidelines reported here.

License and rights of usage

The software is provided under MIT license.