How pavithra20august/crewai-crash-course works
Purpose and Entry Points
This is a CrewAI startup-idea validation application. It turns an idea into market, technical, and strategic analysis, then produces a GO/NO-GO/CONDITIONAL report.
Entry points:
• CLI: main.py
• FastAPI/SSE server and static UI host: api.py
• Browser client: frontend/index.html, frontend/app.js
Crew Orchestration
crew.py assembles four agents and their ordered tasks into a CrewAI Process.sequential workflow. The crew kickoff is the central execution boundary: inputs become task outputs, then a final synthesized report.
Primary flow: idea → research → feasibility → strategy → compiled verdict.
• crew.py
• main.py
• api.py
Agent Layer
agents.py defines the specialized AI workers: market researcher, technology analyst, strategist, and report compiler. Their roles, prompts/goals, assigned tools, and configured LLM establish the model-facing behavior boundary.
Agents are not invoked directly by the UI; CrewAI dispatches them through their assigned tasks.
• agents.py
• crew.py
Task Pipeline and Context Chaining
tasks.py specifies each agent’s deliverable and binds it to an agent. Later analysis and report tasks consume preceding task output through task context, making the sequential ordering semantically important rather than merely operational.
The final report task is responsible for synthesis and persisted report output.
• tasks.py
• crew.py
Tool and External-Service Boundary
tools.py exposes CrewAI-decorated callable tools for web research, market calculations, and SWOT-oriented analysis. Web search can use Tavily when configured and has a mock/fallback path; agents decide tool use from tool descriptions.
The LLM is Gemini-backed and requires environment-provided API credentials. Tavily is optional.
• tools.py
• agents.py
• .env.example
CLI Execution Path
main.py accepts an optional startup-idea argument, constructs/runs the crew, and presents the resulting analysis. It is the simplest integration surface for local and scripted execution.
• main.py
• crew.py
API Streaming and Frontend
api.py provides the web execution path: it accepts an idea, runs the same crew workflow, captures runtime stdout/activity, and streams updates to the browser using Server-Sent Events. This separates long-running LLM orchestration from client rendering.
The static frontend submits ideas, displays agent activity, and renders the completed report.
• api.py
• frontend/app.js
• frontend/index.html
Main entry points: api.py FastAPI + SSE server · tasks.py Task pipeline · agents.py Specialist agents · crew.py Sequential crew
Components 15
Entry Points
- CLI runner · Accepts an idea and presents the analysis.
main.py
Crew Workflow
- Sequential crew · Central kickoff boundary for ordered validation work.
crew.py - Task pipeline · Chains research, feasibility, strategy, and report context.
tasks.py - Market research
- Technical feasibility
- Strategic analysis
- Compiled verdict · Produces the GO/NO-GO/CONDITIONAL synthesis and persisted output.
AI Boundary
- Specialist agents · Defines roles, prompts, tools, and configured LLM.
agents.py - Research and analysis tools · Provides web search, market calculations, and SWOT analysis.
tools.py - Gemini LLM · Requires environment-provided credentials.
- Tavily search · Web research uses a mock or fallback when unavailable.
- Environment credentials · Documents required Gemini and optional Tavily settings.
.env.example
Web Experience
- FastAPI + SSE server · Runs crews and streams captured activity.
api.py - Browser client · Submits ideas, shows activity, and renders reports.
frontend/app.js - Static UI host
frontend/index.html
Connections 18
- CLI runner → Sequential crew: runs
- FastAPI + SSE server → Sequential crew: runs
- Static UI host → Browser client: loads
- Browser client → FastAPI + SSE server: submits idea / receives SSE
- FastAPI + SSE server → Browser client: streams activity and report
- Sequential crew → Task pipeline: orders
- Task pipeline → Specialist agents: binds tasks to
- Task pipeline → Market research: starts
- Market research → Technical feasibility: context
- Technical feasibility → Strategic analysis: context
- Strategic analysis → Compiled verdict: context
- Specialist agents → Research and analysis tools: may invoke
- Specialist agents → Gemini LLM: uses
- Research and analysis tools → Tavily search: searches when configured
- Environment credentials → Gemini LLM: configures credentials
- Environment credentials → Tavily search: optional configuration
- Compiled verdict → CLI runner: presented by
- Compiled verdict → FastAPI + SSE server: streamed by