diff --git a/.claude/skills/lemonade-client-patterns.md b/.claude/skills/lemonade-client-patterns.md index c771df6bd..cd968b8c3 100644 --- a/.claude/skills/lemonade-client-patterns.md +++ b/.claude/skills/lemonade-client-patterns.md @@ -6,7 +6,7 @@ description: Patterns, gotchas, and conventions for threading changes through Le # Lemonade Client Patterns ## Context -`src/gaia/llm/lemonade_client.py` is GAIA's primary Lemonade HTTP client (~3900 lines). Changes to its interface ripple through `LemonadeProvider`, `VLMClient`, Agent UI routers, `_chat_helpers.py`, `server.py`, and `agents/base/agent.py`. The test suite mixes `responses` (for `requests`-based calls) and `mocker.patch` on `httpx` (for async calls). +`src/gaia/llm/lemonade_client.py` is GAIA's primary Lemonade HTTP client (~4000 lines). Changes to its interface ripple through `LemonadeProvider`, `VLMClient`, Agent UI routers, `_chat_helpers.py`, `server.py`, and `agents/base/agent.py`. The test suite mixes `responses` (for `requests`-based calls) and `mocker.patch` on `httpx` (for async calls). ## Key Patterns @@ -33,7 +33,7 @@ Misconfigured reverse proxies can reflect the `Authorization` header back in a 4 ## Important Files & Locations -- `src/gaia/llm/lemonade_client.py` — Primary client (~3900 lines); `_send_request` is the central chokepoint but 4 bypass sites exist +- `src/gaia/llm/lemonade_client.py` — Primary client (~4000 lines); `_send_request` is the central chokepoint but 4 bypass sites exist - `src/gaia/llm/providers/lemonade.py` — `LemonadeProvider.__init__` uses `backend_kwargs` dict to forward to `LemonadeClient`; add new params with `if param is not None: backend_kwargs["param"] = param` - `src/gaia/llm/vlm_client.py` — `VLMClient.__init__` uses deferred import of `LemonadeClient` - `src/gaia/ui/routers/system.py` — already imports `DEFAULT_CONTEXT_SIZE` from `lemonade_client` (established cross-package import precedent) diff --git a/AGENTS.md b/AGENTS.md index 90617432e..06e86bb01 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -52,8 +52,6 @@ Before starting implementation on a `consumer-critical` issue, confirm it has th ### Stop-the-line (foundational PRs in flight) When a foundational PR (large, cross-cutting, with many downstream dependencies) is in flight, it carries the `stop-the-line` label and pins a comment listing **frozen file paths**. No PRs may merge changes to those paths until the stop-the-line PR lands. -**Currently active:** PR #606 (memory v2). See pinned comment for frozen paths. - ### Parallel agent work - **Parallelize when** file trees are disjoint, no architectural decision is shared, no sequential dependency exists - **Serialize when** the same file tree is touched, when a design-system pattern needs to be pinned first, when one PR's output is the next PR's input diff --git a/CLAUDE.md b/CLAUDE.md index a1cfc9d5c..92ecd6580 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -386,14 +386,20 @@ gaia/ │ │ └── _shared/ # Shared assets for apps │ ├── audio/ # Audio processing (Whisper ASR, Kokoro TTS) │ ├── chat/ # Agent SDK (AgentSDK class, prompts, app entry) +│ ├── code_index/ # Semantic code search (CodeIndexSDK) +│ ├── connectors/ # OAuth-bound external API access (OAuth2 PKCE, keychain token storage, per-agent grants) │ ├── database/ # DatabaseMixin and DatabaseAgent │ ├── electron/ # Electron app integration │ ├── eval/ # Evaluation framework +│ ├── filesystem/ # Filesystem indexing/categorization (FileSystemIndexService) +│ ├── governance/ # Optional action-level governance layer (GovernedAgentMixin) │ ├── img/ # Shared image assets │ ├── installer/ # Install/init commands (gaia init, lemonade installer) │ ├── llm/ # LLM backend clients (Lemonade, Claude, OpenAI) + providers/ │ ├── mcp/ # Model Context Protocol servers/clients +│ ├── messaging/ # Messaging adapters (Telegram) + media→VLM/RAG ingest │ ├── rag/ # Document retrieval (RAG) +│ ├── scratchpad/ # SQLite scratchpad service for structured data analysis │ ├── sd/ # Stable Diffusion tool mixin (SDToolsMixin) │ ├── shell/ # Shell integration │ ├── talk/ # Voice interaction SDK @@ -401,6 +407,10 @@ gaia/ │ ├── ui/ # Agent UI backend (FastAPI server, routers, SSE, database) │ ├── utils/ # Utility modules (FileWatcher, parsing) │ ├── vlm/ # Vision LLM tool mixin (VLMToolsMixin, structured extraction) +│ ├── web/ # Web client utilities (WebClient, SSRF-guarded fetch) +│ ├── device.py # Device compatibility detection (Strix Halo / Radeon VRAM) +│ ├── perf_analysis.py # Perf-log parsing/plotting +│ ├── security.py # Path validation, allow-lists, write guardrails, audit logging │ └── cli.py # Main CLI entry point (all `gaia ` subparsers) ├── tests/ # Test suite │ ├── unit/ # Unit tests @@ -454,15 +464,20 @@ Defined in [`setup.py`](setup.py) under `console_scripts`: | Agent | Location | Description | Default Model | |-------|----------|-------------|---------------| -| **ChatAgent** | `agents/chat/agent.py` | Document Q&A with RAG | Qwen3.5-35B | -| **CodeAgent** | `agents/code/agent.py` | Code generation with orchestration | Qwen3.5-35B | -| **BuilderAgent** | `agents/builder/agent.py` | Scaffolds new agents from templates | Qwen3.5-35B | -| **SummarizeAgent** | `agents/summarize/agent.py` | Document/text summarization | Qwen3.5-35B | -| **JiraAgent** | `agents/jira/agent.py` | Jira issue management | Qwen3.5-35B | -| **BlenderAgent** | `agents/blender/agent.py` | 3D scene automation | Qwen3.5-35B | -| **DockerAgent** | `agents/docker/agent.py` | Container management | Qwen3.5-35B | -| **MedicalIntakeAgent** | `agents/emr/agent.py` | Medical form processing | Qwen3-VL-4B (VLM) | -| **RoutingAgent** | `agents/routing/agent.py` | Intelligent agent selection | Qwen3.5-35B | +| **ChatAgent** | `agents/chat/agent.py` | Chat with RAG, file search, shell | Gemma-4-E4B-it-GGUF (global default) | +| **CodeAgent** | `agents/code/agent.py` | Code generation with orchestration | Qwen3.5-35B-A3B-GGUF | +| **DocumentQAAgent** | `agents/docqa/agent.py` | Document Q&A with RAG | Qwen3.5-35B-A3B-GGUF | +| **BuilderAgent** | `agents/builder/agent.py` | Scaffolds new agents from templates | Qwen3.5-35B-A3B-GGUF | +| **SummarizeAgent** | `agents/summarize/agent.py` | Document/text summarization | Qwen3-4B-Instruct-2507-GGUF | +| **AnalystAgent** | `agents/analyst/agent.py` | Structured data analysis (scratchpad tables) | Qwen3.5-35B-A3B-GGUF (base default) | +| **BrowserAgent** | `agents/browser/agent.py` | Web research (search, fetch, download) | Qwen3.5-35B-A3B-GGUF (base default) | +| **EmailTriageAgent** | `agents/email/agent.py` | Gmail triage, organize, reply | Gemma-4-E4B-it-GGUF (global default) | +| **FileIOAgent** | `agents/fileio/agent.py` | File read/write/edit operations | Qwen3.5-35B-A3B-GGUF (base default) | +| **JiraAgent** | `agents/jira/agent.py` | Jira issue management | Qwen3.5-35B-A3B-GGUF | +| **BlenderAgent** | `agents/blender/agent.py` | 3D scene automation | Qwen3.5-35B-A3B-GGUF (base default) | +| **DockerAgent** | `agents/docker/agent.py` | Container management | Qwen3.5-35B-A3B-GGUF | +| **MedicalIntakeAgent** | `agents/emr/agent.py` | Medical form processing (VLM) | Gemma-4-E4B-it-GGUF | +| **RoutingAgent** | `agents/routing/agent.py` | Intelligent agent selection | Qwen3.5-35B-A3B-GGUF | | **SDAgent** | `agents/sd/agent.py` | Stable Diffusion image generation | SDXL-Turbo | ### Agent Registry & Tool Mixins @@ -472,58 +487,68 @@ New agents are Python classes inheriting from `Agent` (see [`src/gaia/agents/bas | Tool name | Mixin | Purpose | |-----------|-------|---------| | `rag` | `gaia.agents.chat.tools.rag_tools.RAGToolsMixin` | Document retrieval | +| `code_index` | `gaia.agents.code_index.tools.mixin.CodeIndexToolsMixin` | Semantic code search | | `file_search` | `gaia.agents.tools.file_tools.FileSearchToolsMixin` | Fuzzy/glob file search | | `file_io` | `gaia.agents.code.tools.file_io.FileIOToolsMixin` | Read/write/edit files | | `shell` | `gaia.agents.chat.tools.shell_tools.ShellToolsMixin` | Sandboxed shell commands | | `screenshot` | `gaia.agents.tools.screenshot_tools.ScreenshotToolsMixin` | Screen capture | +| `filesystem` | `gaia.agents.tools.filesystem_tools.FileSystemToolsMixin` | Filesystem indexing/categorization | +| `scratchpad` | `gaia.agents.tools.scratchpad_tools.ScratchpadToolsMixin` | SQLite scratchpad for data analysis | +| `browser` | `gaia.agents.tools.browser_tools.BrowserToolsMixin` | Web search/fetch/download | | `sd` | `gaia.sd.mixin.SDToolsMixin` | Stable Diffusion image generation | | `vlm` | `gaia.vlm.mixin.VLMToolsMixin` | Vision LLM / structured extraction | When adding a new tool mixin, register it in `KNOWN_TOOLS` so other agents can compose it by name. ### Default Models -- General tasks: `Qwen3-0.6B-GGUF` -- Code/Agents: `Qwen3.5-35B-A3B-GGUF` -- Vision tasks: `Qwen3-VL-4B-Instruct-GGUF` +- Global default: `Gemma-4-E4B-it-GGUF` (`DEFAULT_MODEL_NAME` in [`src/gaia/llm/lemonade_client.py`](src/gaia/llm/lemonade_client.py)) +- Code/Agents: `Qwen3.5-35B-A3B-GGUF` (CodeAgent, DocumentQAAgent, Jira, Docker, and the base-Agent fallback when `model_id` is unset) +- Vision tasks: `Qwen3-VL-4B-Instruct-GGUF` is a supported vision model, but the EMR/MedicalIntakeAgent's default VLM is currently `Gemma-4-E4B-it-GGUF` ## CLI Commands All commands are registered in [`src/gaia/cli.py`](src/gaia/cli.py). Run `gaia -h` for the authoritative list. **Agents & chat:** -- `gaia chat` - Interactive chat with RAG +- `gaia chat` - Interactive chat with RAG, file search, and shell execution - `gaia chat --ui` - Launch Agent UI (browser-based, requires `[ui]` extras) - `gaia chat --ui --ui-port 8080` - Agent UI on custom port +- `gaia browse` - Web research with search, page fetch, and download tools +- `gaia analyze` - Structured data analysis with scratchpad tables - `gaia talk` - Voice interaction - `gaia prompt ""` - Single prompt to LLM (with system-prompt support) - `gaia llm ""` - Simple LLM queries -- `gaia summarize` - Document summarization +- `gaia summarize` - Document/transcript/email summarization - `gaia blender` - Blender 3D agent - `gaia sd` - Stable Diffusion image generation -- `gaia jira` - Jira integration +- `gaia jira` - Jira / Atlassian integration +- `gaia email` - Email Triage Agent (Gmail, requires Google connector) - `gaia docker` - Docker management **Servers & infrastructure:** - `gaia api` - OpenAI-compatible API server - `gaia mcp {start|stop|status|test|agent|docker|serve|add|list|remove|tools|test-client}` - MCP bridge +- `gaia telegram {start|stop|status}` - Telegram messaging adapter +- `gaia connectors` - Manage external connectors (OAuth, MCP servers) and per-agent grants - `gaia cache {status|clear}` - Cache management +- `gaia memory` - Manage agent memory (bootstrap onboarding, view status) **Setup & utilities:** - `gaia init` - Setup Lemonade Server and download models -- `gaia install` - Install helper (e.g. Lemonade on first run) -- `gaia download` - Download a model +- `gaia install` - Install GAIA components (e.g. Lemonade on first run) +- `gaia uninstall` - Uninstall GAIA components (tiered cleanup of `~/.gaia` and caches) +- `gaia download` - Download all models required for GAIA agents +- `gaia agent` - Manage custom agents (export/import bundles) - `gaia kill` - Kill stray GAIA / Lemonade processes +- `gaia diagnostics` - Bundle logs and system info into a tarball for bug reports +- `gaia stats` - Show GAIA statistics from the most recent run - `gaia test` - Smoke tests -- `gaia yt` - YouTube transcript ingest -- `gaia template` - Scaffold agent templates +- `gaia youtube` - YouTube transcript utilities **Evaluation & analysis** (see [`docs/reference/eval.mdx`](docs/reference/eval.mdx)): -- `gaia eval {fix-code|agent}` - Run evaluation harness -- `gaia gt` - Generate ground truth -- `gaia generate` - Dataset/response generation -- `gaia batch-exp` - Batch experiments -- `gaia report` - Render eval reports -- `gaia visualize` / `gaia perf-vis` - Visualize results +- `gaia eval agent` - Run agent eval benchmark scenarios +- `gaia report` - Generate summary report from an evaluation results directory +- `gaia perf-vis` - Visualize llama.cpp performance metrics from log files **Standalone binaries** (separate `console_scripts`, not subcommands): - `gaia-code` - CodeAgent entry (`src/gaia/agents/code/cli.py`) @@ -593,7 +618,7 @@ The roadmap is at [`docs/roadmap.mdx`](docs/roadmap.mdx) ([live site](https://am - [`docs/plans/docker-containers.mdx`](docs/plans/docker-containers.mdx) - Docker deployment **Key architectural decisions (April 2026):** -- ChatAgent renamed to **GaiaAgent** in v0.20.0 (#696) +- ChatAgent → **GaiaAgent** rename **planned** for v0.20.0 (#696) — not yet in code (class is still `ChatAgent`) - Voice-first is P0 enabling technology (#702) - No context compaction — memory + RAG handles long conversations - Configuration dashboard + Observability dashboard as separate Agent UI panels @@ -835,3 +860,5 @@ When a task fits a Superpowers skill (e.g. `superpowers:brainstorming`, `superpo **Read these before starting related tasks:** - `.claude/skills/lemonade-client-patterns.md` - Patterns, gotchas, and conventions for modifying LemonadeClient and threading changes through its callers (providers, VLM, UI routers, agent base). Covers: deferred import patch targets, assertLogs child logger levels, SSE test hang prevention, 401 error safety, openai.AuthenticationError ordering. (tags: lemonade, authentication, env-vars, testing, httpx, openai-sdk, tdd) + +Directory-based skills also live under `.claude/skills/` (e.g. `.claude/skills/gaia-release/` — invoked via the `gaia-release` Skill). diff --git a/docs/docs.json b/docs/docs.json index 28b2ac92e..3cc1978b5 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -90,7 +90,8 @@ "connectors/index", "connectors/google", "connectors/github", - "security/connections" + "security/connections", + "security/connectors" ] }, { diff --git a/docs/guides/agent-ui.mdx b/docs/guides/agent-ui.mdx index 0cdd837c4..bbae7e9a3 100644 --- a/docs/guides/agent-ui.mdx +++ b/docs/guides/agent-ui.mdx @@ -317,7 +317,7 @@ The agent supports the **Model Context Protocol** in both directions — connect Then restart `gaia chat --ui`. - **pip/PyPI installs (without gaia-ui):** Use the [npm install path](#install-and-launch) — the pip package does not include frontend source files. + **pip/PyPI installs (without gaia-ui):** Use the [npm install path](#install) — the pip package does not include frontend source files. @@ -356,7 +356,7 @@ The agent supports the **Model Context Protocol** in both directions — connect flowchart TD A(["Agent UI (Browser or Electron)"]) --> B(["FastAPI Backend · port 4200"]) B --> C(["GAIA Core SDKs"]) - C --> D(["Lemonade Server · port 8000"]) + C --> D(["Lemonade Server · port 13305"]) B -.- E(["REST API + SSE Streaming"]) B -.- F(["SQLite Database"]) diff --git a/docs/guides/code.mdx b/docs/guides/code.mdx index bb0a05bb9..796fb102d 100644 --- a/docs/guides/code.mdx +++ b/docs/guides/code.mdx @@ -11,7 +11,7 @@ icon: "code" - The Code Agent now focuses on generating full-stack TypeScript web applications (Next.js + Prisma + Tailwind). Python code generation is no longer supported. + The Code Agent is optimized for full-stack TypeScript web apps (Next.js + Prisma + Tailwind), but Python code generation remains fully supported (and is the default for non-TypeScript requests). diff --git a/docs/guides/emr.mdx b/docs/guides/emr.mdx index 65554326d..4b88ea095 100644 --- a/docs/guides/emr.mdx +++ b/docs/guides/emr.mdx @@ -41,7 +41,7 @@ flowchart TD linkStyle 0,1,2,3 stroke:#ED1C24,stroke-width:2px ``` -1. **Vision Language Model (VLM)** - The Qwen3-VL-4B model "sees" the intake form image and extracts text using a carefully crafted prompt that guides it to identify specific fields (name, DOB, allergies, medications, etc.). Unlike traditional OCR, the VLM understands context—it knows that "DOB" means date of birth and can handle handwritten entries, checkboxes, and varied form layouts. +1. **Vision Language Model (VLM)** - The Gemma-4-E4B-it model "sees" the intake form image and extracts text using a carefully crafted prompt that guides it to identify specific fields (name, DOB, allergies, medications, etc.). Unlike traditional OCR, the VLM understands context—it knows that "DOB" means date of birth and can handle handwritten entries, checkboxes, and varied form layouts. 2. **LLM Validation & Querying** - The Qwen3.5-35B model (a Mixture-of-Experts architecture that activates only 3B parameters per inference) validates extracted data, handles natural language queries, and generates SQL to search the patient database. When you ask "Which patients have penicillin allergies?", the LLM translates this to proper SQL. @@ -55,7 +55,7 @@ flowchart TD - **Automatic file watching** - Monitors a directory for new intake forms - **Drag-and-drop upload** - Drop files directly into the Watch Folder panel -- **VLM-powered extraction** - Uses Qwen3-VL-4B-Instruct for OCR and data extraction +- **VLM-powered extraction** - Uses Gemma-4-E4B-it for OCR and data extraction - **Local database storage** - SQLite with full patient record schema - **New/returning detection** - Identifies returning patients and flags changes - **Critical alerts** - Automatic alerts for allergies and missing fields @@ -69,7 +69,7 @@ The EMR agent uses three models, downloaded automatically on first run via `gaia | Model | Size | Purpose | |-------|------|---------| | Qwen3.5-35B-A3B-GGUF | 18.6 GB | LLM for chat queries and patient search | -| Qwen3-VL-4B-Instruct-GGUF | 3.3 GB | Vision language model for form extraction | +| Gemma-4-E4B-it-GGUF | ~3 GB | Vision language model for form extraction | | nomic-embed-text-v2-moe-GGUF | 522 MB | Embedding model for similarity search | @@ -303,7 +303,7 @@ gaia-emr init This command: - Checks Lemonade server is running and context size is configured - Downloads and loads all required models: - - **VLM**: Qwen3-VL-4B-Instruct-GGUF (form extraction) + - **VLM**: Gemma-4-E4B-it-GGUF (form extraction) - **LLM**: Qwen3.5-35B-A3B-GGUF (chat/query processing) - **Embedding**: nomic-embed-text-v2-moe-GGUF (similarity search) - Verifies all models are loaded and ready @@ -421,7 +421,7 @@ This command: | Command | Description | |---------|-------------| - | `init` | Download required models (VLM, optional LLM/embedding) | + | `init` | Download all required models (VLM, LLM, embedding) | | `watch` | Watch folder and process forms | | `process` | Process a single form file and exit | | `dashboard` | Launch web dashboard (Electron or browser) | @@ -660,7 +660,7 @@ If `gaia-emr init` fails repeatedly or the agent won't start due to model errors 2. Navigate to the model cache directory: - Windows: `%LOCALAPPDATA%\AMD\LemonadeModels\` - Linux: `~/.local/share/lemonade/models/` -3. Delete the corrupted model folder (e.g., `Qwen3-VL-4B-Instruct-GGUF/`) +3. Delete the corrupted model folder (e.g., `Gemma-4-E4B-it-GGUF/`) 4. Restart Lemonade Server 5. Run `gaia-emr init` again to re-download diff --git a/docs/guides/telegram.mdx b/docs/guides/telegram.mdx deleted file mode 100644 index d77edb478..000000000 --- a/docs/guides/telegram.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Telegram Messaging Adapter ---- - -This page documents the v0.18.2 Telegram messaging adapter scaffold. - -Status: scaffolded — implementation work in progress. - -Acceptance criteria (v0.18.2): - -- `gaia telegram --token ` starts the adapter (scaffold currently logs and exits). -- `/start` command replies within 5 seconds. -- Streaming responses use message edits via `send_stream` from `AgentSDK`. - -Next steps: - -- Implement runtime using `python-telegram-bot` Application and handlers. -- Wire uploads to VLM/RAG ingestion. -- Add tests for allowed-users gate and restricted tools enforcement. diff --git a/docs/reference/cli.mdx b/docs/reference/cli.mdx index 0f05d12bc..16638b514 100644 --- a/docs/reference/cli.mdx +++ b/docs/reference/cli.mdx @@ -126,7 +126,7 @@ gaia init [OPTIONS] | Option | Type | Default | Description | |--------|------|---------|-------------| -| `--profile, -p` | string | chat | Profile to initialize (minimal, sd, chat, code, rag, mcp, vlm, all) | +| `--profile, -p` | string | chat | Profile to initialize (minimal, sd, chat, code, rag, mcp, vlm, npu, all) | | `--minimal` | flag | false | Shortcut for `--profile minimal` | | `--skip-models` | flag | false | Skip model downloads (only install Lemonade) | | `--skip-lemonade` | flag | false | Skip Lemonade installation check (for CI with pre-installed Lemonade) | @@ -151,6 +151,7 @@ canonical choices list): | `rag` | Qwen3.5-35B, nomic-embed, Qwen3-VL-4B | Document Q&A with retrieval and vision | ~25 GB | | `mcp` | Qwen3.5-35B, nomic-embed, Qwen3-VL-4B | Model Context Protocol bridge server with vision | ~25 GB | | `vlm` | Qwen3-VL-4B | Image understanding and analysis | ~3 GB | +| `npu` | Qwen3.5-35B, nomic-embed, Qwen3-VL-4B | Ryzen AI NPU-optimized models | ~25 GB | | `all` | All models | All models for all agents | ~26 GB | @@ -797,7 +798,7 @@ gaia sd [OPTIONS] |--------|------|---------|-------------| | `prompt` | string | - | Text description of the image to generate | | `-i, --interactive` | flag | false | Run in interactive mode | -| `--sd-model` | string | SD-Turbo | Model: SD-Turbo (fast, default), SDXL-Turbo, SDXL-Base-1.0 (photorealistic), SD-1.5 | +| `--sd-model` | string | SDXL-Turbo | Model: SDXL-Turbo (fast, good quality, default), SD-Turbo (faster but lower quality), SDXL-Base-1.0 (photorealistic), SD-1.5 | | `--size` | string | auto | Image size: 512x512, 768x768, 1024x1024 (auto-selected per model) | | `--steps` | integer | auto | Inference steps (auto: 4 for Turbo, 20 for Base) | | `--cfg-scale` | float | auto | CFG scale (auto: 1.0 for Turbo, 7.5 for Base) | @@ -807,14 +808,14 @@ gaia sd [OPTIONS] **Examples:** -Fast generation with default (SD-Turbo, ~13s): +Fast generation with default (SDXL-Turbo): ```bash gaia sd "a sunset over mountains" ``` -Better quality with SDXL-Turbo (~17s): +Faster but lower quality with SD-Turbo: ```bash -gaia sd "cyberpunk city at night" --sd-model SDXL-Turbo +gaia sd "cyberpunk city at night" --sd-model SD-Turbo ``` Photorealistic with SDXL-Base-1.0 (slow, ~9min): @@ -880,6 +881,128 @@ gaia talk -i guide.pdf --no-tts --- +### Summarize Command + + + Summarize transcripts, emails, and PDFs into multiple styles + + +```bash +gaia summarize -i [OPTIONS] +``` + +**Options:** + +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `-i, --input` | path | - | Input file or directory (required unless `--list-configs`) | +| `-o, --output` | path | auto | Output file/directory (auto-adjusted by format) | +| `-t, --type` | choice | auto | Input type: `transcript`, `email`, `pdf`, `auto` | +| `-f, --format` | choice | json | Output format: `json`, `pdf`, `email`, `both` | +| `--styles` | choice(s) | executive participants action_items | One or more of `brief`, `detailed`, `bullets`, `executive`, `participants`, `action_items`, `all` | +| `--max-tokens` | integer | 1024 | Maximum tokens for summary | +| `--email-to` | string | - | Recipients (comma-separated) for `email` format | +| `--email-subject` | string | auto | Email subject line | +| `--email-cc` | string | - | CC recipients (comma-separated) | +| `--config` | path | - | Predefined configuration file from `configs/` | +| `--list-configs` | flag | false | List available configuration templates | +| `--quiet` | flag | false | Minimal output | +| `--verbose` | flag | false | Detailed/debug output | +| `--combined-prompt` | flag | false | Combine styles into a single LLM call (experimental) | +| `--no-viewer` | flag | false | Don't auto-open the HTML viewer for JSON output | + +**Examples:** + + +```bash Summarize a transcript +gaia summarize -i meeting.txt +``` + +```bash PDF to PDF +gaia summarize -i report.pdf -f pdf +``` + +```bash Specific styles +gaia summarize -i meeting.txt --styles brief action_items +``` + + +[→ Full Summarize Documentation](/guides/summarize) + +--- + +### Jira Command + + + Manage Jira issues with natural language + + +```bash +gaia jira "" [OPTIONS] +``` + +**Options:** + +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `command` | string | - | Natural language command (e.g., "Create a bug report for login issue") | +| `-i, --interactive` | flag | false | Run in interactive mode for continuous commands | +| `--mcp-host` | string | localhost | MCP bridge host | +| `--mcp-port` | integer | 8765 | MCP bridge port | +| `-v, --verbose` | flag | false | Enable verbose output | +| `-d, --debug` | flag | false | Enable debug logging | + +**Examples:** + + +```bash One-shot command +gaia jira "Create a bug report for the login page" +``` + +```bash Interactive +gaia jira -i +``` + + +[→ Full Jira Integration Guide](/guides/jira) + +--- + +### Docker Command + + + Containerize applications with natural language + + +```bash +gaia docker "" [OPTIONS] +``` + +**Options:** + +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `command` | string | - | Natural language command (e.g., "Create a Dockerfile for my Flask app") | +| `-d, --directory` | path | current directory | Directory to analyze/containerize | +| `-v, --verbose` | flag | false | Enable verbose output | +| `--debug` | flag | false | Enable debug logging | + +**Examples:** + + +```bash Generate a Dockerfile +gaia docker "Create a Dockerfile for my Flask app" +``` + +```bash Target a directory +gaia docker "Containerize this project" -d ./my-app +``` + + +[→ Full Docker Management Guide](/guides/docker) + +--- + ## API Server @@ -914,7 +1037,6 @@ curl http://localhost:8080/health **Options:** - `--host` - Server host (default: localhost) - `--port` - Server port (default: 8080). The `gaia mcp docker` bridge defaults to the same port — run them on different ports if you need both. - - `--background` - Run in background - `--debug` - Enable debug logging - `--show-prompts` - Log the prompts sent to the LLM for every request (useful for debugging) - `--streaming` - Stream tokens to clients via SSE (OpenAI-style) @@ -927,9 +1049,9 @@ curl http://localhost:8080/health gaia api start ``` - Background with debug: + With debug logging: ```bash - gaia api start --background --debug + gaia api start --debug ``` Custom host/port: @@ -970,35 +1092,10 @@ curl http://localhost:8080/health Connect GAIA agents to external MCP servers -Configure MCP servers that your agents can connect to. Servers are saved to `~/.gaia/mcp_servers.json` by default, or to a custom config file using `--config`. +Configure MCP servers that your agents can connect to. Servers are defined in `~/.gaia/mcp_servers.json` by default (one entry per server with its launch command), or in a custom config file passed via `--config`. ### Commands -#### `gaia mcp add` - -Add an MCP server to configuration. - -```bash -gaia mcp add "" [--config PATH] -``` - -**Arguments:** -- `` - Unique identifier for the server (e.g., "time", "memory") -- `""` - Shell command to start the MCP server (must be quoted) - -**Options:** -- `--config PATH` - Custom config file path (default: `~/.gaia/mcp_servers.json`) - -**Examples:** -```bash -# Add to user config (default) -gaia mcp add time "uvx mcp-server-time" -gaia mcp add memory "npx -y @modelcontextprotocol/server-memory" - -# Add to project config (can be committed to git) -gaia mcp add time "uvx mcp-server-time" --config ./mcp_servers.json -``` - #### `gaia mcp list` List all configured MCP servers. @@ -1019,29 +1116,6 @@ gaia mcp list gaia mcp list --config ./mcp_servers.json ``` -#### `gaia mcp remove` - -Remove an MCP server from configuration. - -```bash -gaia mcp remove [--config PATH] -``` - -**Arguments:** -- `` - Name of the server to remove - -**Options:** -- `--config PATH` - Custom config file path (default: `~/.gaia/mcp_servers.json`) - -**Example:** -```bash -# Remove from user config -gaia mcp remove time - -# Remove from project config -gaia mcp remove memory --config ./mcp_servers.json -``` - #### `gaia mcp tools` List tools available from a configured MCP server. @@ -1070,15 +1144,12 @@ gaia mcp tools memory --config ./mcp_servers.json Test connection to a configured MCP server. ```bash -gaia mcp test-client [--config PATH] +gaia mcp test-client ``` **Arguments:** - `` - Name of the server to test -**Options:** -- `--config PATH` - Custom config file path (default: `~/.gaia/mcp_servers.json`) - **Example:** ```bash gaia mcp test-client time @@ -1180,7 +1251,7 @@ gaia download [OPTIONS] | `--list` | flag | false | List required models without downloading | | `--timeout` | integer | 1800 | Timeout per model in seconds | | `--host` | string | localhost | Lemonade server host | -| `--port` | integer | 8000 | Lemonade server port | +| `--port` | integer | 13305 | Lemonade server port | | `--clear-cache` | flag | false | Remove cached download progress/metadata before running | **Available Agents:** @@ -1258,34 +1329,12 @@ Use `lemonade-server list` to see all available models and their download status **Tools for:** -- Ground Truth Generation -- Automated Evaluation -- Batch Experimentation -- Performance Analysis -- Transcript Testing +- Scenario-based agent evaluation (`gaia eval agent`) +- Report generation (`gaia report`) +- Performance visualization (`gaia perf-vis`) **Quick Examples:** -Generate evaluation data: -```bash -gaia groundtruth -f ./data/document.html -``` - -Create sample experiment configuration: -```bash -gaia batch-experiment --create-sample-config experiments.json -``` - -Run systematic experiments: -```bash -gaia batch-experiment -c experiments.json -i ./data -o ./results -``` - -Evaluate results: -```bash -gaia eval -f ./results/experiment.json -``` - Run agent eval benchmark: ```bash gaia eval agent # Run all scenarios @@ -1298,12 +1347,12 @@ gaia eval agent --compare run1/scorecard.json run2/scorecard.json # Compare run Generate report: ```bash -gaia report -d ./eval_results +gaia report -d ./output/eval ``` -Launch visualizer: +Launch performance visualizer: ```bash -gaia visualize +gaia perf-vis ``` [→ Full Evaluation Guide](/reference/eval) @@ -1409,56 +1458,6 @@ gaia eval agent --scenario-dir ~/my-project/eval-scenarios --- -### Visualize Command - -Launch interactive web-based visualizer for comparing evaluation results. - -```bash -gaia visualize [OPTIONS] -``` - -**Options:** - -| Option | Type | Default | Description | -|--------|------|---------|-------------| -| `--port` | integer | 3000 | Visualizer server port | -| `--experiments-dir` | path | ./output/experiments | Experiments directory | -| `--evaluations-dir` | path | ./output/evaluations | Evaluations directory | -| `--workspace` | path | current directory | Base workspace directory | -| `--no-browser` | flag | false | Don't auto-open browser | -| `--host` | string | localhost | Host address | - -**Examples:** - - -```bash Default -gaia visualize -``` - -```bash Custom Directories -gaia visualize \ - --experiments-dir ./my_experiments \ - --evaluations-dir ./my_evaluations -``` - -```bash Custom Port -gaia visualize --port 8080 --no-browser -``` - - -**Features:** -- Interactive Comparison (side-by-side) -- Key Metrics Dashboard -- Quality Analysis -- Real-time Updates -- Responsive Design - - -Node.js must be installed. Dependencies are automatically installed on first run. - - ---- - ## Memory @@ -1677,77 +1676,86 @@ gaia cache clear --all --- -### Kill Command +### Diagnostics Command -Terminate processes running on specific ports. +Bundle system info and logs into a tarball for bug reports. ```bash -gaia kill [OPTIONS] +gaia diagnostics [OPTIONS] ``` **Options:** -| Option | Type | Description | -|--------|------|-------------| -| `--port` | integer | Port number to kill process on | -| `--lemonade` | flag | Kill Lemonade server (port 8000) | +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `--output` | path | `~/.gaia/diagnostics-.tgz` | Destination path for the tarball | +| `--no-logs` | flag | false | Omit log files (useful for public bug reports) | **Examples:** -```bash Kill Lemonade Server -gaia kill --lemonade +```bash Full Bundle +gaia diagnostics +# → ~/.gaia/diagnostics-20260422-173000.tgz +``` + +```bash Without Logs +gaia diagnostics --no-logs ``` -```bash Kill by Port -gaia kill --port 8000 +```bash Custom Output Path +gaia diagnostics --output /tmp/my-bundle.tgz ``` -This command will: -- Find the process ID (PID) bound to the specified port -- Forcefully terminate that process -- Provide feedback about success or failure +The bundle includes: +- System info snapshot (`uname -a`, distro, relevant env vars, all TCP listeners via `ss -tlnp`) +- State files from `~/.gaia/` (config, session data — no chat content) +- Log files: `~/.gaia/gaia.log` and `~/.gaia/electron-main.log` (omitted with `--no-logs`) --- -### Diagnostics Command +### Telegram Command -Bundle system info and logs into a tarball for bug reports. +Run a Telegram bot adapter that routes messages to a GAIA agent. ```bash -gaia diagnostics [OPTIONS] +gaia telegram {start|stop|status} [OPTIONS] ``` -**Options:** +**Actions:** + +| Action | Description | +|--------|-------------| +| `start` | Start the Telegram adapter (polling) | +| `stop` | Stop a background Telegram adapter | +| `status` | Show adapter status | + +**`gaia telegram start` options:** | Option | Type | Default | Description | |--------|------|---------|-------------| -| `--output` | path | `~/.gaia/diagnostics-.tgz` | Destination path for the tarball | -| `--no-logs` | flag | false | Omit log files (useful for public bug reports) | +| `--token` | string | required | Telegram bot token | +| `--allowed-users` | string | allow all | Comma-separated Telegram user IDs allowed to interact | +| `--background` | flag | false | Run in background/daemon mode (writes PID and health endpoint) | **Examples:** -```bash Full Bundle -gaia diagnostics -# → ~/.gaia/diagnostics-20260422-173000.tgz +```bash Start (foreground) +gaia telegram start --token ``` -```bash Without Logs -gaia diagnostics --no-logs +```bash Start in background, restricted users +gaia telegram start --token --allowed-users 12345,67890 --background ``` -```bash Custom Output Path -gaia diagnostics --output /tmp/my-bundle.tgz +```bash Status / stop +gaia telegram status +gaia telegram stop ``` -The bundle includes: -- System info snapshot (`uname -a`, distro, relevant env vars, all TCP listeners via `ss -tlnp`) -- State files from `~/.gaia/` (config, session data — no chat content) -- Log files: `~/.gaia/gaia.log` and `~/.gaia/electron-main.log` (omitted with `--no-logs`) - --- ## Global Options diff --git a/docs/sdk/sdks/chat.mdx b/docs/sdk/sdks/chat.mdx index 20c0488b6..4bc8af3b3 100644 --- a/docs/sdk/sdks/chat.mdx +++ b/docs/sdk/sdks/chat.mdx @@ -25,7 +25,7 @@ Configure your chat session: ```python @dataclass class AgentConfig: - model: str = "Qwen3-0.6B-GGUF" # Default validated model (DEFAULT_MODEL_NAME) + model: str = "Gemma-4-E4B-it-GGUF" # Default validated model (DEFAULT_MODEL_NAME) max_tokens: int = 512 temperature: Optional[float] = None system_prompt: Optional[str] = None diff --git a/docs/sdk/sdks/llm.mdx b/docs/sdk/sdks/llm.mdx index 051e459d4..c6f28afb1 100644 --- a/docs/sdk/sdks/llm.mdx +++ b/docs/sdk/sdks/llm.mdx @@ -80,7 +80,7 @@ response = llm_claude.generate("Explain Python decorators") from gaia.llm.lemonade_client import DEFAULT_MODEL_NAME, DEFAULT_LEMONADE_URL # Default configuration -MODEL = DEFAULT_MODEL_NAME # "Qwen3-0.6B-GGUF" +MODEL = DEFAULT_MODEL_NAME # "Gemma-4-E4B-it-GGUF" URL = DEFAULT_LEMONADE_URL # "http://localhost:13305/api/v1" # Used internally by LLMClient when no provider specified