NewsReport AI is a multi-agent news report framework written with LlamaIndex and powered by Tavily, Gradio and FastAPI.
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:
Required: Docker and docker compose
- Add the
groq_api_key
and thetavily_api_key
variables in the.env.example
file and modify the name of the file to.env
. Get these keys:
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!
Required: conda
- Add the
groq_api_key
and thetavily_api_key
variables in the.env.example
file and modify the name of the file to.env
. Get these keys:
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.
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
Contributions are always welcome! Follow the contributions guidelines reported here.
The software is provided under MIT license.