This is an intelligent assistant system developed based on LangChain and OpenAI GPT-4, specifically designed to answer questions about Duke University's AI Program for Innovation (AIPI). The assistant can provide comprehensive information including course details, faculty profiles, campus events, and more.
- AIPI Program Information: Provides detailed information about Duke's AI Program for Innovation
- Course Information: Queries detailed information about AI-related courses
- Faculty Information: Retrieves information about Duke AIPI faculty members
- Campus Events: Queries campus events for the next 50 days
- Web Scraping: Capable of scraping information from specified URLs
- Smart Link Selection: Intelligently selects relevant Pratt School webpages based on user queries
agent/
├── tools/ # Various tool implementations
├── duke_aipi_data/ # AIPI related data
├── main.py # Main program entry
├── crawler.py # Web crawler implementation
└── prompt.py # Prompt templates
- Clone the repository:
git clone <https://github.com/Duke-AIPI-LLM-Course/project-2-small-ai.git>- Create and activate virtual environment:
python -m venv .venv
source .venv/bin/activate # Unix/macOS
# or
.venv\Scripts\activate # Windows- Install dependencies:
cd agent
pip install -r requirements.txt- Configure environment variables:
- set the
.env - Set your OpenAI API key in the
.envfile:
- set the
OPENAI_API_KEY=your-api-key-here
DUKE_API_TOKEN=your-api-key-here
-
Ensure you have completed the installation steps and activated the virtual environment
-
Run the main program:
python agent/main.py- Example query:
result = process_query("Tell me about the AIPI program at Duke.")
print(result)-
AIPI Program Information
Provides detailed AIPI program information using Retrieval-Augmented Generation (RAG), including program details, degree options, courses, admissions requirements, etc. -
Duke AI Courses
Supports comprehensive inquiries into AI-related courses, including course overviews, specific course code lookups, and keyword searches. -
AIPI Faculty
Retrieves accurate information from Duke AIPI Engineering's faculty directory, capturing details like name, email, title, and department. -
Campus Events
Real-time querying of Duke University's official calendar API to fetch events over the next 50 days, with support for keyword filtering and detailed event information (title, description, date, time, location, and event URL). -
Pratt Link Selector
Leverages semantic matching to intelligently select relevant Pratt School web pages for quick access to important resources. -
General Web Scraper
Utilizes BeautifulSoup to scrape various types of web data, including page titles, paragraphs, lists, tables, and hyperlinks.
- Ensure your OpenAI API key and DUKE API is properly set up before use
The agent was evaluated using human evaluation and an LLM (Gemini 2.0-flash)to judge the response. Over four different prompts each using multiple tools, the LLM rated each response from 1-10 and returned a mean rating of 6.5. On human evaluation, each response was judged on its validity. 3 responses were successful while one interpreted the LLM course as a Law Degree course, 3/4, 75% accurate.