An open API service indexing awesome lists of open source software.

https://github.com/astrabert/newsreport-ai

News about any topic, already digested for you📰
https://github.com/astrabert/newsreport-ai

agentic-ai agentic-workflow fastapi gradio groq llamaindex multi-agent-systems news

Last synced: 7 months ago
JSON representation

News about any topic, already digested for you📰

Awesome Lists containing this project

README

          

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](https://llamaindex.ai) and powered by [Tavily](https://tavily.com), [Gradio](https://gradio.app) and [FastAPI](https://fastapi.tiangolo.com/).

# 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:

```bash
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](https://docs.docker.com/desktop/) and [docker compose](https://docs.docker.com/compose/)_

- Add the `groq_api_key` and the `tavily_api_key` variables in the [`.env.example`](./docker/.env.example) file and modify the name of the file to `.env`. Get these keys:
+ [On Groq Console](https://console.groq.com/keys)
+ [On Tavily](https://app.tavily.com/home/)

```bash
mv .env.example .env
```

- Launch the Docker application:

```bash
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](https://anaconda.org/anaconda/conda)_

- Add the `groq_api_key` and the `tavily_api_key` variables in the [`.env.example`](./docker/.env.example) file and modify the name of the file to `.env`. Get these keys:
+ [On Groq Console](https://console.groq.com/keys)
+ [On Tavily](https://app.tavily.com/home/)

```bash
mv .env.example .env
cp .env scripts/
```

- Set up LlamaIndex Docs Agent using the dedicated script:

```bash
# For MacOs/Linux users
bash setup.sh
# For Windows users
.\setup.ps1
```

- Or you can do it manually, if you prefer:

```bash
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](CONTRIBUTING.md).

## License and rights of usage

The software is provided under MIT [license](./LICENSE).