This is one of my projects for the Agentic AI Nanodegree at Udacity.
UdaPlay is intended to be an AI-powered research agent for the video game industry. This project is divided into two main parts that help us build a sophisticated AI agent capable of answering questions about video games using both local knowledge and web searches.
In this part, I built a Vector Database using ChromaDB to store and retrieve video game information efficiently.
Key tasks:
- Set up ChromaDB as a persistent client
- Create a collection with appropriate embedding functions
- Process and index game data from JSON files
- Each game document contains:
- Name
- Platform
- Genre
- Publisher
- Description
- Year of Release
Built an intelligent agent that combines local knowledge with web search capabilities.
The agent had the following capabilities:
- Answer questions using internal knowledge (RAG)
- Search the web when needed
- Maintain conversation state
- Return structured outputs
- Store useful information for future use
Required Tools to Implement:
retrieve_game: Search the vector database for game informationevaluate_retrieval: Assess the quality of retrieved resultsgame_web_search: Perform web searches for additional information
To reproduce this work, it is necessary to create a .env file with the following API keys:
OPENAI_API_KEY="YOUR_KEY"
CHROMA_OPENAI_API_KEY="YOUR_KEY"
TAVILY_API_KEY="YOUR_KEY"
- Python 3.11+
- ChromaDB
- OpenAI
- Tavily
- dotenv
project/
├── starter/
│ ├── games/ # JSON files with game data
│ ├── lib/ # Custom library implementations
│ │ ├── llm.py # LLM abstractions
│ │ ├── messages.py # Message handling
│ │ ├── ...
│ │ └── tooling.py # Tool implementations
│ ├── Udaplay_01_starter_project.ipynb # Part 1 implementation
│ └── Udaplay_02_starter_project.ipynb # Part 2 implementation
- Create and activate a virtual environment
- Install required dependencies
- Set up your
.envfile with necessary API keys - Follow the notebooks in order:
- Complete Part 1 to set up your vector database
- Complete Part 2 to implement the AI agent
After completing both parts, I tested this agent with questions such as:
- "When was Pokémon Gold and Silver released?"
- "Which one was the first 3D platformer Mario game?"
- "Was Mortal Kombat X released for PlayStation 5?"