## Summary Local development and cookbook work need the same dependencies as demos. Both Unix setup scripts now install local editable `agnoctl[dev]` and `agno[demo]`, while keeping `.venv` for daily development and `.venvs/demo` for dedicated demos. - Remove `scripts/cookbook_setup.sh`; use `scripts/dev_setup.sh` for cookbook development. - Enable strict shell error handling, explicitly target the environment's Python, and make clipboard failures non-fatal. - Keep short activation commands relative to the repository root and update contributor and agent instructions. ## Type of change - [x] Bug fix - [ ] New feature - [x] Breaking change - [x] Improvement - [ ] Model update - [ ] Other: --- ## Checklist - [x] Code complies with style guidelines - [x] Ran format/validation scripts (`./scripts/format.sh` and `./scripts/validate.sh`) - [x] Self-review completed - [x] Documentation updated (comments, docstrings) - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable) - [ ] Tested in clean environment - [ ] Tests added/updated (if applicable) ### Duplicate and AI-Generated PR Check - [x] I have searched existing [open pull requests](https://github.com/agno-agi/agno/pulls) and confirmed that no other PR already addresses this issue - [x] If a similar PR exists, I have explained below why this PR is a better approach - [x] Check if this PR was entirely AI-generated (by Copilot, Claude Code, Cursor, etc.) --- ## Additional Notes ### Validation - `bash -n scripts/dev_setup.sh scripts/demo_setup.sh` and `git diff --check`: passed. - Isolated shell smoke checks for both retained setup scripts: passed for successful setup, active-environment rejection, missing `uv`, and installation failure. Successful runs also exercised paths with spaces, failing clipboard commands, and preservation of the other environment. - `uv pip install --dry-run --python .venv/bin/python -e 'libs/agnoctl[dev]' -e 'libs/agno[demo]'`: resolved 235 packages successfully. This was a dependency-resolution check, not a fresh install or a live demo run. - `./scripts/format.sh`: passed. Its unrelated formatting edits were reverted to keep this PR focused. - `./scripts/validate.sh`: failed. The latest run reports 32 mypy errors in 10 unchanged framework files in the current local environment, including SQL adapters, public limits, Google model compatibility, Anthropic, and AWS. The earlier run reported six errors. Other checks passed during the latest run after formatting. Draft pending the repository validation gate. No existing development or demo environment was rebuilt. Windows setup scripts are outside this change. Removing the cookbook script requires callers to switch to `./scripts/dev_setup.sh`; any existing `agnoenv` directory is left untouched. Dev setup now installs the larger demo bundle, including for CI jobs that call it. Related PR #8020 only quotes variables in an older version of `dev_setup.sh`. The current base already quotes those installation and removal paths; this PR addresses dependency parity, separate environment roles, script removal, and setup error handling.
11 KiB
Contributing to agno
Agno is an open-source project and we welcome contributions.
👩💻 How to contribute
Please follow the fork and pull request workflow:
- Fork the repository.
- Create a new branch for your feature.
- Add your feature or improvement.
- Ensure your Pull Request follows our guidelines (see below).
- Send a pull request.
- We appreciate your support & input!
Pull Request Guidelines
To maintain a clear and organized project history, please adhere to the following guidelines when submitting Pull Requests:
- Title Format: Your PR title must start with a type tag enclosed in square brackets, followed by a space and a concise subject.
- Example:
[feat] Add user authentication - Valid types:
[feat],[fix],[cookbook],[test],[refactor],[chore],[style],[revert],[release].
- Example:
- Link to a Ready Issue: Every PR must reference the issue it addresses using keywords like
fixes #<issue_number>,closes #<issue_number>, orresolves #<issue_number>.- Example:
This PR fixes #42 by implementing the new login flow. - Open an issue first and wait for a maintainer to triage it. Only start work once a maintainer has added the
readylabel. - PRs from external contributors that don't link an issue, or whose linked issue is not labeled
ready, are closed automatically, and only a maintainer can reopen them. Once the issue is markedready, comment on the closed PR and a maintainer will review it for reopening. Don't delete or force-push the branch in the meantime, otherwise it can't be reopened.
- Example:
- Use the PR Template: Keep every section of the PR template in your description. PRs missing most of its sections are closed automatically.
- No Duplicate PRs: Before submitting, search the open pull requests to confirm no one else is already working on the same issue. If a similar PR exists, explain in your description why your approach is better.
- Respect Assigned Issues: If a GitHub issue is already assigned to someone, do not open a PR for it without first asking the maintainers in the issue comments and getting confirmation. This helps reduce noise and avoids duplicate effort.
- AI-Generated PRs: If your PR was entirely generated by an AI tool (Copilot, Claude Code, Cursor, etc.), you must disclose this in the PR template. AI-generated PRs are held to the same quality bar as any other contribution — they must include tests, pass CI, and demonstrate that the author has reviewed and understands the changes. Low-effort AI-generated PRs that don't meet these standards will be closed without review.
These guidelines are enforced automatically by our PR Lint workflow.
Development setup
- Clone the repository.
- Check if you have
uvinstalled by runninguv --version.- If you have
uvinstalled, you can skip this step. - If you don't have
uvinstalled, you can install it by runningpip install uv.
- If you have
- Create a virtual environment:
- For Unix, use
./scripts/dev_setup.sh. - For Windows, use
.\scripts\dev_setup.bat. - This setup will:
- Create a
.venvvirtual environment in the current directory. - Install the required packages.
- Install the
agnopackage in editable mode.
- Create a
- For Unix, use
- Activate the virtual environment:
- On Unix:
source .venv/bin/activate - On Windows:
.venv\Scripts\activate
- On Unix:
From here on you have to use
uv pip installto install missing packages
On Unix, dev_setup.sh installs local editable agnoctl[dev] and agno[demo]
into .venv, including development tools and demo dependencies for cookbook work.
Use ./scripts/demo_setup.sh for a separate .venvs/demo environment with the
same dependencies, then activate it with source .venvs/demo/bin/activate.
Both scripts use Python 3.12 and recreate only their target environment on each
run; deactivate any active environment first. Individual cookbooks may require
additional dependencies, credentials, or services.
Formatting and validation
Ensure your code meets our quality standards by running the appropriate formatting and validation script before submitting a pull request:
- For Unix:
./scripts/format.sh./scripts/validate.sh
- For Windows:
.\scripts\format.bat.\scripts\validate.bat
These scripts will perform code formatting with ruff and static type checks with mypy.
Local testing
Before submitting a pull request, ensure all tests pass locally:
-
Do the development setup above.
-
Run the test suite
./scripts/test.sh -
Run specific test files or test cases:
pytest ./libs/agno/tests/unit/utils/test_string.pyor whatever file you want to test.
Make sure all tests pass before submitting your pull request. If you add new features, include appropriate test coverage.
Adding a new Vector Database
- Setup your local environment by following the Development setup.
- Create a new directory under
libs/agno/agno/vectordbfor the new vector database. - Create a Class for your VectorDb that implements the
VectorDbinterface- Your Class will be in the
libs/agno/agno/vectordb/<your_db>/<your_db>.pyfile. - The
VectorDbinterface is defined inlibs/agno/agno/vectordb/base.py - Import your
VectorDbClass inlibs/agno/agno/vectordb/<your_db>/__init__.py. - Checkout the
libs/agno/agno/vectordb/pgvector/pgvectorfile for an example.
- Your Class will be in the
- Add a recipe for using your
VectorDbundercookbook/07_knowledge/09_archive/vector_dbs/<your_db>.- Checkout
cookbook/07_knowledge/09_archive/vector_dbs/pgvector_dbfor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./scripts/validate.sh. - Submit a pull request.
Adding a new Model Provider
- Setup your local environment by following the Development setup.
- Create a new directory under
libs/agno/agno/modelsfor the new Model provider. - If the Model provider supports the OpenAI API spec:
- Create a Class for your LLM provider that inherits the
OpenAILikeClass fromlibs/agno/agno/models/openai/like.py. - Your Class will be in the
libs/agno/agno/models/<your_model>/<your_model>.pyfile. - Import your Class in the
libs/agno/agno/models/<your_model>/__init__.pyfile. - Checkout the
agno/models/together/together.pyfile for an example.
- Create a Class for your LLM provider that inherits the
- If the Model provider does not support the OpenAI API spec:
- Reach out to us on Discord or open an issue to discuss the best way to integrate your LLM provider.
- Checkout
agno/models/anthropic/claude.pyoragno/models/cohere/chat.pyfor inspiration.
- Register your model provider in
libs/agno/agno/models/utils.py:- Add exactly one row to the
_PROVIDERStable, keyed by a stable provider key, with the value(module, class_name, default_name, default_provider).default_nameanddefault_providerare your class's defaultnameand (lowercased)providerattributes. This single table is the source of truth: the construction registry (MODEL_PROVIDER_CLASSES) and the(provider, name)resolution indices are all derived from it, so you do not edit any other map. Use a lowercase, hyphenated key, typically matching your module directory (e.g."meta"formodels/meta/,"openai-chat"for the chat variant)."yourprovider": ("agno.models.yourprovider", "YourModel", "YourModel", "yourprovider"), - This covers both the string format (
model="yourprovider:model-name") and rebuilding a model saved to the database. If your class shares a displayproviderstring with another class (e.g. an OpenAI-compatible provider reporting"openai"), the serializednameyou list is what tells them apart; if its display string differs from the key (e.g."inceptionlabs"vs key"inception"), the alias is derived automatically. Only the default key for an ambiguous display string (e.g."azure"-> AzureOpenAI) lives in_AMBIGUOUS_PROVIDER_DEFAULTS. - CI enforces registration:
test_every_model_subclass_is_registeredstatically discovers every concreteModelsubclass and fails if one is missing. If your class is an abstract base rather than a user-selectable provider, add it to that test's allowlist instead.
- Add exactly one row to the
- Add a recipe for using your Model provider under
cookbook/90_models/<your_model>.- Checkout
agno/cookbook/90_models/aws/claudefor an example. - Show both the model class and string syntax in your examples
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./scripts/validate.sh. - Submit a pull request.
Adding a new Tool.
- Setup your local environment by following the Development setup.
- Create a new directory under
libs/agno/agno/toolsfor the new Tool. - Create a Class for your Tool that inherits the
ToolkitClass fromlibs/agno/agno/tools/toolkit.py.- Your Class will be in
libs/agno/agno/tools/<your_tool>.py. - Make sure to register all functions in your class via a flag.
- Checkout the
agno/tools/youtube.pyfile for an example. - If your tool requires an API key, checkout the
agno/tools/serpapi.pyas well.
- Your Class will be in
- Add a recipe for using your Tool under
cookbook/91_tools/<your_tool>.- Checkout
agno/cookbook/91_tools/youtube_tools.pyfor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./scripts/validate.sh. - Submit a pull request.
Message us on Discord if you have any questions or need help with credits.
📚 Resources
📝 License
This project is licensed under the terms of the Apache-2.0 license