This application expands on the included Mastra weather demo to demonstrate an AI agent with multiple tool capabilities. The agent showcases Mastra's agentic, RAG, and tool capabilities through weather and movie recommendation tools.
- Agentic capabilities - AI agent that can handle weather and movie requests
- Weather tool - Fetches current weather information for any location
- Movie tool - Provides movie recommendations and information using RAG
- RAG system - Semantic search across movie plots and metadata using retrieval-augmented generation
- Tool integration - MongoDB Atlas Vector Search for movie embeddings
- Built with Mastra framework and OpenAI
Movies Collection: sample_mflix.movies
- Uses the MongoDB Atlas sample dataset
Embeddings Collection: sample_mflix.movie_embeddings
- Vector embeddings for semantic search
- Includes plot and metadata chunks
Before getting started, you'll need to load the sample data in MongoDB Atlas:
-
Create a MongoDB Atlas cluster - If you don't have one already, create a free cluster at MongoDB Atlas
-
Load sample data - Load the sample datasets in your Atlas cluster:
- In your Atlas dashboard, go to your cluster
- Click "Browse Collections"
- Click "Add My Own Data" or use the "Load Sample Dataset" option
- Select and load the Sample Mflix Dataset which includes the
sample_mflix.moviescollection
-
Set up your environment variables in
.env:MONGODB_URI=your_mongodb_connection_string OPENAI_API_KEY=your_openai_api_key -
Install dependencies:
npm install
-
Create embeddings:
npm run create-embeddings
-
Start the development server:
npm run dev
npm run create-embeddings: Create embeddings for movies in the databasenpm run dev: Start the development server