Skip to content

VinUni-AI20k/Day-3-Lab-Chatbot-vs-react-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lab 3: Chatbot vs ReAct Agent (Industry Edition)

Welcome to Phase 3 of the Agentic AI course! This lab focuses on moving from a simple LLM Chatbot to a sophisticated ReAct Agent with industry-standard monitoring.

🚀 Getting Started

1. Setup Environment

Copy the .env.example to .env and fill in your API keys:

cp .env.example .env

2. Install Dependencies

pip install -r requirements.txt

3. Directory Structure

  • src/tools/: Extension point for your custom tools.

🏠 Running with Local Models (CPU)

If you don't want to use OpenAI or Gemini, you can run open-source models (like Phi-3) directly on your CPU using llama-cpp-python.

1. Download the Model

Download the Phi-3-mini-4k-instruct-q4.gguf (approx 2.2GB) from Hugging Face:

2. Place Model in Project

Create a models/ folder in the root and move the downloaded .gguf file there.

3. Update .env

Change your DEFAULT_PROVIDER and set the path:

DEFAULT_PROVIDER=local
LOCAL_MODEL_PATH=./models/Phi-3-mini-4k-instruct-q4.gguf

🎯 Lab Objectives

  1. Baseline Chatbot: Observe the limitations of a standard LLM when faced with multi-step reasoning.
  2. ReAct Loop: Implement the Thought-Action-Observation cycle in src/agent/agent.py.
  3. Provider Switching: Swap between OpenAI and Gemini seamlessly using the LLMProvider interface.
  4. Failure Analysis: Use the structured logs in logs/ to identify why the agent fails (hallucinations, parsing errors).
  5. Grading & Bonus: Follow the SCORING.md to maximize your points and explore bonus metrics.

🛠️ How to Use This Baseline

The code is designed as a Production Prototype. It includes:

  • Telemetry: Every action is logged in JSON format for later analysis.
  • Robust Provider Pattern: Easily extendable to any LLM API.
  • Clean Skeletons: Focus on the logic that matters—the agent's reasoning process.

Happy Coding! Let's build agents that actually work.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages