Agno templates are setup to manage dependencies using a pyproject.toml file, which is used to generate the requirements.txt file using uv or pip-tools.
Adding or Updating a python library is a 2 step process:
- Add library to the
pyproject.toml file
- Auto-Generate the
requirements.txt file
We highly recommend auto-generating the requirements.txt file using this process.
Update pyproject.toml
- Open the
pyproject.toml file
- Add new libraries to the dependencies section.
Generate requirements
After updating the dependencies in the pyproject.toml file, auto-generate the requirements.txt file using a helper script or running pip-compile directly.
./scripts/generate_requirements.sh
pip-compile \
--no-annotate \
--pip-args "--no-cache-dir" \
-o requirements.txt pyproject.toml
If you’d like to upgrade all python libraries to their latest version, run:
./scripts/generate_requirements.sh upgrade
pip-compile \
--upgrade \
--no-annotate \
--pip-args "--no-cache-dir" \
-o requirements.txt pyproject.toml
Rebuild Images
After updating the requirements.txt file, rebuild your images.
Rebuild dev images
ag infra up --env dev --infra docker --type image
ag infra up -e dev -i docker -t image
Rebuild production images
ag infra up --env prd --infra docker --type image
ag infra up -e prd -i docker -t image
Recreate Resources
After rebuilding images, recreate the resources.
Recreate dev containers
ag infra restart --env dev --infra docker --type container
ag infra restart -e dev -i docker -t container
Update ECS services
ag infra patch --env prd --infra aws --name service
ag infra patch prd:aws::service