Skip to main content

Session

Defined in the session module.
A simple wrapper around PraisonAI’s existing stateful capabilities. Provides a unified API for:
  • Session management with persistent state
  • Memory operations (short-term, long-term, user-specific)
  • Knowledge base operations
  • Agent state management
  • Remote agent connectivity

Constructor

session_id
Optional
No description available.
user_id
Optional
No description available.
agent_url
Optional
No description available.
memory_config
Optional
No description available.
knowledge_config
Optional
No description available.
timeout
int
default:"30"
No description available.

Methods

Usage

# Local session with agent
    session = Session(session_id="chat_123", user_id="user_456")
    agent = session.Agent(name="Assistant", role="Helpful AI")
    
    # Remote agent session (similar to Google ADK)
    session = Session(agent_url="192.168.1.10:8000/agent")
    response = session.chat("Hello from remote client!")
    
    # Save session state
    session.save_state({"conversation_topic": "AI research"})