Skip to main content
LlamaIndex is a data framework designed to connect custom data sources with large language models (LLMs). It helps in structuring, indexing, and querying data, making it easy for LLMs to understand and retrieve relevant information efficiently. LlamaIndex supports a wide variety of data connectors and offers tools for building powerful retrieval-augmented generation (RAG) applications. Dappier is a platform that connects LLMs and Agentic AI agents to real-time, rights-cleared data from trusted sources, including web search, finance, and news. By providing enriched, prompt-ready data, Dappier empowers AI with verified and up-to-date information for a wide range of applications.

Overview

The LlamaIndex integration with Dappier allows developers to enhance their LLM applications with real-time search and AI-powered recommendation tools. By leveraging Dappier’s pre-trained, RAG-ready APIs, LLMs can retrieve accurate, up-to-date information across key domains such as news, finance, weather, sports, and lifestyle content. This integration includes two tools:
  • DappierRealTimeSearchToolSpec: Enables LLMs to access live web and financial data using natural language queries.
  • DappierAIRecommendationsToolSpec: Provides intelligent content recommendations from trusted media sources based on user intent and query context.
Together, these tools help ensure your LLM outputs are factual, relevant, and enriched with trusted real-world data.

Installation

To get started, install the required Python packages:
!pip install llama-index llama-index-tools-dappier

Setup API Keys

To authenticate and use Dappier tools, you’ll need a valid API key. You can generate one for free from your Dappier API dashboard. Once you have the key, set it in your environment using the following code:
Python
import os
from getpass import getpass

# Prompt for the Dappier API key securely
dappier_api_key = getpass("Enter your API key: ")
os.environ["DAPPIER_API_KEY"] = dappier_api_key

Dappier Real Time Search Tool

Open In Colab The DappierRealTimeSearchToolSpec allows LLMs to access real-time data across the web, including the latest news, weather, financial updates, and more.

Watch the Video Guide

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

Initialize the Tool

You can initialize the real-time search tool and convert it into a list of tools ready for use:
Python
from llama_index.tools.dappier import DappierRealTimeSearchToolSpec

dappier_tool = DappierRealTimeSearchToolSpec()

dappier_tool_list = dappier_tool.to_tool_list()
for tool in dappier_tool_list:
    print(tool.metadata.name)
search_real_time_data
search_stock_market_data
Query real-time web content such as news, weather, or general updates.
Python
print(dappier_tool.search_real_time_data("How is the weather in New York today?"))
"Partly cloudy in New York today with highs around 65Β°F and a chance of light rain in the evening."

Stock Market Data

Access real-time financial insights and stock news.
Python
print(dappier_tool.search_stock_market_data("latest financial news on Meta"))
"Meta shares rose 2.5% following an announcement of new AI products, as reported by Bloomberg."

Parameters

The DappierRealTimeSearchToolSpec methods support the following parameter:

query (str)

  • A natural language query used to retrieve real-time data from web sources or financial platforms.
  • This parameter is required for both search_real_time_data and search_stock_market_data.

Dappier AI Recommendations Tool

Open In Colab The DappierAIRecommendationsToolSpec provides intelligent, real-time content recommendations across a variety of verticals including sports, lifestyle, pet care, sustainable living, and local news. These recommendations come from trusted content partners and are tailored based on user queries.

Watch the Video Guide

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

Initialize the Tool

Python
from llama_index.tools.dappier import DappierAIRecommendationsToolSpec

dappier_tool = DappierAIRecommendationsToolSpec()

dappier_tool_list = dappier_tool.to_tool_list()
for tool in dappier_tool_list:
    print(tool.metadata.name)
get_sports_news_recommendations
get_lifestyle_news_recommendations
get_iheartdogs_recommendations
get_iheartcats_recommendations
get_greenmonster_recommendations
get_wishtv_recommendations
get_nine_and_ten_news_recommendations

Sports News Recommendations

Python
print(
    dappier_tool.get_sports_news_recommendations(
        query="latest sports news", similarity_top_k=1
    )
)
Result 1:
Title: Vincent Trocheck’s overtime goal lifts Rangers past Wild 5-4 for crucial victory
Author: Jim Cerny
Published on: Thu, 03 Apr 2025 02:23:30 +0000
Source: Forever Blueshirts (www.foreverblueshirts.com)
URL: https://www.foreverblueshirts.com/new-york-rangers-news/vincent-trocheck-overtime-goal-victory-wild/
Image URL: https://images.dappier.com/dm_01j0pb465keqmatq9k83dthx34/NHL-Edmonton-Oilers-at-New-York-Rangers-25723775_.jpg?width=428&height=321
Summary: Vincent Trocheck's overtime goal gave the Rangers a 5-4 win over the Minnesota Wild, tying them with the Canadiens in the playoff race. Panarin had a goal and two assists.
Score: None

Lifestyle News

Python
print(
    dappier_tool.get_lifestyle_news_recommendations(
        query="latest lifestyle updates", similarity_top_k=1
    )
)
Result 1:
Title: Top 10 Travel Trends for 2025
Author: Jane Doe
Published on: Thu, 03 Apr 2025 02:00:00 +0000
Source: The Mix (www.themix.com)
URL: https://www.themix.com/travel/travel-trends-2025/
Image URL: https://images.dappier.com/example/travel-trends.jpg
Summary: From eco-tourism to remote work getaways, these are the top trends shaping how we explore the world in 2025.
Score: None

iHeartDogs Articles

Python
print(
    dappier_tool.get_iheartdogs_recommendations(
        query="dog care tips", similarity_top_k=1
    )
)
Result 1:
Title: 5 Essential Grooming Tips for Your Dog
Author: Sarah Barkley
Published on: Thu, 03 Apr 2025 01:45:00 +0000
Source: iHeartDogs (www.iheartdogs.com)
URL: https://www.iheartdogs.com/grooming-tips-for-dogs/
Image URL: https://images.dappier.com/example/grooming-tips.jpg
Summary: Keep your pup clean and healthy with these five simple grooming tips from pet care professionals.
Score: None

iHeartCats Articles

Python
print(
    dappier_tool.get_iheartcats_recommendations(
        query="cat care advice", similarity_top_k=1
    )
)
Result 1:
Title: Understanding Your Cat's Body Language
Author: Jenna Whiskers
Published on: Thu, 03 Apr 2025 01:35:00 +0000
Source: iHeartCats (www.iheartcats.com)
URL: https://www.iheartcats.com/cat-body-language-guide/
Image URL: https://images.dappier.com/example/cat-language.jpg
Summary: Learn how to interpret your cat’s posture, eyes, and tail to better understand their mood and needs.
Score: None

GreenMonster Articles

Python
print(
    dappier_tool.get_greenmonster_recommendations(
        query="sustainable living", similarity_top_k=1
    )
)
Result 1:
Title: How to Start a Zero-Waste Lifestyle
Author: Emily Earth
Published on: Thu, 03 Apr 2025 01:25:00 +0000
Source: GreenMonster (www.greenmonster.com)
URL: https://www.greenmonster.com/zero-waste-guide/
Image URL: https://images.dappier.com/example/zero-waste.jpg
Summary: This beginner’s guide will help you transition into a sustainable, zero-waste lifestyle with simple steps.
Score: None

WISH-TV News

Python
print(
    dappier_tool.get_wishtv_recommendations(
        query="latest breaking news", similarity_top_k=1
    )
)
Result 1:
Title: Indiana Legislature Passes Major Education Bill
Author: Mark Newsman
Published on: Thu, 03 Apr 2025 01:15:00 +0000
Source: WISH-TV (www.wishtv.com)
URL: https://www.wishtv.com/news/indiana-education-bill/
Image URL: https://images.dappier.com/example/education-bill.jpg
Summary: The new bill will allocate additional funds to public schools and implement updated curriculum standards across Indiana.
Score: None

9 and 10 News

Python
print(
    dappier_tool.get_nine_and_ten_news_recommendations(
        query="northern michigan local news", similarity_top_k=1
    )
)
Result 1:
Title: Cadillac Hosts Spring Festival to Kick Off the Season
Author: Lauren Local
Published on: Thu, 03 Apr 2025 01:05:00 +0000
Source: 9 & 10 News (www.9and10news.com)
URL: https://www.9and10news.com/spring-festival-cadillac/
Image URL: https://images.dappier.com/example/cadillac-festival.jpg
Summary: Northern Michigan communities gather to celebrate the start of spring with live music, food trucks, and local vendors in downtown Cadillac.
Score: None

Parameters

All recommendation methods in DappierAIRecommendationsToolSpec support the following parameters:

query (str)

  • The user query for retrieving recommendations.

data_model_id (str) Optional

  • The data model ID to use for recommendations.
  • Data model IDs always start with the prefix "dm_".
  • Defaults to "dm_01j0pb465keqmatq9k83dthx34".

similarity_top_k (int) Optional

  • The number of top documents to retrieve based on similarity.
  • Defaults to 9.

ref (str) Optional

  • The site domain where AI recommendations should be displayed.
  • Defaults to None.

num_articles_ref (int) Optional

  • The minimum number of articles to return from the specified reference domain (ref).
  • The remaining articles will come from other sites in the RAG model.
  • Defaults to 0.

search_algorithm (str) Optional

  • The search algorithm to use for retrieving articles. Available options:
    • "most_recent" (default)
    • "semantic"
    • "most_recent_semantic"
    • "trending"
These parameters offer flexibility in customizing how results are retrieved and displayed, depending on the application needs.

Conclusion

Integrating Dappier with LlamaIndex enables powerful, real-time, and context-aware capabilities for your LLM applications. Whether you’re looking to pull the latest updates from the web or generate tailored content recommendations, Dappier’s tools make it easy to deliver accurate and relevant results using natural language. With just a few lines of code, you can bring trusted, live data into your AI workflowsβ€”empowering your models with factual, fresh, and focused responses.