Source Code:
src/gaia/chat/sdk.py · src/gaia/rag/sdk.pyImport:
from gaia.chat.sdk import AgentSDK, AgentConfig, SimpleChat, AgentSession, quick_chatCore Classes
AgentConfig
Configure your chat session:AgentResponse
Responses include text, history, and optional statistics:SimpleChat
Lightweight wrapper for basic chat without complex configuration. Perfect for getting started quickly.Quick Chat (One-Off)
Chat with Memory
Streaming
Custom Assistant
Session Management
Manage multiple conversation contexts:Conversation History
Chat with RAG
Advanced RAG Configuration
Custom Messages
API Reference
AgentSDK Methods
Messaging
send(message: str) -> AgentResponsesend_stream(message: str)send_messages(messages, system_prompt) -> AgentResponse
History
get_history() -> List[str]clear_history()get_formatted_history() -> List[Dict]conversation_pairs(property)
RAG (Document Q&A)
enable_rag(documents=None, **kwargs)disable_rag()add_document(path: str) -> bool
Configuration
update_config(**kwargs)get_stats() -> Dictdisplay_stats(stats=None)start_interactive_session()
SimpleChat Methods
ask(question: str) -> str— Ask question, get responseask_stream(question: str)— Ask question, stream responseclear_memory()— Clear conversation memoryget_conversation() -> List[Dict]— Get conversation history
AgentSession Methods
create_session(session_id, config=None, **kwargs) -> AgentSDK— Create new sessionget_session(session_id) -> AgentSDK— Get existing sessiondelete_session(session_id) -> bool— Delete sessionlist_sessions() -> List[str]— List all sessionsclear_all_sessions()— Delete all sessions
Utility Functions
quick_chat(message, system_prompt=None, model=None, assistant_name=None) -> strquick_chat_with_memory(messages, system_prompt=None, model=None, assistant_name=None) -> List[str]
Best Practices
Choose the Right Interface
SimpleChat for basic needs, AgentSDK for full features, AgentSession for multi-context appsMemory Management
Configure
max_history_length based on memory constraintsPerformance
Enable
show_stats=True during developmentResource Cleanup
Clear sessions when done to free memory
Related
- User Guide — CLI usage, RAG commands, troubleshooting
- GAIA Chat Desktop — Desktop app with GUI and document Q&A
- Agent UI SDK — Python backend for the desktop application (FastAPI, SQLite, REST API)
- LLM Client — Language model integration
- API Specification — Technical specification