Frequently Asked Questions

Installation & Setup

What are the minimum requirements?

Liz requires Node.js 18+ and either SQLite or PostgreSQL for the database. For development, SQLite is recommended as it requires no additional setup. For production, PostgreSQL is recommended for better scalability.

Why am I getting environment variable errors?

Make sure you've copied .env.example to .env and filled in all required variables:

  • DATABASE_URL for your database connection
  • OPENAI_API_KEY for OpenAI API access
  • OPENROUTER_API_KEY for OpenRouter API access
  • APP_URL for OpenRouter callbacks

How do I switch from SQLite to PostgreSQL?

Update your DATABASE_URL in .env and modify prisma/schema.prisma:

// prisma/schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Then run prisma migrate to update your database:

npm run prisma:migrate

LLM Integration

Can I use different LLM providers?

Yes, Liz supports both OpenAI and OpenRouter APIs. OpenRouter gives you access to models from Anthropic, Google, and others. You can specify the model when calling LLMUtils methods:

// OpenAI GPT-4
await llmUtils.getTextFromLLM(prompt, "openai/gpt-4");

// Anthropic Claude
await llmUtils.getTextFromLLM(prompt, "anthropic/claude-3-sonnet");

// Google PaLM
await llmUtils.getTextFromLLM(prompt, "google/palm-2");

How do I handle rate limits?

Implement exponential backoff and retry logic in your routes:

async function withRetry(fn, maxRetries = 3) {
  let retries = 0;
  while (retries < maxRetries) {
    try {
      return await fn();
    } catch (error) {
      if (!error.message.includes('rate limit')) throw error;
      retries++;
      await new Promise(r => 
        setTimeout(r, Math.pow(2, retries) * 1000)
      );
    }
  }
  throw new Error('Max retries exceeded');
}

Performance

How can I optimize memory usage?

Several strategies can help manage memory usage:

  • Limit the number of memories loaded per request
  • Implement memory pruning for old conversations
  • Use database indexing effectively
  • Consider memory summarization for long conversations

How do I handle high traffic?

For high-traffic applications:

  • Use PostgreSQL instead of SQLite
  • Implement request queuing
  • Cache common responses
  • Use load balancing with multiple instances

Twitter Integration

Why is my Twitter bot not working?

Common Twitter integration issues:

  • Incorrect credentials in environment variables
  • Missing 2FA secret for accounts with 2FA enabled
  • Rate limiting from too frequent posting
  • Network issues preventing login

Use dryRun mode to test your bot without posting:

TWITTER_DRY_RUN=true

Contributing

How can I contribute to Liz?

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Please follow our coding standards and include clear commit messages.