integrate-gaia

Integrate the @amd-gaia/gaia npm package to run or embed GAIA's local agent sidecar.

1.6k|168|Updated Dec 16, 2024
One-click install
npx skills add https://github.com/amd/gaia --skill integrate-gaia-amd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integrate-gaia
Source: https://github.com/amd/gaia/tree/main/hub/agents/gaia/npm
Command: npx skills add https://github.com/amd/gaia --skill integrate-gaia-amd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @amd-gaia/gaia.

What problem does it solve? Wiring the @amd-gaia/gaia npm package into a Node, TypeScript, or Electron app involves non-obvious details: a SHA-256 integrity gate that blocks fetches, platform gaps in the sidecar builds, a streaming SSE query contract, and authentication and confirmation behaviors that differ between transports. This Skill captures those rules so an integration works on the first attempt instead of after debugging 401s, 409s, and silent refusals. ## Core Features & Use Cases - Binary delivery and verification: Explains how the package fetches and SHA-256 verifies the agent sidecar and terminal UI against binaries.lock.json, including placeholder-hash blocking and platform coverage gaps (no linux-arm64 or win32-arm64 sidecar). - Sidecar lifecycle and REST contract: Covers startSidecar/shutdown tree-kill semantics, caller-auth bearer tokens, the /v1/gaia/query SSE event vocabulary, session_id retention, and cancel/respond endpoints. - Use Case: You are embedding GAIA into an Electron app. The Skill tells you to mint a bearer token via the env option, reuse one session_id per conversation, treat needs_confirmation as a terminal refusal over HTTP, and branch on /v1/gaia/init's ready field rather than /health. ## Quick Start Ask the agent to walk you through embedding @amd-gaia/gaia in a Node app, from fetchAll and startSidecar through a streaming /v1/gaia/query call.

Frequently Asked Questions about integrate-gaia

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I embed the GAIA agent in a Node or Electron app?

Install @amd-gaia/gaia, call fetchAll() once to download and SHA-256 verify the binaries, then startSidecar() to spawn the agent on 127.0.0.1:8141. Drive it with POST /v1/gaia/query, which streams Server-Sent Events ending in exactly one final or error event.

How do I call the GAIA sidecar /v1/gaia/query endpoint?

POST a JSON body with query, a caller-minted UUID run_id, a context array, and a reused session_id for conversation continuity. Read the text/event-stream response, handling status, token, tool_call, needs_input, and the terminal final or error events.

Which platforms does the @amd-gaia/gaia sidecar support?

The sidecar builds exist for win32-x64, darwin-arm64, darwin-x64, and linux-x64 only. There is no linux-arm64 or win32-arm64 sidecar; resolving one raises a PlatformError naming the supported set, and the TUI is never launched without an agent.

Why do I get a 401 from /v1/gaia/query when /health is green?

The sidecar requires an Authorization bearer token on every /v1/gaia/* request, while /health, /version, and /v1/gaia/version are exempt. startSidecar and gaia serve mint no token, so the sidecar runs in dev mode; pass GAIA_GAIA_SIDECAR_TOKEN via the env option to enable the check.

Why does the agent refuse to run write_file or shell commands over HTTP?

Eight confirmation-gated tools, including write_file, run_shell_command, and run_python, cannot collect approval over /v1/gaia/query. The stream emits needs_confirmation followed by a terminal final refusal; use the stdio transport, which supports an approval back-channel, for those actions.

Why does the binary fetch fail with a placeholder hash error?

Between releases, binaries.lock.json carries PENDING-replace-with-real-sha256 placeholders, and the fetcher blocks any download before a network call with a PlatformError. This is the intended integrity gate; only a published release contains real hashes, and no flag relaxes it.