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

# Quickstart

> Get started with database persistence in 5 minutes

# Persistence Quickstart

Enable automatic conversation persistence with memory configuration.

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install "praisonaiagents[tools]"
```

## Docker Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# PostgreSQL
docker run -d --name praison-postgres -p 5432:5432 \
    -e POSTGRES_PASSWORD=praison123 \
    -e POSTGRES_DB=praisonai \
    postgres:16

# Qdrant (optional - for knowledge)
docker run -d --name praison-qdrant -p 6333:6333 qdrant/qdrant

# Redis (optional - for state)
docker run -d --name praison-redis -p 6379:6379 redis:7
```

## Basic Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

# Create agent with persistence
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    memory={
        "db": "postgresql://postgres:praison123@localhost:5432/praisonai",
        "session_id": "my-session-001"
    }
)

# All chats are automatically persisted
response = agent.start("My name is Alice")
print(response)
```

## SQLite (Zero Config)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    memory={
        "db": "conversations.db",
        "session_id": "local-session"
    }
)
response = agent.start("Hello!")
print(response)
```

## Backend Options

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

# PostgreSQL
agent = Agent(
    name="Bot",
    memory={"db": "postgresql://user:pass@localhost/db"}
)

# SQLite
agent = Agent(
    name="Bot",
    memory={"db": "mydata.db"}
)

# MySQL
agent = Agent(
    name="Bot",
    memory={"db": "mysql://user:pass@localhost/db"}
)
```

## Environment Variables

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export PRAISON_CONVERSATION_URL="postgresql://localhost/mydb"
export OPENAI_API_KEY="your-key"
```

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import os
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    memory={"db": os.getenv("PRAISON_CONVERSATION_URL")}
)
```

## CLI Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Validate connectivity
praisonai persistence doctor \
    --conversation-url "postgresql://postgres:praison123@localhost/praisonai"

# Run agent with persistence
praisonai persistence run \
    --session-id "cli-session" \
    --conversation-url "postgresql://postgres:praison123@localhost/praisonai" \
    "Hello, my name is Bob"
```

## Next Steps

* [Session Resume](/docs/persistence/session-resume) - Continue conversations
* [PostgreSQL](/docs/databases/postgres) - Production setup
* [CLI Reference](/docs/cli/persistence) - Full CLI documentation
