Pro feature - Lookouts require a Scira Pro subscription
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 thelookout table (/lib/db/schema.ts:286):
Frequency Options
Once: Run one time at a specific date/timeCron Schedule Format
Lookouts use standard cron syntax with timezone support:How Lookouts Work
1. Schedule Registration
When you create a Lookout:- Record is created in
lookouttable - Cron schedule is registered with Upstash QStash
- QStash schedule ID is stored in
qstashScheduleId - Next run time is calculated and stored in
nextRunAt
2. Scheduled Execution
At the scheduled time:- QStash triggers: Sends POST request to
/api/lookoutendpoint - Pro verification: Checks user has active Pro subscription
- Status update: Sets lookout status to
'running' - Chat creation: Generates new chat with title “Scheduled: ”
- 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
extreme_search tool only
- Autonomous research planning
- Multi-step web and X search
- Code execution if needed
- Chart generation support
4. Result Collection
After research completes:- Message saving: User message and assistant response saved to chat
- Title generation: AI generates descriptive title for the chat
- Metrics tracking:
- 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
6. Next Run Calculation
For recurring lookouts (frequency !== 'once'):
- Parse cron schedule with
cron-parser - Calculate next occurrence from current time
- Update
nextRunAtfield - Status returns to
'active'
- 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: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
- Temporarily disabled
- Schedule still exists in QStash but won’t execute
- Can be resumed to active
- One-time lookouts auto-pause after running
- Soft-deleted
- No longer shown in active list
- Schedule removed from QStash
- Can be permanently deleted
- 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):
- Error captured in
runHistorywith status'error' - Duration recorded
- Status returns to
'active'(will retry next scheduled time) - 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:- Lookout remains in database
- Execution fails Pro check (
/app/api/lookout/route.ts:133) - Returns 403 Forbidden
- Schedule remains in QStash (will retry)
- User must renew to resume execution
Best Practices
Prompt Design
Be specific about scope: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
- 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
- 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:- Serverless cron scheduling
- Automatic retries on failure
- Timezone support
- Delivery guarantees
Email Integration
Emails are sent using Resend API:/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: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
- Minimum practical interval: ~15 minutes (QStash limitation)
- Maximum history size: No hard limit but stored as JSON
- 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
