Skip to content

ludaladila/Duke_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Duke AIPI Intelligent Assistant

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.

Features

  • 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

Project Structure

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

Installation Guide

  1. Clone the repository:
git clone <https://github.com/Duke-AIPI-LLM-Course/project-2-small-ai.git>
  1. Create and activate virtual environment:
python -m venv .venv
source .venv/bin/activate  # Unix/macOS
# or
.venv\Scripts\activate     # Windows
  1. Install dependencies:
cd agent
pip install -r requirements.txt
  1. Configure environment variables:
    • set the .env
    • Set your OpenAI API key in the .env file:
OPENAI_API_KEY=your-api-key-here
DUKE_API_TOKEN=your-api-key-here

Usage

  1. Ensure you have completed the installation steps and activated the virtual environment

  2. Run the main program:

python agent/main.py
  1. Example query:
result = process_query("Tell me about the AIPI program at Duke.")
print(result)

Available Tools

  1. AIPI Program Information
    Provides detailed AIPI program information using Retrieval-Augmented Generation (RAG), including program details, degree options, courses, admissions requirements, etc.

  2. Duke AI Courses
    Supports comprehensive inquiries into AI-related courses, including course overviews, specific course code lookups, and keyword searches.

  3. AIPI Faculty
    Retrieves accurate information from Duke AIPI Engineering's faculty directory, capturing details like name, email, title, and department.

  4. 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).

  5. Pratt Link Selector
    Leverages semantic matching to intelligently select relevant Pratt School web pages for quick access to important resources.

  6. General Web Scraper
    Utilizes BeautifulSoup to scrape various types of web data, including page titles, paragraphs, lists, tables, and hyperlinks.

Notes

  • Ensure your OpenAI API key and DUKE API is properly set up before use

Evaluation

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.

Demo

http://3.14.136.75:8501/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages