ag2

(★ 4,881)

AG2 (formerly AutoGen): The Open-Source AgentOS.Join us at: https://discord.gg/sNGSwQME3x

File Explorer

  • .gitattributes
  • .gitignore
  • .muffet-excluded-links.txt
  • .pre-commit-config.yaml
  • _typos.toml
  • AGENTS.md
  • announcements.md
  • CITATION.cff
  • CONTRIBUTING.md
  • jog.yaml
  • justfile
  • LICENSE
  • MAINTAINERS.md
  • NOTICE.md
  • OAI_CONFIG_LIST_sample
  • pyproject.toml
  • README.md
  • TRANSPARENCY_FAQS.md
  • uv.lock

# Installation Guide

python
Prerequisites

Setup Steps

pip install 'ag2[openai]'

Install the AG2 package with OpenAI support.

export OPENAI_API_KEY="<your-api-key>"

Set the OpenAI API key environment variable.

Key Commands

pip install 'ag2[openai]'

Install the AG2 package including OpenAI provider support.

Install with the appropriate extra option corresponding to your model provider, such as ag2[anthropic], ag2[gemini], or ag2[ollama].

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Release Timeline

Actively Maintained

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

write

View Details ▼

Write data to memory.

write memory

Write current configuration to memory:

write {{username}} {{terminal_id}}

Send a message to a given user on a given terminal ID:

write {{username}} {{terminal_id}}

Send a message to a given user on a given terminal ID:

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

prek

View Details ▼

Create Git hooks that run before commits.

prek install

Install prek into your Git hooks:

prek run

Run prek hooks on all staged files:

prek run {{[-a|--all-files]}}

Run prek hooks on all files, staged or unstaged:

// repository documentation