Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test_code_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
paths:
- 'hub/agents/python/code/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/routing/**'
- 'hub/agents/python/routing/**'
- 'setup.py'
- '.github/workflows/test_code_agent.yml'
pull_request:
Expand All @@ -22,7 +22,7 @@ on:
paths:
- 'hub/agents/python/code/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/routing/**'
- 'hub/agents/python/routing/**'
- 'setup.py'
- '.github/workflows/test_code_agent.yml'
merge_group:
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/test_docqa_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT

# Tests the GAIA Document Q&A agent, which ships as the standalone gaia-agent-docqa
# wheel (#1102).

name: DocQA Agent Tests

on:
workflow_call:
push:
branches: [ main ]
paths:
- 'hub/agents/python/docqa/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/tools/**'
- 'setup.py'
- '.github/workflows/test_docqa_agent.yml'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'hub/agents/python/docqa/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/tools/**'
- 'setup.py'
- '.github/workflows/test_docqa_agent.yml'
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test-docqa-agent:
name: Test DocQA Agent
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')

steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
uv pip install --system -e .[dev]
# DocumentQAAgent ships as the standalone gaia-agent-docqa wheel (#1102)
uv pip install --system -e hub/agents/python/docqa

- name: Run DocQA Agent Tests
run: |
python -m pytest hub/agents/python/docqa/tests/ -v --tb=short
16 changes: 15 additions & 1 deletion .github/workflows/test_gaia_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ jobs:
uses: ./.github/workflows/test_browser_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')

# Test DocQA Agent (standalone hub wheel, #1102)
test-docqa-agent:
name: DocQA Agent Tests
needs: lint
uses: ./.github/workflows/test_docqa_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')

# Test Routing Agent (standalone hub wheel, #1102)
test-routing-agent:
name: Routing Agent Tests
needs: lint
uses: ./.github/workflows/test_routing_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')

# Test Security features
test-security:
name: Security Tests
Expand All @@ -105,7 +119,7 @@ jobs:
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [lint, unit-tests, test-windows, test-linux, test-mcp, test-code-agent, test-chat-agent, test-connectors-demo, test-analyst-agent, test-browser-agent, test-security]
needs: [lint, unit-tests, test-windows, test-linux, test-mcp, test-code-agent, test-chat-agent, test-connectors-demo, test-analyst-agent, test-browser-agent, test-docqa-agent, test-routing-agent, test-security]
# Run always except when workflow or any dependency is cancelled (e.g., by cancel-in-progress)
if: >-
${{ always() && !cancelled() &&
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/test_routing_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT

# Tests the GAIA Routing agent, which ships as the standalone gaia-agent-routing
# wheel (#1102).

name: Routing Agent Tests

on:
workflow_call:
push:
branches: [ main ]
paths:
- 'hub/agents/python/routing/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/registry.py'
- 'src/gaia/api/agent_registry.py'
- 'setup.py'
- '.github/workflows/test_routing_agent.yml'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'hub/agents/python/routing/**'
- 'src/gaia/agents/base/**'
- 'src/gaia/agents/registry.py'
- 'src/gaia/api/agent_registry.py'
- 'setup.py'
- '.github/workflows/test_routing_agent.yml'
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test-routing-agent:
name: Test Routing Agent
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')

steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
uv pip install --system -e .[dev]
# RoutingAgent ships as the standalone gaia-agent-routing wheel (#1102)
uv pip install --system -e hub/agents/python/routing

- name: Run Routing Agent Tests
run: |
python -m pytest hub/agents/python/routing/tests/ -v --tb=short
6 changes: 4 additions & 2 deletions hub/agents/python/code/gaia_agent_code/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def cmd_run(args):
return 1

try:
# Import RoutingAgent for intelligent language detection
from gaia.agents.routing.agent import RoutingAgent
# Import RoutingAgent for intelligent language detection. It ships as
# the standalone gaia-agent-routing wheel (#1102), declared as a
# dependency of this package.
from gaia_agent_routing.agent import RoutingAgent

# Handle --path argument
project_path = args.path if hasattr(args, "path") else None
Expand Down
4 changes: 3 additions & 1 deletion hub/agents/python/code/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ authors = [{ name = "AMD" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["amd-gaia>=0.20.0"]
# gaia-agent-routing: the `gaia-code` query path routes through RoutingAgent
# for language/project-type detection (#1102).
dependencies = ["amd-gaia>=0.20.0", "gaia-agent-routing>=0.1.0"]

[project.entry-points."gaia.agent"]
code = "gaia_agent_code:build_registration"
Expand Down
22 changes: 22 additions & 0 deletions hub/agents/python/docqa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# gaia-agent-docqa

Standalone GAIA agent — RAG-focused document Q&A and indexing. Depends on the published
`amd-gaia` framework wheel.

## Install

```bash
pip install gaia-agent-docqa # from PyPI (once published)
pip install -e hub/agents/python/docqa # editable, for development
```

Installing registers the `docqa` agent via the `gaia.agent` entry-point group;
the GAIA registry discovers it automatically. It is a building-block agent,
hidden from the UI selector by default.

## Develop / test

```bash
pip install -e ".[test]"
pytest hub/agents/python/docqa/tests/ -x
```
35 changes: 35 additions & 0 deletions hub/agents/python/docqa/gaia-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
id: docqa
name: Document Q&A
version: 0.1.0
description: "GAIA Document Q&A agent — RAG document Q&A and indexing"
author: AMD
license: MIT

category: productivity
tags: [rag, documents, qa, retrieval]
icon: file-search
tools_count: 0

language: python
min_gaia_version: "0.20.0"
models: [Qwen3.5-35B-A3B-GGUF]

python:
entry_module: gaia_agent_docqa
entry_class: DocumentQAAgent
dependencies:
- "amd-gaia>=0.20.0"

requirements:
min_memory_gb: 8
platforms: [win-x64, linux-x64, darwin-arm64]

permissions:
- filesystem:read

interfaces:
tui: false
cli: false
pipe: true
api_server: true
mcp_server: true
55 changes: 55 additions & 0 deletions hub/agents/python/docqa/gaia_agent_docqa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
"""GAIA Document Q&A agent — standalone hub package.

Registers the ``docqa`` agent (RAG document Q&A) into the GAIA registry via the
``gaia.agent`` entry-point group. It is a building-block agent, hidden from the
UI selector by default. The agent module is imported lazily so registry
discovery stays cheap.
"""

# Re-exported lazily via ``__getattr__``; intentionally absent from ``__all__``.
__all__ = ["build_registration"]

__version__ = "0.1.0"

_LAZY = {"DocumentQAAgent": "agent", "DocumentQAAgentConfig": "agent"}


def __getattr__(name):
if name in _LAZY:
import importlib

module = importlib.import_module(f"gaia_agent_docqa.{_LAZY[name]}")
return getattr(module, name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def build_registration():
"""Return the :class:`AgentRegistration` for the docqa agent."""
from gaia.agents.registry import AgentRegistration, class_factory

def factory(**kwargs):
from gaia_agent_docqa.agent import DocumentQAAgent

return class_factory(DocumentQAAgent)(**kwargs)

return AgentRegistration(
id="docqa",
name="Document Q&A",
description="RAG-focused agent for document Q&A and indexing",
source="installed",
conversation_starters=[
"Index the documents in ./docs and summarize them",
"What does my report say about Q3 revenue?",
],
factory=factory,
agent_dir=None,
models=["Qwen3.5-35B-A3B-GGUF"],
hidden=True,
namespaced_agent_id="installed:docqa",
category="productivity",
tags=["rag", "documents", "qa", "retrieval"],
icon="file-search",
tools_count=0,
)
22 changes: 22 additions & 0 deletions hub/agents/python/docqa/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "gaia-agent-docqa"
version = "0.1.0"
description = "GAIA Document Q&A agent — RAG document Q&A and indexing"
authors = [{ name = "AMD" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["amd-gaia>=0.20.0"]

[project.entry-points."gaia.agent"]
docqa = "gaia_agent_docqa:build_registration"

[project.optional-dependencies]
test = ["pytest"]

[tool.setuptools.packages.find]
include = ["gaia_agent_docqa*"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT

"""Unit tests for DocumentQAAgent (gaia.agents.docqa).
"""Unit tests for DocumentQAAgent (gaia_agent_docqa).

The agent constructs a RAGSDK at init (no network/model load at construction)
and registers RAG + file tools. ``skip_lemonade=True`` is hardcoded, so no
Expand All @@ -14,15 +14,15 @@

class TestDocumentQAAgentImport(unittest.TestCase):
def test_can_import(self):
from gaia.agents.docqa.agent import DocumentQAAgent, DocumentQAAgentConfig
from gaia_agent_docqa.agent import DocumentQAAgent, DocumentQAAgentConfig

self.assertIsNotNone(DocumentQAAgent)
self.assertIsNotNone(DocumentQAAgentConfig)


class TestDocumentQAAgentConfig(unittest.TestCase):
def test_defaults(self):
from gaia.agents.docqa.agent import DocumentQAAgentConfig
from gaia_agent_docqa.agent import DocumentQAAgentConfig

cfg = DocumentQAAgentConfig()
self.assertFalse(cfg.use_claude)
Expand All @@ -33,7 +33,7 @@ def test_defaults(self):

class TestDocumentQAAgentInit(unittest.TestCase):
def _make(self):
from gaia.agents.docqa.agent import DocumentQAAgent, DocumentQAAgentConfig
from gaia_agent_docqa.agent import DocumentQAAgent, DocumentQAAgentConfig

return DocumentQAAgent(DocumentQAAgentConfig())

Expand Down
Loading
Loading