Skip to main content
Import: from gaia.chat.sdk import AgentSDK, AgentConfig, SimpleChat, AgentSession, quick_chat
See also: User Guide · API Specification

Core 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) -> AgentResponse
  • send_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() -> Dict
  • display_stats(stats=None)
  • start_interactive_session()

SimpleChat Methods

  • ask(question: str) -> str — Ask question, get response
  • ask_stream(question: str) — Ask question, stream response
  • clear_memory() — Clear conversation memory
  • get_conversation() -> List[Dict] — Get conversation history

AgentSession Methods

  • create_session(session_id, config=None, **kwargs) -> AgentSDK — Create new session
  • get_session(session_id) -> AgentSDK — Get existing session
  • delete_session(session_id) -> bool — Delete session
  • list_sessions() -> List[str] — List all sessions
  • clear_all_sessions() — Delete all sessions

Utility Functions

  • quick_chat(message, system_prompt=None, model=None, assistant_name=None) -> str
  • quick_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 apps

Memory Management

Configure max_history_length based on memory constraints

Performance

Enable show_stats=True during development

Resource Cleanup

Clear sessions when done to free memory