PostgreSQL CLI
Docker Setup
Copy
docker run -d --name postgres \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
postgres:15
Quick Start
Copy
# Test connection
praisonai persistence doctor \
--conversation-backend postgres \
--conversation-url "postgresql://postgres:postgres@localhost:5432/postgres"
# Run agent
praisonai persistence run \
--conversation-backend postgres \
--conversation-url "$POSTGRES_URL" \
"Hello"
Commands
Doctor
Copy
praisonai persistence doctor \
--conversation-backend postgres \
--conversation-url "postgresql://user:pass@host:5432/db"
Run with Session
Copy
praisonai persistence run \
--conversation-backend postgres \
--conversation-url "$POSTGRES_URL" \
--session-id my-session \
"What is AI?"
Resume
Copy
praisonai persistence resume \
--conversation-backend postgres \
--conversation-url "$POSTGRES_URL" \
--session-id my-session
Export/Import
Copy
praisonai persistence export \
--conversation-backend postgres \
--conversation-url "$POSTGRES_URL" \
--session-id my-session \
--output session.json
praisonai persistence import \
--conversation-backend postgres \
--conversation-url "$POSTGRES_URL" \
--input session.json
Python Test
Copy
python3 -c "
from praisonai.persistence import create_conversation_store
store = create_conversation_store('postgres', url='postgresql://postgres:postgres@localhost:5432/postgres')
print('PostgreSQL OK')
"

