Skip to main content

Persistence CLI

Command-line interface for database persistence management.

Installation

pip install "praisonai[tools]"

Commands

Help

praisonai persistence --help

Doctor

Validate database connectivity.
praisonai persistence doctor [options]
Options:
OptionDescription
--conversation-url URLConversation store URL
--knowledge-url URLKnowledge store URL
--state-url URLState store URL
--allTest all configured stores
Example:
praisonai persistence doctor \
    --conversation-url "postgresql://postgres:pass@localhost/db" \
    --knowledge-url "http://localhost:6333" \
    --state-url "redis://localhost:6379"

Run

Run an agent with persistence.
praisonai persistence run [options] "prompt"
Options:
OptionDescription
--session-id IDSession identifier
--user-id IDUser identifier (default: “default”)
--conversation-url URLConversation store URL
--knowledge-url URLKnowledge store URL
--state-url URLState store URL
--agent-name NAMEAgent name (default: “Assistant”)
--agent-instructions TEXTAgent instructions
--dry-runShow config without running
Example:
praisonai persistence run \
    --session-id "my-session" \
    --conversation-url "postgresql://localhost/db" \
    "Hello, my name is Alice"

Resume

Resume an existing session.
praisonai persistence resume --session-id ID [options]
Options:
OptionDescription
--session-id IDSession to resume (required)
--conversation-url URLConversation store URL
--show-historyDisplay conversation history
--continue "prompt"Continue with new prompt
Example:
# Show history
praisonai persistence resume \
    --session-id "my-session" \
    --conversation-url "postgresql://localhost/db" \
    --show-history

# Continue conversation
praisonai persistence resume \
    --session-id "my-session" \
    --conversation-url "postgresql://localhost/db" \
    --continue "What's my name?"

Environment Variables

VariableDescription
PRAISON_CONVERSATION_URLDefault conversation store URL
PRAISON_KNOWLEDGE_URLDefault knowledge store URL
PRAISON_STATE_URLDefault state store URL
OPENAI_API_KEYOpenAI API key for agent
export PRAISON_CONVERSATION_URL="postgresql://localhost/db"
export OPENAI_API_KEY="your-key"

# Now commands are simpler
praisonai persistence doctor --all
praisonai persistence run --session-id "my-session" "Hello!"

Troubleshooting

Connection refused:
  • Check Docker containers are running
  • Verify URL format and credentials
No API key:
  • Set OPENAI_API_KEY environment variable