Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions docs/guides/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ gaia chat
# Show performance metrics
gaia chat --stats
```

```bash Verbose Output
# Show detailed agent output (thoughts, goals, tool results)
gaia chat --verbose
```
</CodeGroup>

<AccordionGroup>
Expand Down
9 changes: 8 additions & 1 deletion docs/guides/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,18 @@ your-app/
## Debug and Trace Options

<CardGroup cols={2}>
<Card title="Verbose Output" icon="terminal">
```bash
gaia-code "Create a todo tracking app in nextjs" --verbose
```
Show detailed agent output (thoughts, goals, plans, tool results)
</Card>

<Card title="Debug Logging" icon="bug">
```bash
gaia-code "Create a todo tracking app in nextjs" --debug
```
See internal decision logs
See internal decision logs (implies --verbose)
</Card>

<Card title="JSON Trace" icon="file-code">
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,14 @@ All commands support these global options:

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `--verbose` | flag | off | Show detailed agent output (thoughts, goals, plans, tool results). Default is minimal, clean output. |
| `--logging-level` | string | INFO | Logging verbosity [DEBUG, INFO, WARNING, ERROR, CRITICAL] |
| `-v, --version` | flag | - | Show program's version and exit |

<Note>
By default, GAIA uses a **minimal console** that shows only LLM answers, brief tool status with spinners, and errors. Use `--verbose` to see the full step-by-step agent output including thoughts, goals, plans, and detailed tool results.
</Note>

---

## Troubleshooting
Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/core/agent-system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ agent = MyAgent(
max_steps=20, # Max reasoning loop iterations
streaming=True, # Stream responses token-by-token
silent_mode=False, # Suppress console output
verbose=False, # Use full AgentConsole output (default: MinimalConsole)

# === Debugging ===
debug_prompts=False, # Print raw prompts to console
Expand Down Expand Up @@ -464,7 +465,8 @@ agent = MyAgent(
|-----------|-----------|------------|-----------|
| `max_steps` | `3` - Quick tasks | `20` - Complex workflows | Speed vs. thoroughness |
| `streaming` | `False` - Wait for complete response | `True` - See tokens as generated | Latency vs. responsiveness |
| `silent_mode` | `False` - See all output | `True` - Only get results | Visibility vs. clean output |
| `verbose` | `False` - Clean, minimal output (default) | `True` - Full step-by-step agent output | Clarity vs. visibility |
| `silent_mode` | `False` - See output | `True` - Only get results | Visibility vs. programmatic use |

---

Expand Down
44 changes: 38 additions & 6 deletions docs/sdk/core/console.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: "terminal"
</Info>

<Note>
**Import:** `from gaia.agents.base.console import AgentConsole, SilentConsole`
**Import:** `from gaia.agents.base.console import MinimalConsole, AgentConsole, SilentConsole`
</Note>
---

Expand All @@ -20,23 +20,54 @@ icon: "terminal"

---

## AgentConsole (Rich CLI Output)
## MinimalConsole (Default)

```python
from gaia.agents.base.console import MinimalConsole

class MyAgent(Agent):
def _create_console(self):
# Clean, minimal output (default behavior)
return MinimalConsole()

# Shows:
# - LLM answers (streamed as markdown)
# - Tool calls (one-line with spinner)
# - Brief tool output (key results, not raw JSON)
# - Errors and warnings (inline)
#
# Suppresses:
# - Agent internals (thoughts, goals, plans, step numbers)
# - Full JSON dumps of tool arguments/results
# - Decorative panels and separators
```

`MinimalConsole` is the **default** output handler for all agents. It provides a clean, fast user experience by showing only what matters: answers, brief tool status, and errors.

Use `--verbose` on the CLI (or `verbose=True` in code) to switch to `AgentConsole`.

---

## AgentConsole (Verbose CLI Output)

```python
from gaia.agents.base.console import AgentConsole

class MyAgent(Agent):
def _create_console(self):
# Rich console with syntax highlighting
# Rich console with full step-by-step output
return AgentConsole()

# Displays:
# - Colored step headers
# - Syntax-highlighted tool calls
# - Thoughts, goals, and plans
# - Syntax-highlighted tool calls with full JSON
# - Progress indicators
# - Formatted results
# - Formatted results with panels
```

`AgentConsole` is used when `--verbose` is passed on the CLI or `verbose=True` in the agent constructor. It provides maximum visibility into the agent's reasoning process, useful for development and debugging.

---

## SilentConsole (No Output)
Expand Down Expand Up @@ -77,7 +108,8 @@ agent = MyAgent(output_handler=handler)

| Handler | Use Case | Output | Best For |
|---------|----------|--------|----------|
| `AgentConsole` | Interactive CLI | Rich, colored text | Development, debugging |
| `MinimalConsole` | Interactive CLI (default) | Clean, minimal text | End users, production |
| `AgentConsole` | Verbose CLI (`--verbose`) | Rich, colored text | Development, debugging |
| `SilentConsole` | Headless operation | None | APIs, tests, background |
| `SSEOutputHandler` | Streaming API | Server-Sent Events | Web applications |

Expand Down
13 changes: 8 additions & 5 deletions docs/spec/console.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ title: "Console Output Handlers"
</Info>

<Note>
**Component:** OutputHandler, AgentConsole, SilentConsole, SSEOutputHandler
**Component:** OutputHandler, MinimalConsole, AgentConsole, SilentConsole, SSEOutputHandler
**Module:** `gaia.agents.base.console`, `gaia.api.sse_handler`
**Import:** `from gaia.agents.base.console import OutputHandler, AgentConsole, SilentConsole`
**Import:** `from gaia.agents.base.console import OutputHandler, MinimalConsole, AgentConsole, SilentConsole`
</Note>
---

Expand All @@ -32,22 +32,25 @@ The console output system provides a unified interface for handling agent output
```mermaid
%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#ED1C24', 'primaryTextColor':'#fff', 'primaryBorderColor':'#C8171E', 'lineColor':'#F4484D', 'secondaryColor':'#2d2d2d', 'tertiaryColor':'#f5f5f5', 'fontFamily': 'system-ui, -apple-system, sans-serif'}}}%%
flowchart TD
A(["OUTPUT HANDLER"]) --> B(["AGENT CONSOLE"])
A(["OUTPUT HANDLER"]) --> B(["MINIMAL CONSOLE (default)"])
A --> E(["AGENT CONSOLE (--verbose)"])
A --> C(["SILENT CONSOLE"])
A --> D(["SSE HANDLER"])

style A fill:#ED1C24,stroke:#C8171E,stroke-width:2px,color:#fff
style B fill:#F4484D,stroke:#ED1C24,stroke-width:2px,color:#fff
style E fill:#F4484D,stroke:#ED1C24,stroke-width:2px,color:#fff
style C fill:#F4484D,stroke:#ED1C24,stroke-width:2px,color:#fff
style D fill:#F4484D,stroke:#ED1C24,stroke-width:2px,color:#fff

linkStyle 0,1,2 stroke:#ED1C24,stroke-width:2px
linkStyle 0,1,2,3 stroke:#ED1C24,stroke-width:2px
```

| Component | Type | Purpose |
|-----------|------|---------|
| **OUTPUT HANDLER** | Abstract Base Class | Defines interface for all output handlers |
| **AGENT CONSOLE** | Implementation | Rich CLI output with colors, spinners, syntax highlighting |
| **MINIMAL CONSOLE** | Implementation (default) | Clean, minimal output — answers, brief tool status, errors |
| **AGENT CONSOLE** | Implementation (`--verbose`) | Rich CLI output with colors, spinners, syntax highlighting, full step-by-step detail |
| **SILENT CONSOLE** | Implementation | Suppressed output for testing and API mode |
| **SSE HANDLER** | Implementation | Server-Sent Events streaming for API clients |

Expand Down
19 changes: 15 additions & 4 deletions src/gaia/agents/base/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import uuid
from typing import Any, Dict, List, Optional

from gaia.agents.base.console import AgentConsole, SilentConsole
from gaia.agents.base.console import AgentConsole, MinimalConsole, SilentConsole
from gaia.agents.base.errors import format_execution_trace
from gaia.agents.base.tools import _TOOL_REGISTRY

Expand Down Expand Up @@ -76,6 +76,7 @@ def __init__(
show_stats: bool = False,
silent_mode: bool = False,
debug: bool = False,
verbose: bool = False,
output_handler=None,
max_plan_iterations: int = 3,
max_consecutive_repeats: int = 4,
Expand All @@ -99,7 +100,9 @@ def __init__(
show_stats: If True, displays LLM performance stats after each response (default: False)
silent_mode: If True, suppresses all console output for JSON-only usage (default: False)
debug: If True, enables debug output for troubleshooting (default: False)
output_handler: Custom OutputHandler for displaying agent output (default: None, creates console based on silent_mode)
verbose: If True, uses the full AgentConsole with detailed step-by-step output.
If False (default), uses MinimalConsole with clean, minimal output.
output_handler: Custom OutputHandler for displaying agent output (default: None, creates console based on mode flags)
max_plan_iterations: Maximum number of plan-execute-replan cycles (default: 3, 0 = unlimited)
max_consecutive_repeats: Maximum consecutive identical tool calls before stopping (default: 4)
min_context_size: Minimum context size required for this agent (default: 32768).
Expand All @@ -120,6 +123,7 @@ def __init__(
self.show_stats = show_stats
self.silent_mode = silent_mode
self.debug = debug
self.verbose = verbose
self.last_result = None # Store the most recent result
self.max_plan_iterations = max_plan_iterations
self.max_consecutive_repeats = max_consecutive_repeats
Expand Down Expand Up @@ -348,15 +352,22 @@ def _get_system_prompt(self) -> str:
def _create_console(self):
"""
Create and return a console output handler.
Returns SilentConsole if in silent_mode, otherwise AgentConsole.

Priority:
1. SilentConsole if silent_mode (JSON-only, no output)
2. AgentConsole if verbose (full step-by-step debug output)
3. MinimalConsole (default — clean, minimal user experience)

Subclasses can override this to provide domain-specific console output.
"""
if self.silent_mode:
# Check if we should completely silence everything (including final answer)
# This would be true for JSON-only output or when output_dir is set
silence_final_answer = getattr(self, "output_dir", None) is not None
return SilentConsole(silence_final_answer=silence_final_answer)
return AgentConsole()
if self.verbose:
return AgentConsole()
return MinimalConsole()

@abc.abstractmethod
def _register_tools(self):
Expand Down
Loading
Loading