agentleFS
OpenAIKnown publisheropenai/openai-cookbook/AGENTS.md

openai-cookbook

AGENTS.md76k starsChanged 5 months agoMITView on GitHub

The cookbook is organized around runnable examples and reference articles for OpenAI APIs. Place notebooks and Python scripts under examples/<topic>/, grouping related assets inside topic subfolders (for example, examples/agents_sdk/). Narrative guides and long-form docs live in articles/, and shared diagrams or screenshots belong in images/. Update registry.yaml whenever you add content so it appears on cookbook.openai.com, and add new author metadata in authors.yaml if you want custom attribution. Keep large datasets outside the repo; instead, document how to fetch them…

  • Reads credentials
  • Installs packages

Trending

Quiet since July.about the whole repository

Dec 2025: 3 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 4 mentionsApr 2026: 0 mentionsMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the openai/openai-cookbook repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about openai/openai-cookbook

The biggest 5 of 61 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 61

Talked about on GitHub, Hacker News and Bluesky (61 times).

On GitHub · 27

22 more on GitHub

On Hacker News · 21

16 more on Hacker News

On Bluesky · 13

8 more on Bluesky

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 1 is common, 3 are distinctive, and 0 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a virtual environment to isolate dependencies:

    line 9
  2. Distinctive:

    Verify file, function, and notebook names follow the repo's naming conventions and clearly describe their purpose.

    line 37
  3. Distinctive:

    Check that code identifiers remain descriptive (no leftover placeholder names) and that repeated values are factored into constants when …

    line 39
  4. Common:

    Ensure notebooks or scripts document any required environment variables instead of hard-coding secrets or keys.

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Structure & Module Organization

The cookbook is organized around runnable examples and reference articles for OpenAI APIs. Place notebooks and Python scripts under examples/<topic>/, grouping related assets inside topic subfolders (for example, examples/agents_sdk/). Narrative guides and long-form docs live in articles/, and shared diagrams or screenshots belong in images/. Update registry.yaml whenever you add content so it appears on cookbook.openai.com, and add new author metadata in authors.yaml if you want custom attribution. Keep large datasets outside the repo; instead, document how to fetch them in the notebook.

Build, Test, and Development Commands

Use a virtual environment to isolate dependencies:

  • python -m venv .venv && source .venv/bin/activate
  • pip install -r examples/<topic>/requirements.txt (each sample lists only what it needs)
  • jupyter lab or jupyter notebook to develop interactively
  • python .github/scripts/check_notebooks.py to validate notebook structure before pushing

Coding Style & Naming Conventions

Write Python to PEP 8 with four-space indentation, descriptive variable names, and concise docstrings that explain API usage choices. Name new notebooks with lowercase, dash-or-underscore-separated phrases that match their directory—for example examples/gpt-5/prompt-optimization-cookbook.ipynb. Keep markdown cells focused and prefer numbered steps for multi-part workflows. Store secrets in environment variables such as OPENAI_API_KEY; never hard-code keys inside notebooks.

Testing Guidelines

Execute notebooks top-to-bottom after installing dependencies and clear lingering execution counts before committing. For Python modules or utilities, include self-check cells or lightweight pytest snippets and show how to run them (for example, pytest examples/object_oriented_agentic_approach/tests). When contributions depend on external services, mock responses or gate the cells behind clearly labeled opt-in flags.

Commit & Pull Request Guidelines

Use concise, imperative commit messages that describe the change scope (e.g., "Add agent portfolio collaboration demo"). Every PR should provide a summary, motivation, and self-review, and must tick the registry and authors checklist from .github/pull_request_template.md. Link issues when applicable and attach screenshots or output snippets for UI-heavy content. Confirm CI notebook validation passes locally before requesting review.

Before a pull request is merged, run the repository's docs-editor skill on every changed article, Markdown or MDX file, and notebook Markdown cell. For editorial notebook changes, preserve code cells, outputs, execution counts, attachments, cell order, and metadata. Fix safe issues, rerun the relevant checks, and resolve or explicitly document all remaining P0 and P1 findings in the pull request.

Metadata & Publication Workflow

New or relocated content must have an entry in registry.yaml with an accurate path, date, and tag set so the static site generator includes it. When collaborating, coordinate author slugs in authors.yaml to avoid duplicates, and run python -m yaml lint registry.yaml (or your preferred YAML linter) to catch syntax errors before submitting.

Review Guidelines

These are considered priority 0 issues for this repo, in addition to the normal priority for possible issues.

  • Verify file, function, and notebook names follow the repo's naming conventions and clearly describe their purpose.
  • Scan prose and markdown for typos, broken links, and inconsistent formatting before approving.
  • Check that code identifiers remain descriptive (no leftover placeholder names) and that repeated values are factored into constants when practical.
  • Ensure notebooks or scripts document any required environment variables instead of hard-coding secrets or keys.
  • Confirm metadata files (registry.yaml, authors.yaml) stay in sync with new or relocated content.

Recent Learnings

  • uv run can inherit the wrong virtualenv in this repo -> Clear VIRTUAL_ENV (for example env -u VIRTUAL_ENV uv run ...) when an unrelated environment is active -> Avoids misleading mismatch warnings and makes it clear the repo's .venv is the interpreter actually running the harnesses.
  • Realtime eval shared imports can resolve the wrong module under pytest -> Add shared/__init__.py and ensure tests prepend examples/evals/realtime_evals to sys.path before importing shared.* -> Prevents collection failures caused by unrelated installed packages named shared.
  • Run-level grades can be overweighted by long simulations -> Store turn-level grades on the matching turn and trace-level grades on one row per simulation instead of copying them onto every row -> Keeps results.csv row semantics intact and prevents summary means from favoring longer conversations.
  • Synthetic-audio scaffold requests can pick the wrong harness -> Default unspecified synthetic-audio evals to crawl text-to-TTS and reserve walk for replay-specific audio traits like noise, telephony artifacts, or speaker characteristics -> Keeps new realtime evals on the simplest harness unless audio realism is itself under test.
  • Task-specific single-turn grading can outgrow the shared crawl schema -> Keep the shared crawl harness for realtime execution, then add eval-local wrapper scripts that post-grade domain-specific quality and overwrite results.csv while preserving results_base.csv -> Avoids forking the harness when a use case needs richer grading than tool-call correctness.
  • Synthetic learner audio can sound like eval scaffolding -> Write user_text as a realistic in-app learner request and keep evaluation rules in metadata plus the system prompt -> Produces audio inputs that match the product surface instead of teaching the model the grading rubric through the spoken prompt.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.