Skip to content

refactor(agents): migrate docqa + routing to hub (#1102) - #1455

Merged
kovtcharov merged 8 commits into
mainfrom
claudia/task-8fa7ecef
Jun 26, 2026
Merged

kovtcharov merged 8 commits into
mainfrom
claudia/task-8fa7ecef

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Why this matters

DocumentQAAgent and RoutingAgent were the last two agents still living in the core source tree under src/gaia/agents/. They now ship as standalone gaia-agent-docqa / gaia-agent-routing wheels under hub/agents/python/, completing the "strip src/gaia/agents/ to framework only" goal for #1102. The core wheel no longer hardcodes them and they version independently.

Two distinct shapes, handled differently:

  • docqa is a building-block RAG agent — it registers via the gaia.agent entry point as a hidden agent (mirroring fileio), default model Qwen3.5-35B-A3B-GGUF. Discovered automatically by the registry; hidden from the UI selector.
  • routing is infrastructure — a meta-agent loaded by class path from the OpenAI-compatible API server (gaia-code model), not a registry agent (it doesn't inherit Agent). It ships without a gaia.agent entry point. gaia.api.agent_registry now resolves it at gaia_agent_routing.agent.RoutingAgent and fails loudly with an install hint (pip install gaia-agent-routing gaia-agent-code) when the wheel is absent — no silent fallback.

History is preserved via git mv. Each new wheel gets a CI workflow mirroring test_analyst_agent.yml, wired into the test_gaia_cli aggregator; test_code_agent.yml's path trigger follows routing to its new home.

Test plan

  • python util/lint.py --all — clean (black/isort/agent-conventions pass; bandit notes are pre-existing false positives in unrelated files)
  • pip install -e hub/agents/python/docqa hub/agents/python/routing && pytest hub/agents/python/{docqa,routing}/tests/ — 52 passed
  • pytest tests/unit/agents/test_registry.py tests/unit/test_agents_split.py tests/unit/test_errors.py tests/test_sdk.py::TestRoutingAgent — green
  • Import check: import gaia.api.agent_registry works; gaia-code resolves to gaia_agent_routing.agent.RoutingAgent; registry discovers docqa (hidden)
  • CI: new DocQA Agent Tests + Routing Agent Tests workflows install the wheels and run their tests

Pre-existing test_cli_smoke failures for the gaia-emr/gaia-code console scripts are unrelated to this change (they fail identically with this branch's changes stashed — stale installed entry-point metadata pointing at already-migrated modules).

@github-actions github-actions Bot added dependencies Dependency updates devops DevOps/infrastructure changes tests Test changes agents labels Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Clean, well-executed refactor that finishes the #1102 goal of stripping src/gaia/agents/ down to framework-only. docqa and routing move out as standalone hub wheels with history preserved (git mv, 100% similarity), and the two are correctly handled as different shapes: docqa ships as a hidden registry agent via the gaia.agent entry point (mirroring fileio exactly), while routing ships as infrastructure with no entry point and is resolved by class path from the API server. The single most important thing to know: the code paths are consistent and fail loudly, but the docs were not updated — several pages still reference the old gaia.agents.routing.agent.RoutingAgent path that this PR makes invalid.

The new wheel __init__.py for docqa matches the established fileio pattern line-for-line (lazy __getattr__, build_registration, hidden=True), and the agent_registry change fails loudly with an actionable install hint rather than degrading silently — both fully in line with GAIA conventions.

Issues Found

🟡 Important

Stale docs reference the now-invalid routing path (docs/sdk/infrastructure/api-server.mdx:89, docs/spec/api-server.mdx:342, docs/playbooks/chat-agent/part-3-deployment.mdx:246)

These pages show "class_name": "gaia.agents.routing.agent.RoutingAgent" as a concrete, copy-pasteable example. After this PR the live value is gaia_agent_routing.agent.RoutingAgent (the change you made in src/gaia/api/agent_registry.py:33), so the docs now contradict the code. A user copying the api-server example will hit the exact ImportError your new hint warns about. CLAUDE.md requires docs match the SDK implementation, so these should move with the code. Suggested fix for the api-server example:

        "class_name": "gaia_agent_routing.agent.RoutingAgent",

Additionally, docs/sdk/agents/routing.mdx, docs/spec/routing-agent.mdx, and docs/guides/routing.mdx carry from gaia.agents.routing.agent import RoutingAgent import lines and GitHub source links to src/gaia/agents/routing/ that now 404. These need updating to gaia_agent_routing / hub/agents/python/routing/. If a docs sweep across the whole #1102 migration is planned as a follow-up, that's reasonable — but please call it out explicitly in the PR so it isn't lost, since this PR is what makes them wrong.

🟢 Minor

Traceback filter set not updated for the moved module (src/gaia/agents/base/errors.py:25)

FRAMEWORK_PATHS still lists "gaia/agents/routing", which no longer matches the installed module path (gaia_agent_routing/). Result: routing framework frames will now leak into user-facing error output instead of being filtered. Note this set is already stale for code/docker/jira (migrated in earlier PRs), so this is a pre-existing pattern rather than something you introduced — but routing joins the broken list here. A small follow-up to switch these to the gaia_agent_* paths would restore the intended filtering. tests/unit/test_errors.py:78 would move with it.

docqa CI path trigger misses a real import dependency (.github/workflows/test_docqa_agent.yml:42)

The docqa agent imports from gaia.agents.chat.tools import FileToolsMixin, but the workflow's path filter covers agents/base/** and agents/tools/**, not agents/chat/**. A change to FileToolsMixin won't trigger docqa tests. This mirrors the existing test_analyst_agent.yml filter, so it's consistent with precedent — flagging only as a latent coverage gap, not a blocker.

Strengths

  • Pattern fidelity: docqa's __init__.py and gaia-agent.yaml are a faithful copy of the fileio template (lazy import, hidden=True, namespaced_agent_id), and the routing/docqa CI workflows mirror test_analyst_agent.yml and wire cleanly into the test_gaia_cli aggregator including the test-summary needs list.
  • Fail-loudly done right: the gaia-code resolution error in agent_registry.py:160 raises with what failed, what to install, and where to look — exactly the three-part actionable error CLAUDE.md asks for, no silent provider/agent fallback.
  • Correct shape distinction: recognizing that routing is infrastructure (no Agent base class — confirmed at agent.py:18, no entry point) vs. docqa being a registry building block, and documenting the why in both the README and pyproject.toml comment, is the right call and prevents a future contributor from "fixing" the missing entry point.
  • Tests moved with the code and import paths updated throughout; pytest.importorskip guards added in tests/test_sdk.py and tests/unit/test_agents_split.py keep framework-only environments green.

Verdict

Approve with suggestions. No blocking code issues — the refactor is correct, consistent with prior #1102 migrations, and the runtime path fails loudly. The one thing that genuinely needs resolution before this is "done" is the stale routing docs (🟡): they now actively misdirect users to an import that errors. Either fix them here or explicitly track the docs sweep as a follow-up in the PR description. The minor items (errors.py filter, CI path trigger) are fine as fast-follows.

itomek
itomek previously approved these changes Jun 8, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔴 tests/unit/agents/test_default_max_steps.py:47 — broken import after docqa move

docqa/agent.py was renamed to hub/…/gaia_agent_docqa/agent.py but this file was missed during the import-path sweep. Running pytest tests/unit/ will fail with ModuleNotFoundError: No module named 'gaia.agents.docqa'.

    def test_configs_inherit_the_override_at_construction(self):
        from gaia.agents.chat.agent import ChatAgentConfig
        pytest.importorskip("gaia_agent_docqa")
        from gaia_agent_docqa.agent import DocumentQAAgentConfig

Also needs import pytest at the top. Alternatively, guard the whole test the same way test_agents_split.py does for similar optional-wheel imports.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 tests/unit/agents/test_default_max_steps.py:47 — stale import after the docqa move

DocumentQAAgent was moved from gaia.agents.docqa.agent → gaia_agent_docqa.agent, but this test file wasn't updated. It will fail with ModuleNotFoundError in any CI job that runs the unit-test suite.

        pytest.importorskip("gaia_agent_docqa")
        from gaia_agent_docqa.agent import DocumentQAAgentConfig

(Same pattern used in test_agents_split.py:769.)

@github-actions

Copy link
Copy Markdown
Contributor

🔴 tests/unit/agents/test_default_max_steps.py:47 — stale import breaks unit tests

gaia.agents.docqa.agent was renamed/moved to gaia_agent_docqa.agent in this PR, but test_default_max_steps.py was not updated:

from gaia.agents.docqa.agent import DocumentQAAgentConfig   # line 47 — module gone

This will fail with ModuleNotFoundError whenever gaia-agent-docqa is installed (or immediately in CI since the old path no longer exists).

        pytest.importorskip("gaia_agent_docqa")
        from gaia_agent_docqa.agent import DocumentQAAgentConfig

@github-actions

Copy link
Copy Markdown
Contributor

🔴 tests/unit/agents/test_default_max_steps.py:47 has a broken import that wasn't updated with the docqa move:

# current (broken — module no longer exists)
from gaia.agents.docqa.agent import DocumentQAAgentConfig
from gaia_agent_docqa.agent import DocumentQAAgentConfig

The test at line 46 also needs a pytest.importorskip("gaia_agent_docqa") guard (matching the pattern in test_agents_split.py) so it skips cleanly in framework-only envs rather than erroring. Without both fixes, pytest tests/unit/ will fail any time gaia-agent-docqa isn't installed.

@github-actions github-actions Bot added the documentation Documentation changes label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 CLAUDE.md not updated — four stale paths will mislead every AI-assisted session (the file is loaded as context on every Claude Code invocation in this repo).

The PR correctly updated docs/guides/routing.mdx, docs/sdk/agents/routing.mdx, docs/spec/routing-agent.mdx, etc., but CLAUDE.md still points to the old locations:

Line Stale Should be
509 agents/docqa/agent.py hub/agents/python/docqa/gaia_agent_docqa/agent.py
521 agents/routing/agent.py hub/agents/python/routing/gaia_agent_routing/agent.py
408 src/gaia/agents/ tree shows docqa/ remove or move to hub note
525 "Internal building-block agents … live under src/gaia/agents/" DocQA no longer lives there

Quick fix for lines 509 and 521 (the Agent Implementations table):

| **DocumentQAAgent** | `hub/agents/python/docqa/gaia_agent_docqa/agent.py` | Standalone document Q&A with RAG | Qwen3.5-35B-A3B |
| **RoutingAgent** | `hub/agents/python/routing/gaia_agent_routing/agent.py` | Intelligent agent selection | Qwen3.5-35B-A3B (`AGENT_ROUTING_MODEL`) |

Ovtcharov and others added 6 commits June 25, 2026 16:55
DocumentQAAgent and RoutingAgent were the last two agents left in the
core source tree under src/gaia/agents/. They now ship as standalone
gaia-agent-docqa / gaia-agent-routing wheels under hub/agents/python/,
completing the "strip src/gaia/agents/ to framework only" goal for #1102
(only base/, tools/, registry.py, builder/ — plus the chat family and
email — remain in core).

docqa is a building-block RAG agent: it registers via the gaia.agent
entry point as a hidden agent (mirroring fileio), default model
Qwen3.5-35B-A3B-GGUF. routing is infrastructure — a meta-agent loaded by
class path from the OpenAI API server, not a registry agent — so it ships
without a gaia.agent entry point; gaia.api.agent_registry now resolves it
at gaia_agent_routing.agent.RoutingAgent and fails loudly with an install
hint when the wheel is absent.
Self-review follow-up to the docqa/routing migration: the gaia-agent-code
CLI imported RoutingAgent from the old in-tree path
(gaia.agents.routing.agent), which the migration broke. Repoint it at
gaia_agent_routing.agent and declare gaia-agent-routing as a dependency of
gaia-agent-code, since the `gaia-code` query path routes through
RoutingAgent for language/project-type detection. No reverse dependency
(routing → code) — routing resolves CodeAgent through the registry at
runtime, avoiding a cycle.

Also clears the now-dead RoutingAgent allowance in the agent-conventions
checker (it only applied while routing lived under src/gaia/agents/).
Merging main surfaced three stale references the migration missed:

- test_default_max_steps imported the now-migrated gaia.agents.docqa;
  repoint it at the core BuilderAgentConfig, which exercises the same
  field(default_factory=default_max_steps) inheritance.
- test_agent_pypi_publish asserted every published wheel declares a
  gaia.agent entry point, but routing is infrastructure loaded by
  class-path and intentionally ships without one. Exempt it explicitly.
- Routing module path + source links in the docs still pointed at
  src/gaia/agents/routing; repoint to the gaia_agent_routing wheel.

Also preserve the original traceback on the gaia-code ImportError
re-raise (raise ... from e) now that the block is being edited.
gaia-agent-code now depends on gaia-agent-routing>=0.1.0, which isn't
published to PyPI. The Test Code Agent workflow installed code straight
from the hub dir, so uv tried to resolve routing from the registry and
failed. Install the local routing package first so the dep resolves
locally. End users are unaffected — both wheels publish together on tag.
The API streaming tests target the 'gaia-code' model, which routes
through RoutingAgent. Pre-migration routing lived in core, so it
resolved automatically; now it ships as the gaia-agent-routing wheel
that the API Tests job didn't install — so 3 streaming tests hit the
(correct) missing-wheel error instead of a real agent. Install the
local routing+code hub packages, and re-run API tests when either
hub package changes.
CLAUDE.md still pointed DocumentQAAgent/RoutingAgent at the old
src/gaia/agents/{docqa,routing} locations and listed docqa in the source
tree — stale after the hub migration and misleading since CLAUDE.md loads
as context on every session. Point both at their hub wheels and drop the
docqa tree entry.

errors.py FRAMEWORK_PATHS carried a dead 'gaia/agents/routing' entry; the
wheel's frames are already filtered by 'site-packages/'. Remove it and
update the test that asserted its presence.
@kovtcharov
kovtcharov force-pushed the claudia/task-8fa7ecef branch from 17221cc to e64ebcb Compare June 26, 2026 00:06
…aths

The docqa agent imports gaia.agents.chat.tools.FileToolsMixin, but the
DocQA Agent Tests workflow only triggered on agents/base/** and
agents/tools/** — a change to FileToolsMixin wouldn't run docqa's tests.
Add src/gaia/agents/chat/tools/** to its path filter so the real import
dependency is covered.

Also repoint the two remaining agents/routing/agent.py references in the
agent-ui capabilities plan at the hub wheel path the migration moved
RoutingAgent to, matching the EMR entry already in the same table.
@kovtcharov

Copy link
Copy Markdown
Contributor

Rebased onto current main (linear history, 6 commits) — conflicts in setup.py, test_gaia_cli.yml, the docqa test, and CLAUDE.md were resolved by keeping main's email/structure additions alongside the docqa+routing entries. All previously-flagged review items are now resolved in-tree:

  • Stale routing docs (api-server.mdx, spec/api-server.mdx, playbooks, routing.mdx/spec/guide) — clean; no gaia.agents.routing / gaia.agents.docqa references remain anywhere under docs/, src/, tests/, hub/.
  • errors.py FRAMEWORK_PATHS — the dead gaia/agents/routing entry is gone (wheel frames are filtered by site-packages/).
  • test_default_max_steps.py broken import — no longer imports the moved gaia.agents.docqa; repointed at the core config that exercises the same inheritance.
  • CLAUDE.md — docqa/routing moved from the in-core listing to the hub-wheel note in the project tree, the Agent Implementations table, and the issue-response file-reference list.

Two follow-ups for the remaining 🟢 items in the latest commit:

  • docqa CI path gap — docqa imports gaia.agents.chat.tools.FileToolsMixin, so src/gaia/agents/chat/tools/** is now in its workflow path filter (a change to FileToolsMixin will trigger docqa tests).
  • Plan-doc paths — the two agents/routing/agent.py references in the agent-ui capabilities plan now point at the hub wheel, matching the EMR entry already in that table.

Verified locally in an isolated venv: 52 hub tests, core registry/errors/split/default-max-steps/pypi/packaging tests, and 85 Agent UI agents-router + chat-helper tests all pass; gaia.api.agent_registry resolves gaia-code → gaia_agent_routing.agent.RoutingAgent; python util/lint.py --all clean.

@kovtcharov

Copy link
Copy Markdown
Contributor

The one remaining red check, Test Lemonade Embeddings API, is a pre-existing infra-gated job — it runs only on the self-hosted stx AMD hardware runner (runs-on: stx) and failed with model_load_error: llama-server failed to start loading nomic-embed-text-v2-moe-GGUF under Lemonade 10.8.1. That's a backend/hardware issue, not a result of this migration (the PR changes no embedding/RAG/LLM-client code). All real checks — every Unit Tests job, Test DocQA Agent, Test Routing Agent, Test Code Agent, Test GAIA CLI (Linux+Windows), MCP, Security, build, CodeQL, docs validators — are green; API Tests passed on rerun.

@kovtcharov
kovtcharov added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 21fff02 Jun 26, 2026
58 of 61 checks passed
@kovtcharov
kovtcharov deleted the claudia/task-8fa7ecef branch June 26, 2026 21:22
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 7, 2026
The "API Tests" check has been red on every branch including main since
the email agent moved to a standalone hub wheel: the workflow installs
the routing and code hub packages into its venv but not
`gaia-agent-email`, so the email REST router never mounts and every
`/v1/email` test in `tests/test_api.py` fails with `404 {"detail":"Not
Found"}`. One install line fixes it.

**Test plan**
- [ ] "API Tests" check on this PR goes green (the email tests were the
only failures — same signature as main run 28462826567)
- [ ] After merge, re-run API Tests on open PRs amd#1917/amd#1919 — they
should go fully green

<details>
<summary>Evidence</summary>

- Main's latest run of this workflow (28462826567 @ 50c17de) fails with
the identical email-route 404 list as every PR branch — e.g.
`TestEmailTriageEndpoint::test_single_email_in_structured_out`: `assert
404 == 200`.
- Last green main run of this workflow was amd#1455 (2026-06-26) — the last
commit to touch `test_api.yml`; the failures start with the
hub-migration commits that followed.
- The workflow already installs the other two hub wheels for exactly
this reason (routing/code, amd#1102) — email was missed.
</details>

Co-authored-by: Tomasz Iniewicz <[email protected]>
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
7 of 8 tasks
itomek added a commit that referenced this pull request Jul 16, 2026
The breaking-change note linked #1866 (the .docx RAG feature), which merely
carried the migration in via its base branch. Commit 21fff02 (#1455) is what
actually removed src/gaia/agents/{routing,docqa} and added the hub packages.
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Aug 17, 2026
Release notes had grown into long blocks of prose with a marketing-toned
paragraph on top. They now generate as short bullets grouped by section,
with a word cap on the narrative part. Nothing informational is lost —
every PR link, contributor credit, and changelog entry is preserved; the
prose around them is cut.

Two generators write `docs/releases/<tag>.mdx` and they had drifted
apart. The `gaia-release` skill told the model GAIA's notes "read dry"
and to make them "engaging"; the `release-notes` job in `claude.yml`
asked for "comprehensive" notes with an `## Overview` paragraph and
emoji headings. Fixing one alone would have been overwritten by the
other on the next tag, so both now share one spec.

Closes amd#2961

## What it looks like now

Regenerated from the last two releases — same facts, same PR numbers,
new template. Narrative words (the capped part, excluding
bug-fix/contributor/changelog lists):

| Release | Published | Regenerated | Cap |
|---|---|---|---|
| v0.22.0 (minor) | 1705 | **538** | 600 |
| v0.23.0 (minor) | 1119 | **280** | 600 |

<details>
<summary>Example 1 — v0.23.0 regenerated</summary>

```markdown
---
title: "v0.23.0"
description: "Install and run agents from the terminal, add capabilities as skills, and connect a Microsoft account without a secret."
---

# GAIA v0.23.0 Release Notes

Agents are now installable from the terminal, and the confirmation gate that pauses an agent before a consequential action works everywhere, not just in the Agent UI.

## Breaking Changes

- **`GAIA_MICROSOFT_TENANT` is gone** — the Microsoft connector split into Personal and Work/School, each with its own tenant. Drop the variable and pick the matching connector. (PR [amd#2729](amd#2729))

## What's New

- **Install and run agents from the terminal** — `gaia hub list`, `gaia hub install <agent> --trust`, `gaia hub uninstall <agent>`. `--trust` is required for an unverified agent. (PRs [amd#2484](amd#2484), [amd#2530](amd#2530), [amd#2708](amd#2708))
- **Every agent asks before it acts** — the confirmation gate for sending mail, writing files, and running commands now fires from the terminal, the local API, and MCP tool calls, not only the Agent UI. Set `GAIA_AUTO_APPROVE_TOOLS=1` to opt out. (PRs [amd#2475](amd#2475), [amd#2544](amd#2544), [amd#2846](amd#2846), [amd#2854](amd#2854))
- **Safer by default** — the MCP bridge binds to localhost and enforces `--auth-token`; the local API refuses credentialed cross-origin requests from non-allow-listed sites; MCP servers launch without a shell; agents cannot write to `~/.gaia` or pass crafted SQL to the database agent. (PRs [amd#2246](amd#2246), [amd#2238](amd#2238), [amd#2344](amd#2344), [amd#2844](amd#2844), [amd#2847](amd#2847), [amd#2860](amd#2860))
- **Add capabilities as skills** — `gaia skill create|import|list|info` gives an agent a new capability from a folder and a manifest. Skills are signed with trust tiers, audited before publish, and opt-in. (PRs [amd#2669](amd#2669), [amd#2692](amd#2692), [amd#2702](amd#2702), [amd#2693](amd#2693))
- **Connect a Microsoft account without a secret** — Personal and Work/School are separate connectors with device-code sign-in. (PRs [amd#2718](amd#2718), [amd#2364](amd#2364))
- **Lemonade Server 11.5.0.**

## Bug Fixes

- **Triage paginates large inboxes and reports truncation** (PR [amd#2646](amd#2646)) — mail past a hidden limit is no longer dropped without saying so.
- **Thread messages come back sorted and numbered** (PR [amd#2570](amd#2570)) — "reply to 3" hits the message shown at position 3.
- **The inbox pre-scan reports uncertainty as uncertainty** (PR [amd#2587](amd#2587)).
- **An email conversation survives its turns** (PR [amd#2837](amd#2837)) — a follow-up keeps session context.
- **A bare reconnect keeps existing grants** (PR [amd#2733](amd#2733)).
- **Restore from Trash anytime** (PR [amd#2542](amd#2542)) — no time window on undo.
- **Sender priority no longer overrides content classification** (PR [amd#2774](amd#2774)).
- **The agent survives an OpenMP double-init** (PR [amd#2508](amd#2508)).
- **Large tool results truncate to valid JSON** (PR [amd#2645](amd#2645)).
- **A missing model surfaces as a real 404** (PR [amd#2245](amd#2245)).
- **GPU is detected on all platforms and `default_device` is honoured** (PR [amd#2244](amd#2244)).
- **A sidecar that is alive but not serving is detected** (PR [amd#2707](amd#2707)).
- **The model-slot lease is held across inference** (PR [amd#2394](amd#2394)) — a second agent can't evict the model mid-generation.
- **A browser that never launched is surfaced** (PR [amd#2507](amd#2507)).
- **Stop aborts in-flight streaming** (PR [amd#2166](amd#2166)).

## Known Issues

- **The email agent is beta and CLI-first** — treat its output as a draft to review.
- **A full inbox triage can time out on larger mailboxes.**
- **Email autonomy is experimental** and not wired up in the packaged sidecar.

## Contributors

- [@handle](https://github.com/handle) — <contribution> (PR [#NNN](https://github.com/amd/gaia/pull/NNN))
  <!-- generated from the commit log; v0.23.0's list is unchanged from the published notes -->


## Full Changelog

**N commits** since v0.22.0:

- `<sha>` — <subject>

Full Changelog: [v0.22.0...v0.23.0](amd/gaia@v0.22.0...v0.23.0)
```
</details>

<details>
<summary>Example 2 — v0.22.0 regenerated (the largest recent
release)</summary>

```markdown
---
title: "v0.22.0"
description: "The email agent tracks follow-ups and action items, drafts in your voice, and runs as its own process. Plus a cron scheduler and Word document support in RAG."
---

# GAIA v0.22.0 Release Notes

A large release built around the email agent, which now tracks what you're waiting on instead of forgetting it after triage.

## Breaking Changes

- **Triage returns a reply scaffold, not an empty draft** — `POST /v1/email/triage` and `/triage/batch` now return a `DraftScaffold` without `body`. Code reading `result.draft.body` gets a missing key instead of `""`; use `POST /v1/email/draft` for composed prose. (PR [amd#1984](amd#1984))
- **RoutingAgent and DocumentQAAgent moved to standalone packages** — install `gaia-agent-routing` and `gaia-agent-docqa`. The old imports fail; there is no deprecation shim. (PR [amd#1455](amd#1455))

## What's New

- **An inbox agent that keeps track** — `gaia email` scans Sent folders across every connected mailbox and flags threads still waiting on a reply past a window you set (default 3 days). Detection only; it never nudges anyone for you. (PRs [amd#1922](amd#1922), [amd#1917](amd#1917), [amd#1919](amd#1919), [amd#1918](amd#1918))
- **Drafts in your own voice** — the agent derives greeting, sign-off, length, and formality from your Sent history and composes against that. Only the derived characteristics are stored, never old mail content. (PR [amd#1925](amd#1925))
- **Attachments work end to end** — triage surfaces each attachment's name, type, and size, and drafting and sending accept real attachments as Gmail multipart MIME or Outlook Graph attachments. (PRs [amd#1921](amd#1921), [amd#1883](amd#1883))
- **Email runs as its own process in the Agent UI (beta)** — install it from the Agent Hub panel and the UI talks to it over HTTP, instead of loading the email stack into the UI process. (PRs [amd#1884](amd#1884), [amd#1910](amd#1910), [amd#2100](amd#2100), [amd#2101](amd#2101), [amd#2105](amd#2105))
- **Run prompts on a cron from the terminal** — `gaia schedule add --name digest --cron "0 9 * * *" --prompt "summarize my inbox" --sink stdout`, then `gaia schedule daemon`. Schedules live in a hand-editable `~/.gaia/schedules.toml`; sinks are `stdout`, `file:<path>`, `notification`, or `telegram`. (PR [amd#1371](amd#1371))
- **Agents learn from work they repeat** — after enough successes on the same shape of goal, an agent distills the tool sequence into a reusable procedure and recalls it next time. Runs inside the existing memory pass; nothing to install. (PR [amd#1794](amd#1794))
- **Pick your model once** — `gaia config set default_model <id>` persists across `gaia chat`, `gaia llm`, and `gaia prompt`. An explicit `--model` still wins for a one-off. (PR [amd#1863](amd#1863))
- **RAG reads Word documents** — `.docx` files index like PDF and PPTX, including table cells, nested tables, content controls, hyperlinks, and textboxes, so filled-in form values get indexed. (PR [amd#1866](amd#1866))
- **A new default embedder** — the previous default cannot be loaded by current llama.cpp builds, which broke indexing, code search, and memory embedding on an up-to-date Lemonade. The default is now EmbeddingGemma 300M at the same 768 dimensions. (PRs [amd#1952](amd#1952), [amd#1761](amd#1761), [amd#1748](amd#1748))
- **The Agent Hub shows what an agent is worth** — an agent's page now carries its eval scorecard with a score badge and a code-derived capability matrix. (PRs [amd#1985](amd#1985), [amd#2020](amd#2020), [amd#2066](amd#2066))
- **Lemonade Server 10.10.0** — adds an audio-generation endpoint, lets Windows reuse system ROCm, and inhibits suspend during inference. Two upstream breaking changes are Linux-specific. (PR [amd#1969](amd#1969))

## Bug Fixes

- **`gaia init` said a working Lemonade wasn't installed** (PR [amd#1940](amd#1940)) — modern Lemonade (10.7+) dropped the `lemonade-server` CLI that GAIA probed for.
- **Installing the email agent from the Hub failed on every platform** (PR [amd#2086](amd#2086)).
- **Bulk triage broke on any real inbox** (PR [amd#2088](amd#2088)) — 60 emails overflowed the 16K context window; the result envelope is now condensed.
- **RAG silently indexed nothing** (PR [amd#1979](amd#1979)) — a failed `sentence-transformers` import made every indexing call a no-op.
- **Email bodies were truncated at 4,000 characters with no override** (PR [amd#2036](amd#2036)) — MFA codes and precise replies lost content past the cutoff.
- **Long threads overflowed the model's context** (PR [amd#2076](amd#2076)).
- **A disabled device was treated as usable** (PR [amd#2081](amd#2081)) — a device reporting `available: false`, such as an unpowered NPU, was misread as ready.
- **A newly connected mailbox was skipped** (PR [amd#1808](amd#1808)) — mailboxes connected mid-session were not picked up.
- **JSON with a `}` inside a string was dropped** (PR [amd#1824](amd#1824)).
- **Outlook users were told to reconnect Google** (PR [amd#1757](amd#1757)) — `AGENT_NOT_GRANTED` named the wrong provider.
- **The Agent UI hard-crashed on a recoverable GPU crash** (PR [amd#1799](amd#1799)) — it now falls back to software rendering.
- **A user-edited memory could be silently downgraded and then wiped** (PR [amd#1958](amd#1958)).
- **The builder agent ignored an agent name you had already given** (PR [amd#1981](amd#1981)).
- **The landing and hub pages scrolled sideways on phones** (PR [amd#1959](amd#1959)).

## Known Issues

- **Inbox pre-scan needs a single mailbox for now** — with both Gmail and Outlook connected, an Agent UI pre-scan errors. Disconnect one in Settings → Connectors; triage itself still spans every mailbox. ([amd#2127](amd#2127))
- **Spam detection under-flags over the REST API** — `/v1/email/triage` uses a narrow sender check rather than the model's reading. The agent's own inbox scanning is unaffected. ([amd#2124](amd#2124))
- **The email agent is beta** — treat its output as a draft to review. It never sends without your confirmation.

## Contributors

- [@alexey-tyurin](https://github.com/alexey-tyurin) — skill auto-synthesis / procedural memory (PR [amd#1794](amd#1794))
- [@TravisHaa](https://github.com/TravisHaa) — the `gaia schedule` CLI and cron-based dispatch (PR [amd#1371](amd#1371))
- [@Rohithmatham12](https://github.com/Rohithmatham12) — refresh resolved email backends before multi-mailbox triage (PR [amd#1808](amd#1808))
- [@Osamaali313](https://github.com/Osamaali313) — fix `extract_json_from_text` dropping JSON containing `}` (PR [amd#1824](amd#1824))
- [@eeee2345](https://github.com/eeee2345) — offline model-endpoint guard-proxy integration guide (PR [amd#1809](amd#1809))
- [@somo9909](https://github.com/somo9909) — prerequisites section for the memory guide (PR [amd#1665](amd#1665))

## Full Changelog

**N commits** since v0.21.2:

- `<sha>` — <subject>

Full Changelog: [v0.21.2...v0.22.0](amd/gaia@v0.21.2...v0.22.0)
```
</details>

<details>
<summary>What changed in the templates</summary>

- The narrative overview paragraph and the `**Why upgrade:**` block are
gone — the latter restated `What's New` verbatim.
- `What's New` entries are bullets, not `###` prose blocks.
- Tone guidance is no longer restated in the skill; it points at
CLAUDE.md § How You Communicate.
- The skill's embedded example now shows the old prose block as **bad**
and the bullet form as **good**.
- Emoji removed from the CI prompt (it asked for 🚀 / 🎯 / 🐛 headings
against the skill's own no-emoji rule).
- Both generators now emit the same sections in the same order, so the
file's shape no longer depends on which one ran.
- The cap excludes `Bug Fixes` / `Known Issues` / `Contributors` / `Full
Changelog`. Those are reference lists sized by how many fixes shipped —
capping them would hide work. This was caught by regenerating v0.22.0,
which overflowed a whole-file cap purely on its 14 bug-fix bullets.

**Follow-up, not in this PR:** the cap lives in prompt text, so it is
advisory. Making it a hard check in `util/validate_release_notes.py`
would enforce it in CI.
</details>

## Test plan

- [ ] `python util/validate_release_notes.py <regenerated sample> --tag
v0.23.0` exits 0 — passes unmodified, no validator changes in this PR
- [ ] `awk '/^## (Bug Fixes|Known Issues|Contributors|Full
Changelog)/{exit} {print}' <file> | wc -w` is under 350 (patch) / 600
(minor-major)
- [ ] `.github/workflows/claude.yml` parses as valid YAML and its
release-notes prompt contains no emoji
- [ ] `.claude/skills/gaia-release/SKILL.md` is under 500 lines (498)
- [ ] Both generators list the same sections in the same order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents dependencies Dependency updates devops DevOps/infrastructure changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants