Skip to content

feat(knowledge): Hub agent packaging — gaia-agent.yaml, CLI entry point, MCP server #1145

@kovtcharov-amd

Description

@kovtcharov-amd

Phase 1 — Foundation

Scaffold the Knowledge Agent as a Hub agent with dual-layer Tavily integration (connector for auth + Python SDK for runtime).

Agent class

```python
class KnowledgeAgent(Agent):
name = "knowledge"
description = "Build local knowledge bases from web + local docs, query with local LLM"
default_model = "Qwen3.5-35B-A3B-GGUF"

REQUIRED_CONNECTORS = [
    ConnectorRequirement(
        connector_id="tavily",
        scopes=[],
        reason="Crawl websites and search the web for your knowledge base.",
    ),
]

```

Package structure

```
hub/agents/python/knowledge/
├── gaia-agent.yaml # connectors: [{id: tavily}]
├── pyproject.toml # amd-gaia + tavily-python
├── gaia_agent_knowledge/
│ ├── agent.py # KnowledgeAgent with REQUIRED_CONNECTORS
│ ├── cli.py # gaia-knowledge index|ask|search|...
│ ├── tavily_client.py # Reads key from keyring, wraps Python SDK
│ ├── crawler.py # TavilyClient.crawl → markdown files
│ ├── indexer.py # Markdown → RAG index
│ ├── knowledge_base.py # KB lifecycle management
│ ├── search.py # TavilyClient.search + cache
│ ├── cache.py # SQLite result cache
│ ├── credits.py # Credit tracking
│ ├── config.py # Preferences
│ ├── planner.py # Agent: research planning
│ ├── synthesizer.py # Agent: cross-source synthesis
│ └── tools/ # @tool wrappers for agent's MCP server
├── tests/
└── README.md
```

Deliverables

  • `gaia-agent.yaml` manifest with `connectors: [{id: tavily}]` and `tavily-python` dep
  • `KnowledgeAgent(Agent)` with `REQUIRED_CONNECTORS`
  • CLI with subcommands: index, ask, search, extract, list, credits, config
  • `--mcp` flag for MCP stdio server (via `AgentMCPServer`)
  • Graceful startup when Tavily connector not configured (warn + enable fallback)
  • Installable via `pip install -e hub/agents/python/knowledge`

Plan: `docs/plans/knowledge-agent.mdx` § "Packaging & Distribution"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions