Skip to main content
Open In Colab This notebook demonstrates how to build a real-time, LLM-powered newsletter assistant by combining LlamaIndex with Dappier. It walks through building a “Smart Content Curator” app that pulls trending articles from sports, lifestyle, and pet care domains and organizes them into a structured newsletter-ready format. In this notebook, you’ll explore:
  • Dappier: A platform that connects LLMs and agentic AI agents to real-time, rights-cleared data from trusted sources. It delivers verified, prompt-ready information across domains like web search, finance, news, and more.
  • LlamaIndex: A data framework that allows seamless integration of external tools with LLMs. It enables structured workflows for tool use, reasoning, and response generation.
  • OpenAI: An advanced AI model provider used here to power the assistant’s reasoning, planning, and response generation.
This setup offers a practical example of building content-aware applications with real-time data access. It can be extended to newsletters, content discovery, media platforms, and other editorial use cases.

Watch the Video Guide

If you prefer a visual walkthrough, check out the accompanying video guide below:

Installation

To get started with the newsletter assistant, install the required packages:

Setup API Keys

To authenticate and use Dappier and OpenAI, you’ll need valid API keys. You can generate one for free from your Dappier API dashboard.
Python
You can obtain your OpenAI API key from the OpenAI API dashboard.
Python

Dappier AI Recommendations Tool

The DappierAIRecommendationsToolSpec enables LLMs to access real-time, curated news and content across categories like sports, lifestyle, pet care, sustainability, and local news.

Initialize the Tool

Python

Sample Tool Usage

Sports News Recommendations

Python

Lifestyle News

Python

iHeartDogs Articles

Python

iHeartCats Articles

Python

GreenMonster Articles

Python

WISH-TV News

Python

9 and 10 News

Python

Build a Real-Time Newsletter Agent

Now that your API keys are set and packages are installed, you’re ready to build the smart content curation agent. Start by importing the required modules:
Python
Initialize the OpenAI model that will power the agent:
Python
Next, set up the Dappier AI recommendations tool:
Python
Now define the agent workflow. In this case, the agent acts as a real-time newsletter curator:
Python
To stream the results from the agent and display both tool interactions and the generated content, run the following:
Python
Finally, launch the agent:
Python

Conclusion

This notebook has guided you how to build a real-time, LLM-powered content curation assistant by combining LlamaIndex with Dappier. It walks through creating a smart newsletter generator using current, curated news content across multiple verticals. In this notebook, explored:
  • Dappier: A platform that connects LLMs and agentic AI agents to real-time, rights-cleared data from trusted sources. It delivers verified, prompt-ready information across domains like web search, finance, news, and more.
  • LlamaIndex: A data framework that allows seamless integration of external tools with LLMs. It enables structured workflows for tool use, reasoning, and response generation.
  • OpenAI: An advanced AI model provider used here to power the assistant’s reasoning, planning, and response generation.
This setup offers a practical example of building content-aware applications with real-time data access. It can be easily extended to editorial workflows, personalized content feeds, or media automation tools.