This is the starter code for the AI Agents homework. You will be building a multi-agent system capable of performing research, analysis, and writing.
The project follows a production-ready src layout:
src/: Source code directory.main.py: Entry point for the application.config.py: Configuration management.tools/: Registry and tools implementation.search_tool.py: Provided search tools (DONE).registry.py: Tool mechanism (TODO).
agent/: Agent implementation.observable_agent.py: The core agent class with observability (TODO).specialists.py: Definitions for specific agents (Researcher, Analyst, Writer) (TODO).
observability/: Tracing and monitoring.tracer.py: Execution tracing (TODO).cost_tracker.py: Cost monitoring (TODO).loop_detector.py: Infinite loop prevention (TODO).
tests/: Test directory.
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Restart your terminal after installation, then verify:
uv --versionuv venvThis creates a .venv folder in the project root.
# macOS / Linux
source .venv/bin/activate
# Windows (CMD)
.venv\Scripts\activate.bat
# Windows (PowerShell)
.venv\Scripts\Activate.ps1uv pip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_key_here
MODEL_NAME=gpt-4o
# Run from the project root using the module flag -m
python -m src.main "Your query here"git statusgit add .
git commit -m "your commit message"git checkout -b your-branch-namegit push -u origin your-branch-name- Push your branch to remote (see above).
- Go to your GitHub repo → Settings → Branches.
- Under Default branch, click the switch icon and select your branch.
- Confirm the change.
Or rename your current local branch to main and push:
git branch -m main # rename current branch to main
git push -u origin main # push to remote
git push origin --delete old-name # delete the old branch on remote (if needed)Follow the TODO comments in the files to complete the implementation. Start with src/tools/registry.py, then src/observability/, and finally src/agent/observable_agent.py.