Hands-on examples covering AI agent fundamentals: a shopping agent, guardrails, and evaluation.
- Python 3.13+
- uv package manager
git clone <repo-url>
cd ai-agent-fundamentalscp sample.env .envOpen .env and fill in your API keys:
GROQ_API_KEY=<your groq key here>
LANGSMITH_API_KEY=<your langsmith key here>
| Key | Where to get it |
|---|---|
GROQ_API_KEY |
console.groq.com |
LANGSMITH_API_KEY |
smith.langchain.com |
uv syncmacOS / Linux:
source .venv/bin/activateWindows (Command Prompt):
.venv\Scripts\activate.batWindows (PowerShell):
.venv\Scripts\Activate.ps1First, set up the database, then start the API server and agent:
# In another terminal — run the shopping agent
python 1_shopping_agent/shopping_agent.pypython 2_guardrails/guardrails.py# Run functional evaluation
python 3_eval/func_eval.py
ai-agent-fundamentals/
├── 1_shopping_agent/ # Tool-calling agent with a product reviews API
├── 2_guardrails/ # Input/output guardrail patterns
├── 3_eval/ # Agent evaluation with LangSmith
├── sample.env # Template for environment variables
└── pyproject.toml # Project dependencies (managed by uv)