When you submit a startup idea, it travels through a structured pipeline that spans HTTP ingestion, a BullMQ job queue, two parallel agent execution phases, a report quality and grounding step, and a final database write. Understanding each stage helps you interpret progress indicators, troubleshoot failures, and make the most of per-section regeneration when you want to refresh a single part of the report without re-running the full analysis.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Abbaddii-99/AI-Startup-Analyzer/llms.txt
Use this file to discover all available pages before exploring further.
Full Pipeline Lifecycle
Idea Submission
A client sends
POST /analysis with the idea text in the request body. The AnalysisService first sanitizes the input — trimming whitespace, clamping to 2,000 characters, and stripping characters that could form prompt injections — before any further processing.Input sanitization removes angle brackets, quotes, backticks, the phrases “ignore previous/above/all instructions”, and “system:” prefixes. Escaped newline sequences are collapsed to spaces. The maximum accepted length is 2,000 characters.
Monthly Limit Check and DB Record Creation
Before queuing any work,
AnalysisService.checkAndIncrementAnalysisLimit reads the authenticated user’s plan and their analysesThisMonth counter. If the current calendar month has rolled over since the last reset, the counter is treated as zero. If the counter is at or above the plan limit, the request is rejected with a 409 Conflict. Otherwise, the counter is atomically incremented and a new Analysis record is created in the database with status: 'PENDING'.BullMQ Job Enqueue
The new analysis is added to the
analysis BullMQ queue using the analysis database ID as the jobId. Because BullMQ deduplicates jobs by jobId, submitting the same analysis ID twice will not create a duplicate job.Worker Picks Up the Job — Status: PROCESSING
The
AnalysisProcessor worker (a NestJS @Processor('analysis')) dequeues the job and immediately updates the analysis status to PROCESSING in the database. Job progress is set to 5%.Phase 1 — Six Independent Agents (parallel)
Six agents run concurrently via
Promise.all, each receiving only the sanitized idea string:- IdeaAnalyzerAgent — problem, users, industry, use cases
- MarketResearchAgent — TAM / SAM / SOM, trends, geographies
- CompetitorAnalysisAgent — direct and indirect competitors
- MVPGeneratorAgent — feature list, KPIs, milestones, feasibility
- MonetizationAgent — revenue model and pricing tiers
- GoToMarketAgent — channels, communities, growth hacks
FAILED.Phase 2 — Seven Synthesis Agents (parallel, partial failure allowed)
Seven agents run concurrently via
Promise.allSettled, each receiving the full Phase 1 result object as context. Progress starts at 90% for this phase.- FinalReportAgent — synthesized scored report (required)
- RiskRadarAgent — risk factors and mitigations
- RoadmapAgent — four-phase development plan
- BusinessModelAgent — 43-model pattern evaluation
- VisionMissionAgent — vision, mission, values, elevator pitch
- BrandIdentityAgent — names, palette, typography, brand story
- BudgetEstimatorAgent — cost breakdown and revenue projections
FinalReportAgent are logged as warnings; their fields are stored as null. A FinalReportAgent failure is fatal and marks the analysis as FAILED.Grounding Evaluation and Application
After Phase 2, the pipeline evaluates the quality of the
FinalReport output — checking confidence scores, validation issues, and severity levels. A grounding strategy is then selected:- Rule-based grounding — applies deterministic normalization rules to fix structural issues in the report
- AI-based grounding — sends the report back to the AI model with targeted repair instructions (subject to a per-analysis call limit and a feature flag)
ComprehensiveIdeaAnalyzer Runs Last
After grounding, the
ComprehensiveIdeaAnalyzerAgent executes synchronously with the Phase 1 context. It produces six scored dimensions (overall viability, market opportunity, competitive analysis, target audience fit, financial feasibility, risk assessment) plus prioritized recommendations. Job progress advances to 98%.Results Persisted and Status Set to COMPLETED
All agent results are serialized to JSON and written to the
Analysis record in a single Prisma update call. The five numeric score fields from FinalReport (marketDemandScore, competitionScore, executionDifficultyScore, profitPotentialScore, overallScore) are extracted to dedicated Float columns to support sorting and filtering without JSON parsing. Progress advances to 100% and status is set to COMPLETED.Polling for Progress
While an analysis is in thePENDING or PROCESSING state, you can poll for real-time progress:
| Progress | Stage |
|---|---|
| 5% | Worker started, status set to PROCESSING |
| 89% | Phase 1 (all 6 independent agents) complete |
| 90% | Phase 2 agents launched |
| 98% | Phase 2 complete, grounding applied, ComprehensiveIdeaAnalyzer running |
| 100% | All results persisted, status COMPLETED |
Retrying a Failed Analysis
If an analysis reaches theFAILED status, you can requeue it without creating a new record:
PENDING and a new BullMQ job is created with a timestamp-suffixed job ID ({analysisId}-retry-{timestamp}) to prevent deduplication conflicts with the original failed job.
Per-Section Regeneration
Any individual section can be regenerated in isolation without triggering a full pipeline re-run. This is useful when you want to explore a different monetization angle or refresh the risk radar after updating the idea.| Slug | Agent | Phase 1 Context Passed |
|---|---|---|
idea-analysis | IdeaAnalyzerAgent | No |
comprehensive-idea-analysis | ComprehensiveIdeaAnalyzerAgent | No |
market-research | MarketResearchAgent | No |
competitor-analysis | CompetitorAnalysisAgent | No |
mvp | MVPGeneratorAgent | No |
monetization | MonetizationAgent | No |
go-to-market | GoToMarketAgent | No |
risk-radar | RiskRadarAgent | Yes |
roadmap | RoadmapAgent | Yes |
business-model | BusinessModelAgent | Yes |
vision-mission | VisionMissionAgent | Yes |
brand-identity | BrandIdentityAgent | Yes |
budget | BudgetEstimatorAgent | Yes |