Skip to main content
Pro feature - Lookouts require a Scira Pro subscription
Lookouts are scheduled research agents that automatically run queries on a recurring basis. Each run creates a new chat with full research results and sends you an email summary—perfect for monitoring topics, tracking trends, and staying informed on areas that matter to you.

What are Lookouts?

A Lookout is a scheduled research query that runs automatically based on a cron schedule. Think of it as setting up a recurring Google Alert, but powered by Scira’s full AI research capabilities with deep analysis, citations, and multi-source synthesis. Key characteristics:
  • Automated execution: Runs on schedule without manual intervention
  • Full research capability: Uses Extreme search mode by default
  • Email notifications: Sends results summary to your inbox
  • Chat history: Each run creates a new chat you can review
  • Run tracking: View history of all executions with metrics

Use Cases

Market & Competitor Intelligence

Research Topic Monitoring

Industry Briefings

Regulatory Tracking

Executive Briefings

Creating a Lookout

Database Schema

Lookouts are stored in the lookout table (/lib/db/schema.ts:286):

Frequency Options

Once: Run one time at a specific date/time
Daily: Run every day at a specific time
Weekly: Run on specific day(s) each week
Monthly: Run on specific day of month
Yearly: Run once per year

Cron Schedule Format

Lookouts use standard cron syntax with timezone support:
Examples:
Timezone prefix:

How Lookouts Work

1. Schedule Registration

When you create a Lookout:
  1. Record is created in lookout table
  2. Cron schedule is registered with Upstash QStash
  3. QStash schedule ID is stored in qstashScheduleId
  4. Next run time is calculated and stored in nextRunAt

2. Scheduled Execution

At the scheduled time:
  1. QStash triggers: Sends POST request to /api/lookout endpoint
  2. Pro verification: Checks user has active Pro subscription
  3. Status update: Sets lookout status to 'running'
  4. Chat creation: Generates new chat with title “Scheduled: ”
  5. Research execution: Runs Extreme search with the prompt

3. Research Process

The lookout endpoint (/app/api/lookout/route.ts) executes research using: Model: scira-grok-4-fast-think (Grok 4 with reasoning) System prompt (/app/api/lookout/route.ts:200):
  • 3-page research paper format
  • Mandatory citations for every claim
  • Markdown formatting required
  • Starts with ”## Key Points” section
  • Deep analysis with multiple sources
Tool: extreme_search tool only
  • Autonomous research planning
  • Multi-step web and X search
  • Code execution if needed
  • Chart generation support
Step limit: Maximum 2 tool calls to prevent runaway costs

4. Result Collection

After research completes:
  1. Message saving: User message and assistant response saved to chat
  2. Title generation: AI generates descriptive title for the chat
  3. Metrics tracking:
  4. Extreme search usage: Incremented in user’s usage tracking

5. Email Notification

Email is sent using Resend (/lib/email.ts): To: User’s registered email Subject: “Your Scira Lookout has completed: ” Content:
  • Lookout title
  • Research summary (first 2000 chars of response)
  • Link to full chat results
  • Run timestamp
Template: React Email components for rich formatting

6. Next Run Calculation

For recurring lookouts (frequency !== 'once'):
  1. Parse cron schedule with cron-parser
  2. Calculate next occurrence from current time
  3. Update nextRunAt field
  4. Status returns to 'active'
For one-time lookouts:
  • Status set to 'paused' after completion
  • Not automatically deleted (can be manually re-run)

Run History

Each lookout maintains a complete run history stored as JSON:
Example run history:

Status States

Lookouts can be in one of four states: active
  • Scheduled and will run at next occurrence
  • Waiting for QStash trigger
  • Can be paused or archived
paused
  • Temporarily disabled
  • Schedule still exists in QStash but won’t execute
  • Can be resumed to active
  • One-time lookouts auto-pause after running
archived
  • Soft-deleted
  • No longer shown in active list
  • Schedule removed from QStash
  • Can be permanently deleted
running
  • Currently executing research
  • Temporary state during execution
  • Returns to active after completion
  • Prevents duplicate concurrent runs

Error Handling

Execution Errors

If research fails (/app/api/lookout/route.ts:544):
  1. Error captured in runHistory with status 'error'
  2. Duration recorded
  3. Status returns to 'active' (will retry next scheduled time)
  4. No email sent on error

Timeout Handling

Long-running research (>5 minutes):
  • QStash has built-in timeout
  • Status recorded as 'timeout' in history
  • Lookout returns to active for next run

Subscription Lapses

If user’s Pro subscription expires:
  1. Lookout remains in database
  2. Execution fails Pro check (/app/api/lookout/route.ts:133)
  3. Returns 403 Forbidden
  4. Schedule remains in QStash (will retry)
  5. User must renew to resume execution

Best Practices

Prompt Design

Be specific about scope:
Include date context:
Request specific formats:
Specify sources when relevant:

Scheduling Strategy

Match frequency to update cadence:
  • Breaking news topics: Daily or multiple times per day
  • Research areas: Weekly or bi-weekly
  • Market reports: Weekly or monthly
  • Regulatory tracking: Weekly or monthly
Consider timezone:
Avoid overlapping schedules:
  • Stagger multiple lookouts by at least 15 minutes
  • Prevents concurrent extreme searches hitting limits

Cost Management

Lookouts use Extreme search by default, which:
  • Consumes more tokens than regular chat
  • Counts against Extreme search limit (Pro plan)
  • May incur API costs for search providers
Optimize costs:
  • Use appropriate frequency (don’t over-schedule)
  • Make prompts focused to avoid unnecessary searches
  • Monitor run history for token usage trends
  • Pause lookouts during periods you don’t need updates

QStash Integration

Lookouts use Upstash QStash for reliable scheduling:
Features:
  • Serverless cron scheduling
  • Automatic retries on failure
  • Timezone support
  • Delivery guarantees
Schedule management:

Email Integration

Emails are sent using Resend API:
Email template (/lib/email.ts):
  • React Email components for rendering
  • Responsive HTML design
  • Plain text fallback
  • Direct link to chat results
  • Truncated summary (2000 chars max)

Technical Architecture

Request Flow:
Dependencies:
Model configuration:

Limitations

Pro requirement: Lookouts are only available to Pro subscribers Execution limits:
  • Maximum 2 tool calls per run (prevents runaway costs)
  • Extreme search usage counted against Pro limits
  • QStash timeout after extended execution
Frequency constraints:
  • Minimum practical interval: ~15 minutes (QStash limitation)
  • Maximum history size: No hard limit but stored as JSON
Email delivery:
  • Requires valid email on user account
  • Subject to Resend rate limits
  • No email sent on execution errors

Next Steps

Extreme Search

Learn about the Extreme search mode used by Lookouts

Tools

Deep dive into the extreme_search tool