Installation
The Narrator CLI is automatically installed when you install the Narrator package:- uv (recommended)
- pip
narrator command will be available (run with uv run narrator if using uv).
Commands
Database Commands
narrator init
Initialize database tables for thread and message storage:threads- Stores conversation threadsmessages- Stores messages within threads
narrator status
Check database connection and display basic statistics:- Database connection status
- Number of recent threads
- Basic health check information
Docker Commands
narrator docker-setup
One-command setup that starts PostgreSQL and initializes tables:- Starts a PostgreSQL container with the correct configuration
- Waits for the database to be ready
- Initializes the required tables
- Provides the connection string to use
narrator docker-start
Start a PostgreSQL container for Narrator:narrator docker-stop
Stop the PostgreSQL container:Quick Start with Docker
The fastest way to get started with PostgreSQL for Narrator:Configuration
Environment Variables
The Narrator CLI respects these environment variables:Database Connection
Docker Configuration
These variables affect thedocker-* commands:
Connection Pool Settings
For PostgreSQL connections:Database URLs
Narrator supports different database backends:Examples
Local Development Setup
Custom Docker Configuration
Production Setup
CI/CD Pipeline
Integration with Tyler
When using Tyler agents with persistent storage:Troubleshooting
Connection Errors
“Failed to connect to database”: Check your database URL and ensure the database server is running:Permission Errors
“Permission denied”: Ensure your database user has CREATE TABLE permissions:Migration Issues
“Table already exists”: The init command is idempotent and will skip existing tables. This is not an error.Environment Variable Issues
“No database URL provided”: Set the environment variable:Best Practices
- Always initialize before use: Run
narrator initbefore using ThreadStore with a database - Use environment variables: Avoid hardcoding database URLs in your code
- Use connection pooling: For production, configure pool settings appropriately
- Regular backups: Set up automated backups for production databases
- Monitor connections: Keep an eye on connection pool usage in production
Advanced Usage
Custom Database Configuration
Create a.env file for your project:
Database Migrations
For schema changes between Narrator versions:Next Steps
ThreadStore API
Learn about the ThreadStore API
Conversation Persistence
Build agents with persistent memory
Tyler CLI
Create and chat with agents
Production Deployment
Deploy agents to production