Skip to main content
Open In Colab This notebook demonstrates how to build a real-time, LLM-powered travel assistant by combining LlamaIndex with Dappier. It walks through creating a dynamic 2-day itinerary for New York City based on current news, weather conditions, and hotel availability. 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 context-aware applications with real-time data access. It can be easily extended to other domains requiring live insights and AI-driven decision-making.

Watch the Video Guide

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

Installation

To get started with the dynamic travel planner, 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 Real Time Search Tool

The DappierRealTimeSearchToolSpec enables LLMs to access real-time data across the web, including the latest news, weather updates, and financial information. This tool is ideal for applications requiring up-to-date, context-rich data.

Initialize the Tool

To utilize the real-time search tool, initialize it as follows:
Python
Retrieve current web content such as news or weather updates using the search_real_time_data method:
Python

Stock Market Data

Access up-to-date financial insights or company-specific news with the search_stock_market_data method:
Python

Build a Dynamic Travel Planner Agent

Now that your API keys are set and packages are installed, you’re ready to build the dynamic travel planner. Start by importing the required modules:
Python
Initialize the OpenAI model that will power the agent:
Python
Next, set up the Dappier real-time search tool. This tool allows the agent to query live data like news, weather, and financial updates:
Python
Now define the agent workflow. This is where the agent’s purpose and reasoning behavior are configured. In this case, the agent acts as a smart travel assistant for New York City:
Python
Define the user prompt that will be passed to the agent. This describes exactly what we want it to do:
Python
To stream the results from the agent and display both tool interactions and the generated itinerary, run the following:
Python
Finally, launch the planner:
Python

Conclusion

This notebook has guided you how to build a real-time, LLM-powered travel assistant by combining LlamaIndex with Dappier. It walks through creating a dynamic 2-day itinerary for New York City based on current news, weather conditions, and hotel availability. 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 context-aware applications with real-time data access. It can be easily extended to other domains requiring live insights and AI-driven decision-making.