This file is the single source of truth for agents in this repo. It tells AI coding agents (and humans!) how this project is structured, how to run it, and how to safely extend it. Inspired by OpenAI’s AGENTS.md format and best practices for the Agents SDK.
- starter_agent — a minimal, general‑purpose assistant with a
now_isotool.
Add new agents under src/agent_template/agents/, each with:
name: descriptive, uniqueinstructions: clear, outcome‑oriented; avoid vague “be helpful” phrasingtools: pick fromsrc/agent_template/toolsor add new- Optional:
handoff_description,guardrailsand per‑agent config
- Default model: configured via env (see
Settings). - Start with your best model to set a quality baseline, then down‑shift to faster/cheaper models where acceptable.
- Track token+latency in CI runs to guard regressions.
Add tools in src/agent_template/tools/:
- Prefer typed Python functions decorated with
@function_tool. - Ensure idempotence where possible and add docstrings—these render as tool descriptions for the model.
- Write unit tests and add examples in docstrings.
- Implement lightweight validators (e.g., Pydantic) and allow‑lists for risky actions.
- Add tripwires for irreversible ops and route to a human‑in‑the‑loop when thresholds are exceeded.
- Keep prompts explicit about boundaries; see
src/agent_template/agents/prompts.py.
- Prefer a single agent with tools first; split to multi‑agent only when prompts or tool selection get unwieldy.
- Use runs with exit conditions (final output tool, no tool calls, max turns).
- Log structured events via
structlog. - (Optional) Add OpenTelemetry exporters and Phoenix / New Relic integration in
src/agent_template/telemetry/.
- Keep a small golden set under
eval/(inputs + expected traits). - Add pytest checks for tool correctness and policy adherence.
- Gate merges on eval pass + lint + type‑check.
# Sync dev env
uv sync --dev
# Run starter agent
uv run agent-starter
# Lint / format
uv run ruff format . && uv run ruff check .
# Type-check
uv run pyright
# Tests
uv run pytest -q- Include before/after behaviors and risk notes.
- Update AGENTS.md and eval/ if tool contracts or prompts change.
- CI must pass: ruff, pyright, pytest, minimal evals.
Copy .env.example to .env and set required keys. The OpenAI Python SDK will read OPENAI_API_KEY.