chat.mdx
July 7, 2026 · View on GitHub
Quick Start
```bash
uv pip install -e ".[rag]"
```
chat = SimpleChat()
response = chat.ask("What is Python?")
print(response)
# Follow-up with conversation memory
response = chat.ask("Give me an example")
print(response)
```
config = AgentConfig(
show_stats=True,
max_history_length=6
)
chat = AgentSDK(config)
response = chat.send("Hello! My name is Alex.")
print(response.text)
response = chat.send("What's my name?")
print(response.text) # Will remember "Alex"
```
CLI Usage
Interactive Mode
Start a conversational chat session:
# Show performance metrics
gaia chat --stats
Single Query Mode
# One-shot query
gaia chat --query "What is artificial intelligence?"
# With statistics
gaia chat --query "Hello" --show-stats
Document Q&A (RAG)
CLI with RAG
```bash
# Voice with documents
gaia talk --index manual.pdf
```
To download all models needed for chat (including VLM):
gaia download --agent chat
To see what models each agent requires: gaia download --list
See the CLI Reference for more download options.
Interactive RAG Commands
When using gaia chat with documents (via --index flag or /index command), additional commands become available:
- `/resume [id]` - Resume session with conversation and documents restored
- `/save` - Save session including indexed documents
- `/sessions` - List all saved sessions
- `/reset` - Clear conversation and start a new session (indexed documents are preserved)
RAG Debug Mode
Enable debug mode to see detailed retrieval information:
# Python SDK with debug — ChatAgent takes a single ChatAgentConfig
from gaia_agent_chat.agent import ChatAgent, ChatAgentConfig
config = ChatAgentConfig(
rag_documents=['document.pdf'],
debug=True,
silent_mode=False,
)
agent = ChatAgent(config)
result = agent.process_query("What is the vision statement?")
print(result)
Chunking Strategies
```python
config = ChatAgentConfig(
rag_documents=['document.pdf'],
chunk_size=500,
chunk_overlap=50,
)
agent = ChatAgent(config)
```
```python
config = ChatAgentConfig(
rag_documents=['document.pdf'],
use_llm_chunking=True,
chunk_size=500,
)
agent = ChatAgent(config)
```
Troubleshooting
```bash
# Install talk dependencies
uv pip install -e ".[talk]"
# If the error persists, install pip in your environment
python -m ensurepip --upgrade
```
# Better quality
chat.enable_rag(documents=["doc.pdf"], chunk_size=600, max_chunks=5, chunk_overlap=100)
# Memory efficient
chat.enable_rag(documents=["doc.pdf"], chunk_size=400, max_chunks=2)
```
Dynamic Tool Loading
The doc profile can load tools semantically per turn instead of showing the
LLM every registered tool on every turn. A small always-on CORE set is combined
with tools whose descriptions best match the conversation, which shrinks the
first-turn prompt and speeds up the first reply.
It activates only on the doc profile (the registered doc agent, the SDK with
ChatAgentConfig(prompt_profile="doc"), or gaia eval agent --agent-type doc).
Turn it on with the config field, an environment variable, or the Agent UI
Settings → Dynamic Tools (Beta) toggle. The env var wins over both — when it
is set, the UI toggle reflects the effective value and disables itself — which is
handy for the eval harness:
from gaia_agent_chat.agent import ChatAgent, ChatAgentConfig
agent = ChatAgent(ChatAgentConfig(prompt_profile="doc", dynamic_tools=True))
# Env override (applies wherever a doc-profile ChatAgent runs)
GAIA_DYNAMIC_TOOLS=1 gaia eval agent --category tool_selection --agent-type doc
# Optional tuning: match threshold (cosine, inclusive) and loaded-set cap
GAIA_DYNAMIC_TOOLS_TAU=0.20 GAIA_DYNAMIC_TOOLS_MAX=14 GAIA_DYNAMIC_TOOLS=1 ...
It needs memory enabled (it reuses the memory embedder). If memory is off, the toggle is off, or the embedder is unreachable, the agent automatically falls back to showing all tools — so a turn never loses access to a tool it needs. See the Dynamic Tool Loader plan for the full design.
Next Steps
License
Copyright(C) 2024-2026 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: MIT