mirror of
https://github.com/agno-agi/agno.git
synced 2026-10-12 02:10:54 +00:00
main
15
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c15c55ea7d |
chore: align dev and demo setup environments (#10920)
## 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. |
||
|
|
5baeb410d6 |
feat: v2.7 — service accounts, MCP interface v2, agnoctl, and eval suites (#8747)
## Summary The v2.7 release branch: **one backend for every frontend**. A running AgentOS becomes operable by any MCP client with one command: ```bash uvx agno connect # at 2.7 stable; during the alpha: uvx agnoctl connect ``` The branch is released continuously as alphas — **agno `2.7.0a1`–`2.7.0a5`** and **agnoctl `0.1.0a1`–`0.1.0a5`** (versions in lockstep) via OIDC trusted publishing. This PR consolidates and supersedes #8742 (service accounts + MCP interface v2) and #8743 (agnoctl), and cherry-picks #8745 (@kausmeows). Larger increments landed on the branch through individually reviewed PRs, each with its full write-up: #8752 and #8760 (security hardening), #8755 (MCP trace attribution), #8759 (pyproject extras), #8761 (eval suite runner), #8740 (community cookbook), #8770 (agnoctl templates + chat-app connect, RBAC-shaped token payloads, ultra-review fixes), #8777 (service-account `user_id` ownership column). ## What's in v2.7 ### 1. Service accounts (PAT auth) Machine identities authenticated by opaque `agno_pat_...` tokens (GitHub PAT model): SHA-256-only storage, `sa:<name>` principals, conservative default scopes (run + read + `config:read`), 90-day default expiry, `POST/GET/DELETE /service-accounts`, TTL'd verification cache with instant local revocation, uniform-401/fail-closed/throttled verification. - PAT scopes are first-party ACL data, enforced in **every** deployment mode — including `os_security_key` mode, on `/mcp` tools, and on WebSockets. - `sa:` principals are **self-scoped**: a PAT reads and writes only the data it created, regardless of `user_isolation`; cross-user access requires an explicitly minted `agent_os:admin` token (#8760 D1). On-behalf-of writes are coerced to the `sa:<name>` principal. - Minting requires a real credential (`OS_SECURITY_KEY` or JWT) — anonymous mint on an open instance returns 401, so no durable credential can be created before an operator enables auth (#8752 S4). - Scope payloads follow the RBAC governance shape (#8770): responses return parsed scope objects (`{raw, namespace, sub_namespace, permission, value}`), create requests take `{scope, effect}` objects only (bare strings and `effect="deny"` are 422s). Storage keeps raw strings; only the API payload shape changed, so the UI builds one scopes integration ahead of Governance. - `user_id` ownership column (#8777), stamped at mint from the authenticated principal — `user_id` = ownership (what 3.0 user isolation will key on), `created_by` = audit, `NULL` = workspace-level machine account. Schema-only for now; added pre-GA because the adapters fail closed on missing columns, so post-GA it would have cost every deployment a migration. ### 2. MCP interface v2 The 19-tool REST-mirror surface becomes an **8-tool operator surface**: `get_agentos_config`, `run_agent`, `run_team`, `run_workflow`, `continue_run`, `cancel_run`, `get_sessions`, `get_session_runs`. - Run results are **trimmed by default**; `result_mode="full"` and `get_session_runs(run_id=...)` restore full detail (transcript, events, metrics). Progress notifications during runs; HITL pause → `continue_run`/`cancel_run` lifecycle, with the admin-approval continuation gate shared with REST (`run_continuation_blocked_reason`). - One implementation for REST and MCP via the shared `agno/os/services/` layer; every tool call is scope-gated by mapping it onto its REST-equivalent route, so per-resource scopes and admin bypass behave identically on both surfaces. - **Request isolation matching REST**: components resolve through the shared `resolve_*` helpers with a `create_fresh` deep copy (no shared-singleton state across concurrent runs), DB-registry components resolve and enumerate, the config roster is filtered to the caller's accessible resources, and a fresh session is minted per call when `session_id` is omitted (no cross-request history leaks). - MCP-initiated runs are correctly attributed in traces: the run span starts its own root trace instead of nesting under FastMCP's identity-less protocol span (#8755). - Ultra-review fixes (#8770): trimmed session history keeps `workflow_id` on workflow runs, and `continue_run`/`cancel_run` fail closed with a clean message (instead of an `AttributeError`) for scoped callers on remote components — a real remote ownership contract is SDK-543. ### 3. agnoctl — the Agno CLI New distribution at `libs/agnoctl` (PyPI `agnoctl`, command `agno` + alias `agnoctl`), zero dependency on the `agno` framework. Core `agno` declares `[project.scripts] agno = "agnoctl.main:app"` plus a dependency on agnoctl, which is what makes `uvx agno connect` work at stable. - **`agno connect`**: discover the AgentOS (ports 7777/7778/7779/8000, or `--url`/`AGENTOS_URL`) → mint per-client PATs → write client configs → verify with a real MCP handshake. Clients: Claude Code, Codex, Cursor, **Claude Desktop** (stdio→remote bridge via `mcp-remote`; token rides an env var, not argv), and the chat apps **Claude** (`claude-ai`) and **ChatGPT** — instructions-only with a distinct non-failing `manual` status, since connectors are added in the app's own UI with OAuth, not bearer tokens (#8770). - **Deployed-OS awareness** (#8770): when the discovered AgentOS is on a public HTTPS URL without a token gate, connect auto-appends the Claude/ChatGPT connector setup steps after the coding-agent results (the templates' deploy scripts set `AGENTOS_URL`, so this is the default experience on a deploy box); reachability is judged on the parsed hostname (loopback/RFC1918/link-local are out), an explicit `--clients` still scopes the run exactly, and the connect header + `--json` report where the target URL came from (`url_source`: flag/env/default). - **Credential guardrails**: refuses to send a bearer credential over plaintext HTTP to a non-loopback host (`--allow-http` to opt in), atomic 0600-from-birth config writes, the PAT never appears on any process argv, rotated tokens print a restart reminder for the affected client. - `agno tokens create/list/revoke` (revoke confirms interactively), `agno create` (scaffolds from the `agentos-<provider>` template repos — all five: docker/aws/fly/gcp/railway, #8770), `agno up/down/restart` (compose), `agno status`. `--json` everywhere, deterministic exit codes, truthful outcomes, branded home screen. ### 4. One auth layer AgentOS installs a single `AuthMiddleware` on the parent app whenever any credential source is configured (JWT, `OS_SECURITY_KEY`, or a service-account verifier). Starlette runs parent-app middleware before dispatching to mounts, so that one instance covers REST, the mounted `/mcp` app, WebSockets, and every interface that does not authenticate its own requests — the mounted MCP app carries no auth code of its own. - `JWTMiddleware` is now an alias of `AuthMiddleware` (JWT is one credential source among three). It refuses to construct with no credential source, and `authorization=True` with no JWT verification source **fails closed at construction** instead of silently serving an open instance. - Interfaces that verify their own webhook signatures (Slack, Telegram, WhatsApp) declare `authenticates_own_requests = True` and are excluded; everything else — including A2A and AGUI — sits behind the auth layer (#8752 S1). - The WebSocket path has full parity: PATs prefix-dispatch before JWT handling, verified identity + scopes attach to the connection context, and the RBAC/attribution gates fire exactly as on REST. ### 5. Security hardening The auth surface went through six review rounds (in-branch adversarial review, an independent external review by Codex + Opus, #8752, a PAT/JWT hardening pass, #8760, and a multi-agent ultra review of this PR whose two verified findings are fixed in #8770). Highlights beyond the items above: - **A2A/AGUI authorization + identity** (#8760 B1/B2): interfaces now declare their own RBAC scope mappings (`Interface.get_scope_mappings()`, merged against the actual mount prefix), closing a read→execute escalation where a `config:read` token could run agents via `message:send`. All A2A/AGUI run sites resolve identity server-side through a shared `resolve_run_user_id()` — client-supplied `X-User-ID`/`metadata.userId`/`forwardedProps.user_id` is honored only for anonymous callers and never for reserved principals, closing run/session/memory attribution spoofing and a session IDOR. A regression test asserts every mounted `/a2a` route resolves to a non-empty required-scope set. - **Trace IDOR fixed** (#8752 S2, pre-dates this branch): `GET /traces/{trace_id}` now enforces `user_isolation` ownership, including the `run_id`/`span_id` paths and the RemoteDb branch. - **JWTs cannot impersonate reserved principals**: tokens whose subject claims `sa:*` or `__scheduler__` are rejected on HTTP and WebSocket. - `validate=False` + `authorization=True` no longer fails open on undecodable tokens (#8752 S3, pre-dates this branch); resource-type classification is anchored to the first path segment; the internal scheduler token keeps its strict scope check. ### 6. Eval suite runner (#8761) `agno.eval` gains a suite layer: a frozen `Case` (one input to one agent + optional judge/reliability checks), a sequential single-event-loop runner (`run_cases`/`arun_cases`) that does zero console I/O and returns a `SuiteResult` whose `to_dict()` is a stable CI/JSON contract, and an argparse `cli()`/`acli()` built purely on the runner's hooks. Replaces the ~430-line runner previously copy-pasted per template. Also: `show_spinner` flag on the four existing eval classes, and sync-DB eval logging moved off the event loop. ### 7. Packaging, toolchain, and release engineering - **Core deps 14 → 10**: dropped `gitpython`, `python-dotenv`, `typer` (zero imports in `libs/agno`); `python-multipart` moved into the extras that serve FastAPI routes; `fastapi[standard]` unbundled into `fastapi` + `python-multipart` + `uvicorn` + `websockets` — `agno[os]` no longer drags `sentry-sdk`/`fastapi-cloud-cli`. `fastmcp` folded into `agno[mcp]` so AgentOS can serve `/mcp` without a separate install (a3). - **Extras tidy** (#8759): alphabetized groups, aggregate gaps closed, underscore→hyphen key normalization (free PEP 503 aliases), and a real fix — `agno[embedders]` was unresolvable (dangling `agno[vllm]` reference). Verified by diffing the resolved closure of all 129 extras: zero removals. - **Python floor raised to 3.9** for both packages (agno's old `>=3.7` was already unsatisfiable via its own pydantic pin — honest metadata, not a support cut). - **release.yml**: OIDC trusted publishing (no long-lived API tokens), per-package "already on PyPI?" gates, explicit job permissions, concurrency guard, agno `needs` agnoctl. - **`format.sh` / `validate.sh` are real gates**: honest non-zero exit codes, per-target sections; mypy on `libs/agno` is clean for the first time (0 errors in 903 files) with the toolchain pinned at latest (mypy 2.1.0, ruff 0.15.20, pytest 9.1.1). `dev_setup.sh`/`demo_setup.sh` rebuilt on one pattern (fresh 3.12 venv, workspace agnoctl editable next to `agno[dev]`/`agno[demo]`); `agno[dev]` now collects and passes the entire first-party unit tree (4,767 tests) in a fresh venv; `agno_infra` is out of the core dev flow. ### 8. Cookbooks Service accounts (`cookbook/05_agent_os/middleware/`), MCP demo updates (`cookbook/05_agent_os/mcp_demo/`), eval suites (`cookbook/09_evals/suite/`), and a community BGPT MCP example (#8740, `cookbook/91_tools/mcp/bgpt.py`). ## Breaking changes (vs 2.6) Intentional and documented in the design docs: 1. **MCP surface 19 → 8 tools.** Memory/session-write tools removed; `MCPServerConfig(include_tags={"memory"})` fails validation loudly. Run results trimmed by default (`result_mode="full"` restores the old payload). 2. **`authorization=True` now protects `/a2a/*` and `/agui`** — authentication, per-route RBAC scopes, and server-side identity. Deployments that ran A2A/AGUI with auth enabled and relied on those routes being open now need credentials. Custom `BaseInterface` subclasses that verify their own inbound webhooks must set `authenticates_own_requests = True` (default is fail-closed). 3. **A2A `tasks:get` and `tasks:cancel` require `contextId`** (400 instead of a deep 500; the a2a-sdk returns it in every `message:send` response). Client-supplied user ids on A2A/AGUI are honored only for anonymous callers. 4. **Packaging**: code relying on agno transitively installing `gitpython`/`typer`/`python-dotenv`, or on `fastapi[standard]`'s bundled extras, must declare those deps itself. `requires-python >= 3.9`. Alpha-tester notes (a1–a3 → a4): rotate PATs minted before `config:read` joined the default scopes (`agno connect --rotate`); `AGNO_OS_URL` is now `AGENTOS_URL` (renamed after 0.1.0a1). (a4 → a5): an existing `agno_service_accounts` table trips the fail-closed schema check after the `user_id` column — drop the table and re-mint (`agno connect --rotate`); the service-accounts API now returns scope objects and rejects bare-string scopes on create (422). ## Review map | Area | Where | |------|-------| | Service accounts | `agno/os/routers/service_accounts/`, `agno/os/service_accounts.py`, `service_accounts` table in `agno/db/*` | | Auth layer, scopes, identity | `agno/os/middleware/`, `agno/os/auth.py`, `agno/os/scopes.py` | | MCP interface | `agno/os/mcp.py`, `agno/os/mcp_results.py`, `agno/os/services/` | | Interface RBAC (A2A/AGUI) | `agno/os/interfaces/base.py`, `agno/os/interfaces/a2a/`, `agno/os/interfaces/agui/` | | CLI | `libs/agnoctl/` | | Eval suites | `agno/eval/`, `cookbook/09_evals/suite/` | | Packaging & release | `libs/agno/pyproject.toml`, `libs/agnoctl/pyproject.toml`, `.github/workflows/release.yml`, `scripts/` | The merged sub-PRs (#8752, #8755, #8759, #8760, #8761, #8770, #8777) each carry a full standalone write-up, including per-finding provenance (what pre-dates this branch vs what v2.7 introduced) and test evidence. ## Type of change - [x] New feature - [x] Bug fix - [x] Breaking change --- ## Checklist - [x] Code complies with style guidelines - [x] Ran format/validation scripts — `./scripts/format.sh` and `./scripts/validate.sh` are now hard gates and pass clean (mypy: 0 errors, 903 files) - [x] Self-review completed — six review rounds over the auth surface (in-branch adversarial, external Codex + Opus, #8752, PAT/JWT pass, #8760, multi-agent ultra review); the ultra review's two verified findings are fixed in #8770 - [x] Documentation updated (comments, docstrings, `libs/agnoctl/README.md`, design docs in the private specs repo) - [x] Examples and guides: service-accounts, MCP demo, and eval-suite cookbooks - [x] Tested in clean environment — fresh-venv dev setup passes the full first-party unit tree; `agno[os]` closure and multipart upload verified in a clean venv; auth matrix validated over real uvicorn; MCP fixes reproduced against a live FastMCP server - [x] Tests added/updated — os suite (unit + integration) + eval unit: **2,298 passed** (the two former known failures — a stale JWKS-precedence test and a numpy-dependent serialization test — are repaired on the branch); agnoctl: **153 passed**, now also run in CI ### Duplicate and AI-Generated PR Check - [x] I have searched existing [open pull requests](../../pulls) — #8742 and #8743 are consolidated here and closed; #8745 is cherry-picked; #8752/#8755/#8759/#8760/#8761/#8740/#8770/#8777 merged into this branch - [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.) — built with Claude Code, human-directed --- ## Additional Notes **Release status** - agno `2.7.0a1`–`a5` + agnoctl `0.1.0a1`–`a5` are live on PyPI (OIDC trusted publishing; the old agnoctl `0.1.0rc*` pre-releases were removed, so resolvers prefer the alphas). - During the alpha the working commands are `uvx agnoctl connect` and `uvx "agno==2.7.0a5" connect`; bare `uvx agno connect` unlocks at 2.7 stable. **CI status** - **`test.yml` (the PR gate) is green.** agnoctl now has its own CI job (ruff + mypy + its 153-test suite — the package previously published four alphas with zero CI); the style checks and `test_setup.sh` install the workspace agnoctl editable, so a version bump can no longer race the PyPI publish and redden checks. - **Root causes fixed on the branch**: `agno[tests]` had become unresolvable via #8759's aggregate additions (`infinity_client` pins `httpx<0.28.0` against a2a-sdk's `>=0.28.1` floor; `brave-search` 0.2.0 ships metadata uv cannot parse) — both are excluded from the aggregates again, in the litellm/mistral style. `test_setup.sh` was rebuilt to fail fast (a failed install previously surfaced as 194 collection errors), and `requirements.txt` is regenerated from the trimmed core (closes the tracked follow-up). - **The "Main Validation" model matrix runs per-push on this branch and is green on the code side** (all 22 code-side jobs; the remaining reds are environmental — test-deepinfra is a provider-account issue being fixed account-side, and the live-external-API tests flake on the third-party services they call). Getting there took fixing every failure class it surfaced: two real product bugs (DalleTools sent the removed `style` parameter — every image generation 400'd; fastmcp 3.4.3's new Host/Origin guard would have 421'd every deployed `/mcp` host), stale tests (retired `gemini-2.0-flash` pins, multi-db MCP calls without `db_id`, an empty-keys JWKS file, a GC-timing-dependent coroutine-leak assert), harness rot (system-test containers now install `agno[os]` instead of a hand-copied dep list; the health gate covers all five services; the dev-setup job verifies agnoctl, not the deliberately-dropped agno-infra), and structural flake handling — the repo's `@pytest.mark.flaky` convention was a silent no-op (the plugin was never a dependency; two conflicting mark dialects existed), now standardized on pytest-rerunfailures with a workflow-level `--reruns 1` blanket retry for live-model jobs, pytest-timeout bounding the Gemini concurrency suite (a TLS wedge previously hung the job for hours), and provider-availability failures (billing/quota/brownouts) skipping with named reasons instead of failing. - Known-and-documented: the google-genai shared-client TLS corruption is `xfail(strict=False)` on eight stress tests; the adapter-level fix (thread-local sync client, per-loop async client) is queued as its own change. **Remaining before stable** (tracked, deliberately not in this PR) - Port the Windows setup scripts (`dev_setup.bat`/`.ps1`, `demo_setup.bat`/`.ps1`) to the rebuilt flow. - Fix the chronic model-matrix failures on `main` (Gemini SSL/structured-output, DeepInfra tool-use, live-external-API tests) so Main Validation can gate again. - Drop agno-infra's `agno` console script (deferred to stable; co-installed pip envs have last-install-wins on `bin/agno` during the alpha — uvx is unaffected). - `create_fresh=True` as the default resolution mode is a v3.0 change (SDK-534). **Known, documented limitations**: WS workflow `reconnect` under `user_isolation=False` replays buffered events to any connection (the documented single-tenant contract of that mode); `authorization=True` also gates the A2A agent card, with no anonymous-discovery escape hatch yet; per-resource scopes on a custom-prefix A2A mount degrade to the global run scope (fail-closed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: kausmeows <[email protected]> Co-authored-by: Monalisha Mishra <[email protected]> Co-authored-by: Monalisha Mishra <[email protected]> Co-authored-by: Harsh <[email protected]> Co-authored-by: Yash Pratap Solanky <[email protected]> |
||
|
|
bce27a9ef0 |
chore: release 2.3.3 (#5524)
# Changelog ## New Feature: - **Context Compression**: Introducing compression of tool call results in a running context. Context Compression allows you to manage your agent context while it is running, helping the agent stay within its context window and avoid rate limits or decreases in response quality. This is still a **beta** feature. See the [docs](https://docs.agno.com/basics/context-compression/overview) - **Memory Optimisation:** Added the ability to summarize a user’s memories. This adds `optimize_memories` and `aoptimize_memories` to the `MemoryManager` as a way to summarize memories outside of agent runs. Only one strategy is currently supported, but this will be extended in future. Thie is still a **beta** feature. See the [docs](https://docs.agno.com/basics/memory/working-with-memories/memory-optimization). - **Gemini File Search Support**: Added support for [Gemini File Search](https://blog.google/technology/developers/file-search-gemini-api/). - File Search Store Management: Create, list, get, and delete document stores - File Upload & Import: Direct upload with custom chunking configuration and metadata - Document Management: List, get, delete, and update documents with metadata filtering - Citation Extraction: Helper methods to extract and format source citations from responses - Async Support: Full async/await support for production workloads - Docs coming soon! In the mean time check out these cookbooks: - `cookbook/models/google/gemini/file_search_basic.py` - `cookbook/models/google/gemini/file_search_advanced.py` - `cookbook/models/google/gemini/file_search_rag_pipeline.py` ## Improvements: - **`output_schema` on run/arun**: override `output_schema` at runtime via the `run()` and `arun()` methods for both `Agent` and `Team`, as well as AgentOS API endpoints. - **API Key for AWS Bedrock**: Added `api_key` support for AWS Bedrock. See the [documentation](https://docs.agno.com/integrations/models/cloud/aws-claude/overview). - **AWS Bedrock Claude**: It is now more compatible with native Claude, which adds support for thinking models and caching. - **VertexAI Claude**: It is now more compatible with native Claude, which adds support for thinking models and caching. - **Gemini 3 Thinking Level**: Added support for `thinking_level` on `Gemini` ## Bug Fixes: - **Async Knowledge Retriever:** Fixed a bug where async knowledge retrieving would break due to missing async versions of `get_user_message` functions on Agent and Team - **Team Member Events**: Ensure that member events are streamed if `stream_member_events=True` but `stream_events=False` on `Team`. - **MigrationManager Improvements:** Fixed an issue preventing migrations from being applied for versions older than 2.3.0. Also adds support for a force migration flag - **StopAgentRun**: Fixed the `StopAgentRun` exception from not correctly ending the agent run. - **PDF Image Reader:** Fixed PDF Image Reader generating ID’s based on filename instead of using UUID. - **MCP `tool_name_prefix`:** Made the `tool_name_prefix` parameter `None` by default to prevent it from adding `_` by default as a prefix. - **AGUI:** - Duplicate value for `tool_call_id` fixed - Missing assistant messages for tool calls fixed --------- Co-authored-by: Dirk Brand <[email protected]> Co-authored-by: Mustafa Esoofally <[email protected]> |
||
|
|
255869358b |
feat: add google gemini file search support. (#5381)
## Summary Adds complete integration for Google Gemini's File Search Tool. Docs: - https://blog.google/technology/developers/file-search-gemini-api/ - https://ai.google.dev/gemini-api/docs/file-search fixes: #5365 Key Changes: `libs/agno/agno/models/google/gemini.py` - File Search Store Management: Create, list, get, and delete document stores - File Upload & Import: Direct upload with custom chunking configuration and metadata - Document Management: List, get, delete, and update documents with metadata filtering - Citation Extraction: Helper methods to extract and format source citations from responses - Async Support: Full async/await support for production workloads (If applicable, issue number: #\_\_\_\_) ## Type of change - [ ] Bug fix - [x] New feature - [ ] Breaking change - [ ] Improvement - [ ] Model update - [ ] Other: --- ## Checklist - [ ] Code complies with style guidelines - [ ] Ran format/validation scripts (`./scripts/format.sh` and `./scripts/validate.sh`) - [ ] Self-review completed - [ ] 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) --- ## Additional Notes Add any important context (deployment instructions, screenshots, security considerations, etc.) --------- Co-authored-by: manu <[email protected]> Co-authored-by: Dirk Brand <[email protected]> Co-authored-by: Dirk Brand <[email protected]> |
||
|
|
c164576b0e |
chore: Release 2.2.0 (#5146)
# Changelog ## New Features: - **Filter tool calls from History**: Add ability to load fixed number of tool calls from history using `max_tool_calls_from_history`. Helps manage context size and reduce tokens. ## Improvements: - **Update** **workflows arun to return AsyncIterator:** The ****`.arun` method of Workflow now returns an async iterator, similar to Agent and Team. [Example](https://docs.agno.com/examples/concepts/workflows/01-basic-workflows/async_events_streaming)in our docs. - **New Events on Agent/Team**: - `PostHookStarted`, `PostHookCompleted` for both `Agent` and `Team` events - `SessionSummaryCreationStarted`, `SessionSummaryCreationCompleted` for both `Agent` and `Team` events - `RunContentCompleted` for both `Agent` and `Team` → This signals that the content stream has ended, which is useful for building UIs using the events - **Concurrent Memory Creation**: Automatic memory creation is now started on a thread/task at the start of an Agent/Team run, which significantly improves runtime performance where memory generation is enabled. - **Get Run Output on Members**: Improved `get_run_output` and `get_last_run_output` on `Agent`/`Team` to allow retrieval of runs from members. Therefore after a team has executed you can get the last run straight from the member agent. - **Team History Updates:** - Adds `add_team_history_to_members` to share team-level request/response history with team members. - Improved how `share_member_interactions` work to make sharing interactions during a run more accurate. - Here are the related [docs](https://docs.agno.com/concepts/teams/chat_history) - **`stream_events` flag**: Add a `stream_events` flag to Agent, Team, Workflow and all run methods to emit all events whens streaming a response. - **Session State Updating**: Added `update_session_state` and `aupdate_session_state` functions on `Agent` and `Team` to allow direct updating of the session state that is persisted in the DB. - **AgentOS Session Endpoints:** Added new endpoints: - `POST /sessions` → Create a new empty session ([reference](https://docs.agno.com/reference-api/schema/sessions/create-new-session)) - `GET /sessions/{id}/runs/{id}` → Get a run by its ID ([reference](https://docs.agno.com/reference-api/schema/sessions/get-run-by-id)) - `PATCH /sessions/{id}` → Update existing session ([reference](https://docs.agno.com/reference-api/schema/sessions/update-session)) ## Bug Fixes: - **`None` values in Ollama metrics**: Fix a problem calculating metrics with Ollama when certain values were `None` instead of `0`. - **Only-media inputs**: The Memory and Summary features now work with inputs containing only media - **Input media with Teams:** Fix a problem with input media being ignored when streaming a Team’s response. ## Breaking Changes and Deprecations - `Workflow.arun(..., stream=True)` now return an `AsyncIterator`, i.e. which means `await` is not required, but instead `async for event in workflow.arun(...)` is the correct syntax. - All events besides `RunContent` events (the actual model content chunks) are now behind the `stream_events` flag and will only be yielded where `stream_events=True` . Previously tool-call events were yielded regardless. - Removed `expected_output` as a default parameter on the `delegate_task_to_member` tool call for `Team`. This is done to increase flexibility with teams and to avoid incorrect behaviour on the team leader. - `stream_intermediate_steps` has been deprecated in favour of `stream_events` |
||
|
|
5e40a2d10b |
chore: Release 2.1.0 (#4856)
# Changelog ## New Features: - **AgentOS Custom Middleware:** Allow setting of any custom FastAPI-compatible middleware on the AgentOS. See the [docs](https://docs.agno.com/agent-os/customize/middleware/overview). - **AgentOS JWT Middleware:** We have a built-in JWT Middleware that can validate tokens, extract claims to pass into AgentOS endpoints, and more. See the [docs](https://docs.agno.com/agent-os/customize/middleware/jwt). - **Pre/Post Hooks:** Configure a custom hook that runs at the start or end of an agent/team run. This is useful for input/output validation, or transforming the input/output of the agent. See the [docs](https://docs.agno.com/concepts/agents/pre-hooks-and-post-hooks). - **Guardrails**: Guardrails are specific built-in pre-hooks that you can configure. See the docs. We have added support for: - Prompt Injection checks ([docs](https://docs.agno.com/concepts/agents/guardrails/prompt-injection)) - PII detections (SSN, credit cards, phone numbers, emails) ([docs](https://docs.agno.com/concepts/agents/guardrails/pii)) - [OpenAI Moderation](https://platform.openai.com/docs/guides/moderation?example=images) ([docs](https://docs.agno.com/concepts/agents/guardrails/openai-moderation)) - You can create your own custom guardrails ([docs](https://docs.agno.com/concepts/agents/guardrails/overview)) - **Requesty LLM Gateway:** Added support for [Requesty](https://www.requesty.ai), an affordable LLM gateway with advanced governance. ## Improvements: - **AgentOS Updates for Clarity**: - None of the below deprecated parameters have been removed, only new attributes added. It will likely be removed in v2.3.0 and after. - Deprecated `fastapi_app` and added `base_app` → For configuring a custom FastAPI app for the AgentOS. - Deprecated `replace_routes` and added `on_route_conflict` → For how to handle conflicting routes when you set `base_app`. - Deprecated `enable_mcp` and added `enable_mcp_server` → For converting the AgentOS into an MCP server. - Deprecated `os_id` and added `id` → The ID of the OS. - **Async Tool Execution In Streaming**: For tools that are AsyncGenerators (i.e. they are `async` and `yield` content or events), they are now executed in parallel. - **Team Async Member Execution:** Because of the above update, member execution during async team execution with streaming (i.e. `Team.arun(..., stream=True)`) is now also concurrent. - Note: This means member events are received concurrently and the order is not guaranteed. If you previously depended on the order of events of team members, take note of this. - **Whatsapp Interface Sessions:** The user’s unique phone number is now used as the session ID by default. This would enable session history for Whatsapp conversations. - **Update Workflows to not swallow exceptions:** workflows now raise exceptions where necessary so that they can be correctly caught in the front end. - **Batch Embeddings:** Support for batch embeddings to speed up embedding process and reduce API calls to embeddings providers. See the docs. - Removed unused `use_batch` parameter from PGVectorDB class ## Bug Fixes: - **Team History in Context**: Fixed issues where team history was not correctly added to team context. - **Gemini Metrics Calculation Fix For Gemini 2.5 Models:** Fixed a bug where thought tokens count were added later to output tokens before total token calculation - **Fix for workflow async pipeline to correctly accept file input:** Updated the Workflow class to include a parameter `files` in the async pipeline input creation, enhancing the flexibility of input handling. - **`InMemoryDb` mutable references**: Fixes a bug where some DB methods unexpectedly returned shared object references. - **Fix `tool_choice` bug on Gemini**: Agno now convert `tool_choice` values for `none` and `auto` correctly to what Gemini expects. - **Fix for a bug on Agent OS when output schema includes a non serializable type:** - in [**fix: agentos datetime serialization #4783**](https://github.com/agno-agi/agno/pull/4783) it was fixed but the `to_json` method was being overridden in the `BaseWorkflowRunOutputEvent` class which is not really required. --------- Co-authored-by: Kaustubh <[email protected]> Co-authored-by: manuhortet <[email protected]> |
||
|
+7 |
9342086712 |
feat: V2.0.0 (#4226)
Changelog TBD --------- Co-authored-by: Willem Carel de Jongh <[email protected]> Co-authored-by: Nancy Chauhan <[email protected]> Co-authored-by: manu <[email protected]> Co-authored-by: Mustafa Esoofally <[email protected]> Co-authored-by: Kaustubh <[email protected]> Co-authored-by: ysolanky <[email protected]> Co-authored-by: Harshith VH <[email protected]> Co-authored-by: Ayush <[email protected]> Co-authored-by: Monalisha Mishra <[email protected]> Co-authored-by: Yash Pratap Solanky <[email protected]> Co-authored-by: Ashpreet <[email protected]> Co-authored-by: yarin-tradezbird <[email protected]> Co-authored-by: yarinbass <[email protected]> Co-authored-by: Anurag <[email protected]> Co-authored-by: Adi Berkowitz <[email protected]> Co-authored-by: Adi Berkowitz <[email protected]> |
||
|
|
b746ccf9cf |
[chore] firecrawl dependency upgrade (#4369)
## Summary - Firecrawl dependency upgrade ## Type of change - [ ] Bug fix - [ ] New feature - [ ] 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 - [ ] Documentation updated (comments, docstrings) - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable) - [x] Tested in clean environment - [ ] Tests added/updated (if applicable) --- ## Additional Notes Add any important context (deployment instructions, screenshots, security considerations, etc.) --------- Co-authored-by: Yash Pratap Solanky <[email protected]> |
||
|
|
43b9bbcf4d |
fix: transcript function from YouTube API (#4280)
## Summary - Replaced the deprecated `get_transcript()` with `fetch()` method fixes: #4273 ## Type of change - [x] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Improvement - [ ] Model update - [ ] Other: --- ## Checklist - [ ] Code complies with style guidelines - [ ] Ran format/validation scripts (`./scripts/format.sh` and `./scripts/validate.sh`) - [ ] Self-review completed - [ ] 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) --- ## Additional Notes Add any important context (deployment instructions, screenshots, security considerations, etc.) --------- Co-authored-by: Dirk Brand <[email protected]> |
||
|
|
1a11436aa9 |
chore: Release 1.5.9 (#3478)
# Changelog
## New Features:
- **AG-UI App**: Expose your Agno Agents and Teams with an AG-UI
compatible FastAPI APP.
- **vLLM Support**: Added support for running vLLM models via Agno.
- **Serper Toolkit:** Added `SerperTools` toolkit to search Google
- **LangDB Support**: Added LangDB AI Gateway support into Agno.
- **LightRAG server support:** Added LightRAG support which provides a
fast, graph-based RAG system that enhances document retrieval and
knowledge querying capabilities.
- **Parser Model:** Added ability to use an external model to apply a
structured output to a model response
- **Pdf Bytes Knowledge: I**ntroduced a new knowledge base class:
`PDFBytesKnowledgeBase`, which allows the ingestion of in-memory PDF
content via bytes or IO streams instead of file paths.
- **Qdrant Mcp Server:** Added MCP support for Qdrant
- **Expand URL addition in Crawl4ai: I**ntroduced a new URL expansion
feature directly into the Crawl4ai toolkit. Our agents frequently
encounter shortened URLs that crawl4ai cannot scrape effectively,
leading to incomplete data retrieval. With this update, shortened URLs
are expanded to their final destinations before being processed by the
crawler.
## Improvements:
- **FastAPIApp Update**: FastAPIApp was updated and `agent` was replaced
with `agents`, `team` with `teams` and `workflows` was added. This also
now requires you to specify which agent/team/workflow to run.
- E.g. `http://localhost:8001/runs?agent_id=my-agent`
- **ZepTools Updates**: Updated `ZepTools` to remove deprecated
features.
- **GmailTools Attachments**: `GmailTools` now support attachments.
- **Improve code reusability by using fetch with retry and
async_fetch_with_retry:** updated
`fetch_with_retry` and `async_fetc_with_retry` to be reused
in`url_reader.py`
## Bug Fixes:
- **Claude Prompt Tokens**: Fixed a bug with prompt tokens not
propagating in Claude model class
- **Add type in base App class for registry:** Can have different types
of app like- `slack`, `whatsapp`, etc
- **Accept empty array of pdf urls:** Fixed an issue where empty PDF URL
arrays were not accepted, preventing knowledge base queries without
adding new documents
- **Add name to evaluation examples:** Included name param in evaluation
examples
- **Anthropic cache metrics propagation:** Fixed a bug where Anthropic's
prompt caching metrics were not propagating to Agent responses, despite
the raw Anthropic API working correctly. This minimal fix ensures cache
performance metrics are properly captured and reported.
- **Handle non serializable objects on RunResponse dict parsing:**
- Updated `RunResponse.to_dict()` instead of `.to_json()` to try
handling non-serializable fields asap
---------
Co-authored-by: Dirk Brand <[email protected]>
Co-authored-by: Yash Pratap Solanky <[email protected]>
Co-authored-by: ysolanky <[email protected]>
Co-authored-by: Dirk Brand <[email protected]>
|
||
|
|
15dc022221 | fix validation | ||
|
|
2d13a9c117 | fix: validation | ||
|
|
193f2a83ad |
Teams 2.0 (#2246)
## Description A complete revamp of teams. |
||
|
|
626db7e12c |
Add json_response_mode instead of structured_output (#2355)
## Description This addresses a confusing DX point where users often have to set response_model and structured_output. This changes the behaviour to default to structured output if supported. json_response_mode can be activated if needed. --- ## Type of change Please check the options that are relevant: - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] Model update (Addition or modification of models) - [ ] Other (please describe): --- ## Checklist - [ ] Adherence to standards: Code complies with Agno’s style guidelines and best practices. - [ ] Formatting and validation: You have run `./scripts/format.sh` and `./scripts/validate.sh` to ensure code is formatted and linted. - [ ] Self-review completed: A thorough review has been performed by the contributor(s). - [ ] Documentation: Docstrings and comments have been added or updated for any complex logic. - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable). - [ ] Tested in a clean environment: Changes have been tested in a clean environment to confirm expected behavior. - [ ] Tests (optional): Tests have been added or updated to cover any new or changed functionality. --- ## Additional Notes Include any deployment notes, performance implications, security considerations, or other relevant information (e.g., screenshots or logs if applicable). |
||
|
|
e67ee57766 |
Phidata -> Agno (#1935)
# Changelog
This is a major refactor to be coupled with the launch of Agno AI.
## Interface Changes:
- `phi.model.x` → `agno.models.x`
- `phi.knowledge_base.x` → `agno.knowledge.x` (applies to all knowledge
bases)
- `phi.document.reader.xxx` → `agno.document.reader.xxx_reader` (applies
to all document readers)
- All Agno toolkits are now suffixed with `Tools`. E.g. `DuckDuckGo` →
`DuckDuckGoTools`
- Multi-modal interface updates:
- `agent.run(images=[])` and `agent.print_response(images=[])` is now of
type `Image`
```python
class Image(BaseModel):
url: Optional[str] = None # Remote location for image
filepath: Optional[Union[Path, str]] = None # Absolute local location
for image
content: Optional[Any] = None # Actual image bytes content
detail: Optional[str] = None # low, medium, high or auto (per OpenAI
spec
https://platform.openai.com/docs/guides/vision?lang=node#low-or-high-fidelity-image-understanding)
id: Optional[str] = None
```
- `agent.run(audio=[])` and `agent.print_response(audio=[])` is now of
type `Audio`
```python
class Audio(BaseModel):
filepath: Optional[Union[Path, str]] = None # Absolute local location
for audio
content: Optional[Any] = None # Actual audio bytes content
format: Optional[str] = None
```
- `agent.run(video=[])` and `agent.print_response(video=[])` is now of
type `Video`
```python
class Video(BaseModel):
filepath: Optional[Union[Path, str]] = None # Absolute local location
for video
content: Optional[Any] = None # Actual video bytes content
```
- `RunResponse.images` is now a list of type `ImageArtifact`
```python
class ImageArtifact(Media):
id: str
url: str # Remote location for file
alt_text: Optional[str] = None
```
- `RunResponse.audio` is now a list of type `AudioArtifact`
```python
class AudioArtifact(Media):
id: str
url: Optional[str] = None # Remote location for file
base64_audio: Optional[str] = None # Base64-encoded audio data
length: Optional[str] = None
mime_type: Optional[str] = None
```
- `RunResponse.videos` is now a list of type `VideoArtifact`
```python
class VideoArtifact(Media):
id: str
url: str # Remote location for file
eta: Optional[str] = None
length: Optional[str] = None
```
- `RunResponse.response_audio` is now of type `AudioOutput`
```python
class AudioOutput(BaseModel):
id: str
content: str # Base64 encoded
expires_at: int
transcript: str
```
- Models:
- `Hermes` → `OllamaHermes`
- `AzureOpenAIChat` → `AzureOpenAI`
- `CohereChat` → `Cohere`
- `DeepSeekChat` → `DeepSeek`
- `GeminiOpenAIChat` → `GeminiOpenAI`
- `HuggingFaceChat` → `HuggingFace`
- Embedders now all take `id` instead of `model` as a parameter. For
example
```python
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
knowledge_base = PDFUrlKnowledgeBase(
urls=["https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"],
vector_db=PgVector(
table_name="recipes",
db_url=db_url,
embedder=OllamaEmbedder(id="llama3.2", dimensions=3072),
),
)
knowledge_base.load(recreate=True)
```
- Agent Storage class
- `PgAgentStorage` → `PostgresAgentStorage`
- `SqlAgentStorage` → `SqliteAgentStorage`
- `MongoAgentStorage` → `MongoDbAgentStorage`
- `S2AgentStorage` → `SingleStoreAgentStorage`
- Workflow Storage class
- `SqlWorkflowStorage` → `SqliteWorkflowStorage`
- `PgWorkflowStorage` → `PostgresWorkflowStorage`
- `MongoWorkflowStorage` → `MongoDbWorkflowStorage`
- Knowledge Base
- `phi.knowledge.pdf.PDFUrlKnowledgeBase` →
`agno.knowledge.pdf_url.PDFUrlKnowledgeBase`
- `phi.knowledge.csv.CSVUrlKnowledgeBase` →
`agno.knowledge.csv_url.CSVUrlKnowledgeBase`
- Readers
- `phi.document.reader.arxiv` → `agno.document.reader.arxiv_reader`
- `phi.document.reader.docx` → `agno.document.reader.docx_reader`
- `phi.document.reader.json` → `agno.document.reader.json_reader`
- `phi.document.reader.pdf` → `agno.document.reader.pdf_reader`
- `phi.document.reader.s3.pdf` → `agno.document.reader.s3.pdf_reader`
- `phi.document.reader.s3.text` → `agno.document.reader.s3.text_reader`
- `phi.document.reader.text` → `agno.document.reader.text_reader`
- `phi.document.reader.website` → `agno.document.reader.website_reader`
## Improvements:
- **Dataclasses** - Changed various instances of Pydantic models to
dataclasses to improve the speed.
## Removals
- Removed all references to `Assistant`
- Removed all references to `llm`
- Removed the `PhiTools` tool
- …
## Bug Fixes:
- Fixed semantic chunking by replacing `similarity_threshold` param with
`threshold` param
---------
Co-authored-by: Ashpreet <[email protected]>
Co-authored-by: Yash Pratap Solanky <[email protected]>
Co-authored-by: Willem Carel de Jongh <[email protected]>
Co-authored-by: Anurag <[email protected]>
Co-authored-by: Ayush <[email protected]>
Co-authored-by: Manthan Gupta <[email protected]>
Co-authored-by: ysolanky <[email protected]>
Co-authored-by: ansub <[email protected]>
Co-authored-by: Manthan Gupta <[email protected]>
|