Quickstart
Get Scribe Backend up and running on your machine in 5 minutes and generate your first personalized academic outreach email.Overview
This guide will walk you through:Install dependencies and configure environment
Set up Python, Redis, and required API keys (2 minutes)
Start the development server and Celery worker
Launch FastAPI server and background task processor (1 minute)
Prerequisites: macOS or Linux, Python 3.13+, Redis, and basic command-line familiarity.For detailed setup instructions, see the Installation Guide.
Step 1: Installation
Clone and Setup Virtual Environment
Install Dependencies
Configure Environment Variables
Create a.env file in the project root:
.env
Where to get API keys
Where to get API keys
Required API Keys:
- Anthropic API Key: console.anthropic.com - For Claude AI email generation
- Exa API Key: exa.ai - For AI-powered web search
- Supabase URL & Key: Your Supabase project dashboard - For authentication and database
- Logfire Token: logfire.pydantic.dev - For observability (optional but recommended)
Run Database Migrations
This creates the necessary database tables (users, emails, queue_items, templates).
Step 2: Start Services
Quick Start (Recommended)
Start all services with a single command using the Makefile:Manual Start (For Debugging)
If you prefer to run services separately:The Celery worker runs with
concurrency=1 for sequential processing, which prevents API rate limits and optimizes memory usage.Step 3: Generate Your First Email
Initialize Your User Profile
First, obtain a JWT token from Supabase (or use your frontend authentication). Then initialize your user profile:Generate a Single Email
Now let’s generate a personalized cold email:Poll for Task Completion
The email generation is asynchronous (~10 seconds). Poll the status endpoint:Retrieve the Generated Email
The pipeline automatically:
- Classifies the template type (RESEARCH, BOOK, GENERAL)
- Searches for relevant information about the recipient
- Fetches academic papers from ArXiv (for RESEARCH type)
- Generates a personalized email using Claude AI
Batch Email Generation
To generate multiple emails at once (up to 100):Monitor Queue Status
Poll the queue endpoint to track progress:Items are processed sequentially (concurrency=1) in FIFO order. Each email takes ~10-12 seconds to generate.
Interactive API Documentation
Explore the API with FastAPI’s auto-generated interactive docs:- Try out all endpoints directly in the browser
- View request/response schemas
- Authenticate with your JWT token
- See example requests and responses
Next Steps
Core Concepts
Learn about the 4-step pipeline, authentication, and queue system
API Reference
Explore complete API documentation with all endpoints
Configuration
Understand all environment variables and configuration options
Pipeline Deep Dive
Understand how the email generation pipeline works
Troubleshooting
Redis connection refused
Redis connection refused
Error:
ConnectionRefusedError: [Errno 61] Connection refusedSolution:Database connection failed
Database connection failed
Error:
Could not connect to databaseSolution:- Verify your Supabase credentials in
.env - Ensure you’re using the Transaction Pooler (port 6543)
- Check that migrations have been run:
alembic upgrade head
Playwright browser not found
Playwright browser not found
Error:
playwright._impl._api_types.Error: Executable doesn't existSolution:Missing API key errors
Missing API key errors
Error:
ANTHROPIC_API_KEY not found or EXA_API_KEY not foundSolution:- Ensure your
.envfile is in the project root - Check that all required API keys are set
- Restart the server after updating
.env
401 Unauthorized
401 Unauthorized
For more troubleshooting help, see the Debugging Guide.
