> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL CLI

> CLI commands for PostgreSQL conversation store

# PostgreSQL CLI

## Docker Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
docker run -d --name postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  postgres:15
```

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# 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

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai persistence doctor \
  --conversation-backend postgres \
  --conversation-url "postgresql://user:pass@host:5432/db"
```

### Run with Session

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai persistence run \
  --conversation-backend postgres \
  --conversation-url "$POSTGRES_URL" \
  --session-id my-session \
  "What is AI?"
```

### Resume

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai persistence resume \
  --conversation-backend postgres \
  --conversation-url "$POSTGRES_URL" \
  --session-id my-session
```

### Export/Import

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
python3 -c "
from praisonai.persistence import create_conversation_store
store = create_conversation_store('postgres', url='postgresql://postgres:postgres@localhost:5432/postgres')
print('PostgreSQL OK')
"
```
