Skip to content

timbal-ai/build-an-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build an AI Agent - Technical Interview

Overview

Your task is to build an AI agent that can answer questions about cars using the provided dataset. The agent should be able to understand natural language queries and provide accurate responses based on the data in data/cars.csv.

Dataset

The data/cars.csv file contains detailed information about various car models including:

  • Make and Model information
  • Engine specifications (type, fuel type, cylinders, size, horsepower, torque)
  • Body details (type, doors, seats, dimensions, weight)
  • Fuel economy (MPG ratings, range, tank capacity)
  • Pricing (MSRP, invoice price)
  • Electric vehicle specifications (where applicable)

Requirements

Core Functionality

Your agent should be able to:

  1. Answer specific questions about car attributes

    • Examples: "What's the horsepower of the 2020 Acura ILX?", "How much does a Honda Civic cost?", "What's the fuel type of the BMW X3?"
  2. Compare vehicles across different attributes

    • Examples: "Which has better fuel economy: Honda Civic or Toyota Camry?", "Compare the seating capacity of SUVs", "Which is more expensive: Acura MDX or BMW X5?"
  3. Filter and search the dataset based on criteria

    • Examples: "Show me all SUVs under $50,000", "Find all electric vehicles", "List cars with more than 300 horsepower"
  4. Provide recommendations based on user preferences

    • Examples: "What's the most fuel-efficient car in the dataset?", "Recommend a family car with good safety ratings", "What's the best value luxury sedan?"

Example Queries Your Agent Should Handle

  • "What's the most expensive car in the dataset?"
  • "Show me all electric vehicles"
  • "Which Toyota models are available?"
  • "What's the fuel economy of the BMW X5?"
  • "Find cars with more than 400 horsepower"
  • "Compare the Acura MDX and Honda Pilot"
  • "What hybrid cars cost less than $35,000?"
  • "Which car has the largest trunk space?"

Bonus Points

  • Implement fuzzy matching for car names
  • Add support for complex queries (e.g., "Cars with more than 300 HP and AWD")
  • Create a simple CLI or web interface
  • Add data visualization capabilities
  • Implement conversation memory/context

Getting Started

We've taken care of all the environment setup for you! The project is configured and ready to use. Here's what you need to do:

1. Environment Setup

Install all dependencies using Python UV (a fast Python package installer):

uv sync

This will create a virtual environment and install all required packages including pandas for data manipulation and the OpenAI SDK for LLM functionality.

2. API Key Setup

For LLM functionality, you'll use the OpenAI SDK which is already included in the project dependencies. I will provide you with a onetimesecret link to get your API key. Once you have it, set it as an environment variable:

export OPENAI_API_KEY="your-api-key-here"

3. Important: Use Chat Completions API

EXPLICITLY use the OpenAI Chat Completions API - do NOT use the responses API or any framework. You should make direct calls to the chat completions endpoint using the OpenAI SDK like this:

from openai import OpenAI

client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[
        {"role": "system", "content": "You are a helpful assistant..."},
        {"role": "user", "content": "Your query here"}
    ]
)

4. Data Exploration

The dataset is ready for you to explore. Start by examining the car data:

import pandas as pd
df = pd.read_csv('data/cars.csv')
print(df.head())
print(df.columns)
print(df.info())

5. Implementation

Now you're ready to implement your agent! The environment is fully set up and you can focus on building the AI agent functionality.

What We're Looking For

This assessment focuses on how you think and approach problems rather than achieving perfect results with this toy dataset. We want to see:

  • Your problem-solving approach and thought process
  • How you structure your code and handle data
  • Your reasoning for design decisions
  • How you handle edge cases and unexpected inputs
  • Your ability to work with LLMs and data effectively

Remember: There's no single "correct" solution. We're interested in your methodology and reasoning.

Interview Format

  • 1 hour live coding session where we'll discuss your approach and see you work through problems
  • Follow-up time to complete and refine your solution after the interview

Submission

After the interview, you'll have time to complete your solution. Please submit:

  • Private submission: Send a zip file of your complete solution via email
  • Include all your code, any additional files, and a brief explanation of your approach
  • Document any assumptions, trade-offs, or areas for improvement you identified

Good luck and have fun building!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages