Build a Multi-Agent Interview Prep AI
Build a 3-agent CrewAI system that researches and generates interview prep.
Introduction
30 Second Summary
Think about how a study group works. One person researches the topic, another creates practice questions, and a third writes detailed answers. Now imagine AI agents doing this for you, collaborating like a real team to prepare you for your next interview.
In this project, you will build a Multi-Agent AI system using CrewAI where 3 specialized agents work together to generate interview preparation material on any Agentic AI topic.
What You'll Build
A complete CrewAI project with 3 AI agents (Research Agent, Question Generator Agent, Answer Expert Agent) that collaborate through sequential orchestration to produce interview-ready study material.
By the end of this project, you'll have:
- A working Multi-Agent AI system with 3 specialized agents that collaborate automatically to produce interview prep material.
- A solid understanding of core Agentic AI concepts (ReAct pattern, orchestration, guardrails, cost control) that are tested in real interviews.
- A generated interview prep document with researched topics, 10 graded questions, and detailed answers with code examples.
- Secret Mission: Add a 4th Interviewer Agent that evaluates your answers, gives a score out of 10, and provides specific feedback.
Are there any prerequisites?
Basic Python knowledge (functions, variables, classes ka idea) is helpful. No prior AI or machine learning experience is needed.
Get Your Groq API Key
Step 1 mein tune Python, uv, aur CrewAI CLI install kar liye. Ab tere agents ko ek AI brain chahiye jo unke liye sochega aur likhega.
Is step mein tu LLM (Large Language Model) ke fundamentals samjhegi aur Groq ka free API key legi. Yeh key tere agents ko AI power degi.
In this step, get ready to:
- LLM ke core concepts samjho (tokens, prompts, temperature).
- Groq account banao aur API key generate karo.
- Groq ki speed aur free tier limits samjho.
LLM fundamentals samjho
AI agents ke andar ek LLM hota hai jo sochta hai aur likhta hai. Tere interview mein yeh terms zaroor puchhe jayenge, toh inhe achi tarah samajh le.
What is an LLM?
LLM (Large Language Model) ek trained AI brain hai. Isko billions of text data pe train kiya gaya hai. Jab tum isse koi question puchho, yeh next best words predict karta hai.
Jaise ChatGPT, Gemini, Llama sab LLMs hain. Tere agents bhi internally ek LLM use karenge har task ke liye.
Key LLM terms for interviews
- Token - words ke chhote tukde. "Hello world" = 2 tokens (roughly). LLMs tokens mein sochte hain, words mein nahi. Billing bhi tokens pe hoti hai.
- Prompt - instruction jo tum AI ko dete ho. Jitna specific prompt, utna better output. Tere agents ka role, goal, backstory sab prompt ka hissa banega.
- Temperature - creativity level control karta hai. 0 = focused aur deterministic (har baar same answer). 1 = creative aur random. Humare project mein 0.4 use karenge for balanced output.
- Inference - jab LLM tumhare prompt ka response generate karta hai, usse inference bolte hain. Fast inference = faster agent responses.
Create your Groq account and API key
Groq ek AI inference platform hai jo tere agents ko LLM access dega. No credit card needed.
- Open your browser and go to console.groq.com.
- Click Sign Up and create your account using your email or GitHub.
- After signing in, click API Keys in the left sidebar (or go directly to console.groq.com/keys).
- Click Create API Key.
- Give your key a name like interview-prep-crew and click Submit.
- Copy the key immediately and paste it somewhere safe (a text file or password manager). You will not be able to see it again.
How do I know my key is valid?
Your Groq API key starts with gsk_ followed by a long string of characters. If your copied key starts with this prefix, you are good to go.
Store keys as environment variables
Never hardcode API keys in your source code. In the next step, you will store this key in a .env file that stays local to your machine.
Can't create an API key?
If you see an error while creating your key, try using an incognito browser window and make sure any ad blockers or VPNs are turned off. If the issue persists, email support@groq.com with the email you signed up with.
help me troubleshoot creating my Groq API key
Samjho kyun Groq use kar rahe hain
Bahut saare LLM providers hain (OpenAI, Google, Anthropic). Toh kyun Groq?
Why Groq for this project?
Groq ne apna custom hardware banaya hai called LPU (Language Processing Unit). Yeh traditional GPUs se kaafi fast inference deta hai. Tera agent jab sochega aur likhega, response seconds mein aayega instead of minutes.
Free tier mein tujhe llama-3.3-70b-versatile model milta hai. Yeh ek 70 billion parameter open-source model hai jo interview prep ke liye perfect hai. Limits: 30 requests/minute aur 1000 requests/day.
Interview mein bol sakti hai: "Maine Groq use kiya for fast, cost-effective inference with open-source models. Free tier pe bhi production-quality output mil raha tha."
What is CrewAI's Groq integration?
CrewAI natively supports Groq through the groq/ model prefix. Tujhe sirf GROQ_API_KEY environment variable set karna hai aur model name mein groq/llama-3.3-70b-versatile likhna hai. No extra packages needed.
Tera Groq account ready hai aur tu LLM fundamentals samajh chuki hai. Next step mein tu apna CrewAI project create karegi aur agents define karegi.
Create Your CrewAI Project
Ab tak tune apna environment set up kar liya hai. Python, uv, aur CrewAI CLI sab ready hai. Ab asli kaam shuru hota hai.
Is step mein tu apna first Multi-Agent project scaffold karegi, apni Groq API key connect karegi, aur 3 specialized AI agents define karegi. Yeh agents tumhari team ke members hain, har ek ke paas ek specific role, goal, aur backstory hai.
In this step, get ready to:
- CrewAI project scaffold karo with proper file structure.
- Groq API key configure karo .env file mein.
- 3 specialized agents define karo agents.yaml mein.
Scaffold your CrewAI project
CrewAI provides a CLI command that generates a complete project structure for you. This includes configuration files for agents and tasks, a crew orchestration file, and an entry point to run everything.
- Move to your Desktop by running this command:
cd ~/Desktop
- Create your CrewAI project by running this command:
crewai create crew interview_prep_crew
What does this command do?
crewai create crew interview_prep_crew scaffolds an entire project folder with all the files you need to build a multi-agent system.
It creates agents.yaml (agent definitions), tasks.yaml (task definitions), crew.py (orchestration logic), main.py (entry point), and a .env file for your API keys.
What will the CLI ask me?
The CLI will show a list of LLM providers to choose from (like OpenAI, Anthropic, Gemini, Ollama). Select any provider for now. It will also ask for a model and API key.
You can skip the API key prompt by pressing Enter. We will configure the correct Groq credentials manually in the next substep.
- Move into your new project folder by running:
cd interview_prep_crew
- Install the project dependencies by running:
crewai install
What does crewai install do?
This command uses uv under the hood to install and lock all Python dependencies defined in pyproject.toml. It creates a virtual environment specifically for this project.
- Confirm the project structure exists by running:
ls src/interview_prep_crew/config/
You should see agents.yaml and tasks.yaml listed in the output.
- Switch back to IntelliJ IDEA.
- Click File in the top menu bar.
- Click Open.
- Navigate to your Desktop and select the interview_prep_crew folder, then click OK.
You should see the full project structure in the Project panel on the left, including the src/interview_prep_crew/config/ folder with your YAML files.
Project folder not showing files?
Make sure you opened the interview_prep_crew folder itself (the top-level folder on your Desktop), not a subfolder inside it.
If IntelliJ asks about trusting the project, click Trust Project.
Help me troubleshoot my IntelliJ project setup for CrewAI.
Configure your Groq API key
Your agents need an LLM (Large Language Model) to think and generate responses. The .env file is where you store your API credentials so the project can connect to Groq's servers.
- In IntelliJ's Project panel, click on the .env file to open it.
- Replace the entire contents of the file with the following:
GROQ_API_KEY=your-groq-api-key-here
- Replace your-groq-api-key-here with the actual API key you copied from the Groq console earlier.
- Save the file by pressing Cmd+S (macOS) or Ctrl+S (Windows).
Why a .env file?
The .env file keeps your API key separate from your code. CrewAI automatically loads this file at runtime using the python-dotenv library. This means your key never gets hardcoded into your Python files.
The .gitignore file generated by CrewAI already excludes .env from version control, so your key stays safe.
Don't see a .env file?
IntelliJ sometimes hides dotfiles by default. In the Project panel, click the three-dot menu or gear icon and make sure hidden files are visible.
If the file genuinely does not exist, create a new file in the root of your interview_prep_crew folder and name it .env.
Help me find or create the .env file in my CrewAI project.
Define your 3 AI agents
In CrewAI, every agent has 3 pillars: a Role (kya karta hai), a Goal (kya achieve karna hai), and a Backstory (experience aur context). This pattern is the foundation of Agent Architecture.
You will define 3 specialized agents: a researcher, a question generator, and an answer expert. Each agent focuses on one job, just like team members in a real company.
What is Agent Architecture?
Agent Architecture is the design pattern where each AI agent is defined by its Role, Goal, and Backstory. The Role tells the LLM what persona to adopt. The Goal focuses its output. The Backstory provides context and expertise depth.
This is one of the most commonly asked concepts in Agentic AI interviews. Interviewers want to hear how you designed your agents with separation of concerns.
- In IntelliJ's Project panel, expand src > interview_prep_crew > config.
- Click on agents.yaml to open it.
- Delete all the existing placeholder content in the file.
- Paste the following 3 agent definitions:
researcher:
role: "Senior Agentic AI Researcher"
goal: "Research the given topic thoroughly and provide comprehensive, accurate, up-to-date information with key concepts, patterns, and real-world examples"
backstory: >
You are a world-class AI researcher with deep expertise in Agentic AI,
multi-agent systems, LLMs, and production AI architectures. You have
published papers on agent orchestration and have hands-on experience
building production agent systems. You always provide factual, well-structured
research with clear explanations.
question_generator:
role: "Technical Interview Question Designer"
goal: "Create 10 interview questions ranging from easy to hard based on the research provided, covering both conceptual understanding and practical implementation"
backstory: >
You are a senior technical interviewer at a top AI company. You have
conducted 500+ interviews for Agentic AI roles. You know exactly what
separates junior candidates from senior ones. Your questions test real
understanding, not just memorization. You always include a mix of
definitional, scenario-based, and system design questions.
answer_expert:
role: "Agentic AI Answer Specialist"
goal: "Write detailed, interview-ready answers for each question that demonstrate deep understanding, include code examples where relevant, and use real-world analogies for clarity"
backstory: >
You are a staff engineer who has cleared interviews at multiple FAANG
companies for Agentic AI roles. You know how to structure answers that
impress interviewers: start with a direct answer, then explain the why,
give a real-world example, and mention trade-offs. You write in a clear,
confident style mixing English with Hindi explanations (Hinglish) to make
concepts accessible.
What does this code do?
- researcher agent ka kaam hai topic pe deep research karna. Iska backstory ek experienced AI researcher ka hai jo factual information deta hai.
- question_generator agent interview questions banata hai. Easy se hard tak, covering definitions, scenarios, aur system design.
- answer_expert agent detailed answers likhta hai with code examples aur Hinglish explanations. Yeh FAANG-level interview prep material generate karta hai.
Notice how each agent's backstory shapes its personality. The LLM uses this context to generate more focused, expert-level responses.
- Save agents.yaml by pressing Cmd+S (macOS) or Ctrl+S (Windows).
You can verify by checking that the file now shows 3 agent blocks: researcher, question_generator, and answer_expert.
Seeing YAML indentation errors?
YAML is sensitive to indentation. Make sure each role, goal, and backstory line is indented with exactly 2 spaces under its agent name.
The > symbol after backstory means the text continues on the next lines as a single paragraph. Make sure those continuation lines are indented further (4 spaces from the left edge).
Help me fix YAML indentation in my agents.yaml file.
✔️ Awesome, I've got everything!
Great. Double check you have saved both .env and agents.yaml.
ⓧ I'd like to double check the full code
Here is what your .env file should look like:
GROQ_API_KEY=your-groq-api-key-here
And here is the complete agents.yaml file:
researcher:
role: "Senior Agentic AI Researcher"
goal: "Research the given topic thoroughly and provide comprehensive, accurate, up-to-date information with key concepts, patterns, and real-world examples"
backstory: >
You are a world-class AI researcher with deep expertise in Agentic AI,
multi-agent systems, LLMs, and production AI architectures. You have
published papers on agent orchestration and have hands-on experience
building production agent systems. You always provide factual, well-structured
research with clear explanations.
question_generator:
role: "Technical Interview Question Designer"
goal: "Create 10 interview questions ranging from easy to hard based on the research provided, covering both conceptual understanding and practical implementation"
backstory: >
You are a senior technical interviewer at a top AI company. You have
conducted 500+ interviews for Agentic AI roles. You know exactly what
separates junior candidates from senior ones. Your questions test real
understanding, not just memorization. You always include a mix of
definitional, scenario-based, and system design questions.
answer_expert:
role: "Agentic AI Answer Specialist"
goal: "Write detailed, interview-ready answers for each question that demonstrate deep understanding, include code examples where relevant, and use real-world analogies for clarity"
backstory: >
You are a staff engineer who has cleared interviews at multiple FAANG
companies for Agentic AI roles. You know how to structure answers that
impress interviewers: start with a direct answer, then explain the why,
give a real-world example, and mention trade-offs. You write in a clear,
confident style mixing English with Hindi explanations (Hinglish) to make
concepts accessible.
Tumhara project structure ready hai aur agents defined hain. Next up, tum tasks define karogi jo yeh agents execute karenge, aur seekhogi ki Sequential Process mein agents kaise collaborate karte hain.
Define Tasks and Configure Orchestration
Ab tumhare agents ready hain, lekin unhe koi kaam (task) nahi diya gaya hai. Agents bina tasks ke kuch nahi kar sakte.
Is step mein tum har agent ko ek specific task assign karoge, phir unhe ek Sequential Process mein connect karoge jahan ek agent ka output dusre agent ka input ban jaayega. Yeh assembly line jaisa kaam karega: Research leads to Questions leads to Answers.
In this step, get ready to:
- Define 3 tasks in tasks.yaml with descriptions and expected outputs.
- Configure crew.py with the Sequential Process orchestration pattern.
- Set up main.py to kickoff the crew with an input topic.
Define 3 tasks in tasks.yaml
Har agent ko ek clear task chahiye jismein bataya gaye ki kya karna hai aur output kaisa hona chahiye. CrewAI mein tasks ko YAML mein define karte hain with three key fields: description (kya karna hai), expected_output (output kaisa hona chahiye), aur agent (kaun karega).
- In IntelliJ, open the file src/interview_prep_crew/config/tasks.yaml.
- Delete all the default scaffolded content in this file.
- Paste the following 3 task definitions:
research_task:
description: >
Research the topic "{topic}" comprehensively. Cover:
1. Core definition and how it works
2. Key components and architecture patterns
3. Real-world use cases and production examples
4. Common pitfalls and failure modes
5. How it relates to other Agentic AI concepts
6. Latest developments in 2025-2026
Provide factual, well-organized research that can be used to create interview questions.
expected_output: >
A comprehensive research document with 6 clearly labeled sections covering
the topic in depth. Each section should have specific details, examples,
and technical accuracy. Minimum 800 words.
agent: researcher
question_generation_task:
description: >
Based on the research provided, create exactly 10 interview questions about "{topic}".
Structure them as:
- Questions 1-3: Easy (definitional, basic understanding)
- Questions 4-6: Medium (scenario-based, compare and contrast)
- Questions 7-9: Hard (system design, production trade-offs, debugging)
- Question 10: Expert (open-ended architecture question)
For each question, add a one-line hint about what the interviewer expects to hear.
expected_output: >
A numbered list of exactly 10 interview questions, clearly labeled by
difficulty (Easy/Medium/Hard/Expert). Each question followed by
"Interviewer expects:" with a one-line hint.
agent: question_generator
answer_writing_task:
description: >
Write detailed, interview-ready answers for all 10 questions provided.
For each answer:
1. Start with a direct 1-2 sentence answer (TL;DR)
2. Explain the concept in depth with Hinglish explanations in parentheses
3. Give a real-world analogy or example
4. Include a code snippet if applicable (Python)
5. Mention trade-offs or "what interviewers want to hear"
Keep the tone confident but accessible. Use Hinglish naturally.
expected_output: >
A complete interview prep document with all 10 questions and detailed
answers. Each answer should be 150-300 words with clear structure.
Format as Markdown with proper headings. Save to output/interview_prep.md.
agent: answer_expert
output_file: output/interview_prep.md
What does this YAML do?
- research_task tells the researcher agent to cover 6 specific areas about the input topic. The {topic} placeholder gets replaced at runtime with whatever topic you choose.
- question_generation_task instructs the question generator to create exactly 10 questions with a difficulty gradient from Easy to Expert.
- answer_writing_task tells the answer expert to write detailed Hinglish answers. The output_file field automatically saves the final output to output/interview_prep.md.
- Save tasks.yaml.
- Check that IntelliJ shows no yellow or red warning highlights in the file. YAML is indent-sensitive, so make sure each nested key is indented with exactly 2 spaces.
Seeing red highlights in the YAML?
- YAML uses spaces only. If you used tabs, replace them with 2 spaces per indent level.
- Make sure there is a space after each colon (agent: researcher not agent:researcher).
- The > symbol after description: means multi-line text. All following indented lines become one paragraph.
Still stuck? Help me fix YAML indentation errors in my tasks.yaml file
Configure crew.py with Sequential Process
Ab tumhe crew.py mein sab kuch connect karna hai. Yeh file agents ko LLM se jorti hai, tasks assign karti hai, aur orchestration pattern set karti hai.
- In IntelliJ, open src/interview_prep_crew/crew.py.
- Delete all the default scaffolded content.
- Paste the following imports and class setup:
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
@CrewBase
class InterviewPrepCrew:
"""Interview Prep Crew - Multi-Agent System for Agentic AI Interview Preparation"""
# Point to YAML config files
agents_config = "config/agents.yaml"
tasks_config = "config/tasks.yaml"
def __init__(self):
# Configure the Groq LLM with controlled settings
self.groq_llm = LLM(
model="groq/llama-3.3-70b-versatile",
temperature=0.4,
max_tokens=4096,
)
What does this setup do?
- @CrewBase is a CrewAI decorator that wires up the YAML configs automatically with the class methods.
- groq_llm configures the Groq LLM with temperature=0.4 (low creativity for factual answers) and max_tokens=4096 (limits response length for cost control).
- The groq/llama-3.3-70b-versatile model prefix tells CrewAI to route requests through Groq's fast inference API.
- Below the __init__ method, add the 3 agent methods:
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config["researcher"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
@agent
def question_generator(self) -> Agent:
return Agent(
config=self.agents_config["question_generator"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
@agent
def answer_expert(self) -> Agent:
return Agent(
config=self.agents_config["answer_expert"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
What are max_iter and verbose?
max_iter=5 is a guardrail. It limits each agent to maximum 5 iterations of its thinking loop. Without this, an agent could loop forever trying to improve its answer (costing you API credits and time).
verbose=True makes each agent print its thinking process to the terminal. You will see exactly how the agent reasons through its task in the next step.
- Below the agent methods, add the 3 task methods and the crew orchestration method:
@task
def research_task(self) -> Task:
return Task(config=self.tasks_config["research_task"])
@task
def question_generation_task(self) -> Task:
return Task(config=self.tasks_config["question_generation_task"])
@task
def answer_writing_task(self) -> Task:
return Task(config=self.tasks_config["answer_writing_task"])
@crew
def crew(self) -> Crew:
# Sequential process: agents work one after another
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
max_rpm=25,
)
What is Process.sequential?
Process.sequential means agents work one after another like an assembly line. Research Agent finishes first, then Question Generator uses that research, then Answer Expert uses those questions.
max_rpm=25 limits API requests to 25 per minute. Groq's free tier allows 30 RPM, so this keeps you safely under the limit.
What is Sequential vs Hierarchical Process?
Interview mein yeh common question hai. Sequential mein agents ek ke baad ek kaam karte hain (assembly line jaisa). Hierarchical mein ek manager agent baaki agents ko delegate karta hai, deciding who does what dynamically.
Humare project mein Sequential perfect hai kyunki output chain hai: Research comes first, Questions depend on Research, and Answers depend on Questions. Interview mein bolna: "I chose Sequential because my tasks have a linear dependency chain."
- Save crew.py.
- Check that IntelliJ shows no red underlines on the import statements at the top. If you see errors on crewai imports, that is okay for now. They resolve when you run crewai install in the next step.
Red underlines on crewai imports?
IntelliJ may not recognize the crewai package until you install project dependencies. This is expected and will resolve in Step 5 when you run the project. The important thing is that your code has no syntax errors (missing colons, wrong indentation, typos in method names).
If you see a typo-related error, help me find the syntax error in my crew.py file
✔️ Awesome, I've got everything!
Great. Double check you have saved crew.py and move on to the next file.
ⓧ I'd like to double check the full code
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
@CrewBase
class InterviewPrepCrew:
"""Interview Prep Crew - Multi-Agent System for Agentic AI Interview Preparation"""
agents_config = "config/agents.yaml"
tasks_config = "config/tasks.yaml"
def __init__(self):
self.groq_llm = LLM(
model="groq/llama-3.3-70b-versatile",
temperature=0.4,
max_tokens=4096,
)
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config["researcher"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
@agent
def question_generator(self) -> Agent:
return Agent(
config=self.agents_config["question_generator"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
@agent
def answer_expert(self) -> Agent:
return Agent(
config=self.agents_config["answer_expert"],
llm=self.groq_llm,
verbose=True,
max_iter=5,
)
@task
def research_task(self) -> Task:
return Task(config=self.tasks_config["research_task"])
@task
def question_generation_task(self) -> Task:
return Task(config=self.tasks_config["question_generation_task"])
@task
def answer_writing_task(self) -> Task:
return Task(config=self.tasks_config["answer_writing_task"])
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
max_rpm=25,
)
Set up main.py to kickoff the crew
The last file is main.py. This is the entry point that tells your crew which topic to research and starts the entire multi-agent collaboration.
- In IntelliJ, open src/interview_prep_crew/main.py.
- Delete all the default scaffolded content.
- Paste the following code:
#!/usr/bin/env python
import sys
import os
from interview_prep_crew.crew import InterviewPrepCrew
def run():
"""Run the Interview Prep Crew."""
# Default topic for interview prep
topic = "Multi-Agent Orchestration Patterns - ReAct, Plan-and-Execute, and Hierarchical Agents"
# Allow custom topic from command line arguments
if len(sys.argv) > 1:
topic = " ".join(sys.argv[1:])
print(f"\n{'='*60}")
print(f" AGENTIC AI INTERVIEW PREP CREW")
print(f" Topic: {topic}")
print(f"{'='*60}\n")
# Create output directory if it doesn't exist
os.makedirs("output", exist_ok=True)
inputs = {"topic": topic}
result = InterviewPrepCrew().crew().kickoff(inputs=inputs)
print(f"\n{'='*60}")
print(f" CREW COMPLETE!")
print(f" Check output/interview_prep.md for your prep material")
print(f"{'='*60}\n")
return result
if __name__ == "__main__":
run()
What does this code do?
- topic variable sets the default research subject. You can change this to any Agentic AI topic you want to prep for.
- os.makedirs("output", exist_ok=True) creates an output folder where the final interview prep document will be saved.
- InterviewPrepCrew().crew().kickoff(inputs=inputs) is the magic line. It creates the crew, starts the Sequential Process, and passes the topic to all tasks via the {topic} placeholder in your YAML.
What is the ReAct Pattern?
Jab tera crew run hoga, har agent internally ReAct pattern follow karega. ReAct ka matlab hai: Reason (sochna kya karna hai), Act (response generate karna ya tool call karna), Observe (result check karna).
Yeh loop tab tak chalta hai jab tak task complete na ho ya max_iter limit hit na ho. Next step mein jab tum verbose=True output dekhogi, tumhe yeh Reason-Act-Observe loop live dikhega. Interview mein bolna: "Each agent uses the ReAct loop internally to break down complex tasks into iterative steps."
- Save main.py.
You will not see any output yet. In the next step, you will run the crew and watch all three agents collaborate in real time.
✔️ Awesome, I've got everything!
Great. Double check you have saved main.py and move on.
ⓧ I'd like to double check the full code
#!/usr/bin/env python
import sys
import os
from interview_prep_crew.crew import InterviewPrepCrew
def run():
"""Run the Interview Prep Crew."""
topic = "Multi-Agent Orchestration Patterns - ReAct, Plan-and-Execute, and Hierarchical Agents"
if len(sys.argv) > 1:
topic = " ".join(sys.argv[1:])
print(f"\n{'='*60}")
print(f" AGENTIC AI INTERVIEW PREP CREW")
print(f" Topic: {topic}")
print(f"{'='*60}\n")
# Create output directory if it doesn't exist
os.makedirs("output", exist_ok=True)
inputs = {"topic": topic}
result = InterviewPrepCrew().crew().kickoff(inputs=inputs)
print(f"\n{'='*60}")
print(f" CREW COMPLETE!")
print(f" Check output/interview_prep.md for your prep material")
print(f"{'='*60}\n")
return result
if __name__ == "__main__":
run()
Sab files ready hain. Next up, tum apna crew run karoge aur dekhoge ki teeno agents kaise milkar interview prep material generate karte hain.
Run the Crew and Understand Production Patterns
Your multi-agent system is fully configured with 3 specialized agents and 3 tasks wired together in a sequential pipeline.
Now comes the exciting part: running your crew and watching the agents collaborate in real-time. You will also connect what you observe in the terminal to the production patterns that interviewers ask about.
In this step, get ready to:
- Run the crew and observe the agents collaborating in real-time.
- Understand guardrails, cost control, and stopping criteria from your own code.
- Learn error recovery patterns for production agent systems.
Run the crew and observe agent collaboration
When you run a CrewAI crew with verbose=True, the terminal shows you exactly what each agent is thinking and doing. This is the ReAct Pattern in action: Reason, Act, Observe.
- Switch back to IntelliJ's terminal and make sure you are inside the interview_prep_crew project folder.
- Run your crew by entering this command:
crewai run
What does this command do?
The crewai run command installs project dependencies (first time only) and then executes your crew. It reads your .env file, loads agent and task YAML configs, and kicks off the sequential process.
This will take 2-5 minutes to complete because each agent makes multiple API calls to Groq. Watch the terminal closely while it runs.
While the crew runs, you will see detailed verbose output in the terminal showing each agent's thought process.
What is the ReAct Pattern?
ReAct stands for Reason-Act-Observe. In the terminal, you will see each agent go through this loop:
- Reason: the agent thinks about what it needs to do ("I need to research this topic thoroughly...").
- Act: the agent generates its response or calls a tool.
- Observe: the agent checks its output against the expected result.
This loop repeats until the task is complete or max_iter is reached. This is the foundational pattern interviewers ask about in every Agentic AI interview.
- Wait for the crew to finish. You should see a success message like:
============================================================
CREW COMPLETE!
Check output/interview_prep.md for your prep material
============================================================
- Open the output/interview_prep.md file in IntelliJ. You should see a full Markdown document with 10 interview questions and detailed Hinglish answers about Multi-Agent Orchestration Patterns.
Seeing a rate limit error?
Groq's free tier allows 30 requests per minute. If you see a 429 error, wait 60 seconds and run crewai run again. The max_rpm=25 setting in your crew.py is designed to stay below this limit, but occasional bursts can still trigger it.
If you see a GROQ_API_KEY error, double-check that your .env file has the correct key with no extra spaces.
Still stuck? Why is my CrewAI crew failing with an API error from Groq?
Understand guardrails and cost control
You just watched agents run autonomously. In production, autonomous agents without limits are dangerous.
What are guardrails in Agentic AI?
Guardrails are safety limits that prevent agents from running forever or burning through your API budget. Look at the settings already in your crew.py:
- max_iter=5 on each agent: this is the iteration guardrail. An agent can try a maximum of 5 times to complete its task before giving up. Without this, an agent stuck in a loop would keep retrying forever.
- max_tokens=4096 on the LLM: this limits how long each response can be. It prevents the model from generating endlessly and burning tokens.
- max_rpm=25 on the crew: this caps API requests to 25 per minute across all agents. It prevents you from hitting Groq's rate limit (30 RPM) and keeps costs predictable.
Interview mein bolna: "I implemented three layers of guardrails: iteration limits on agents, token limits on the LLM, and RPM limits on the crew."
Why are guardrails mandatory in production?
In November 2025, four LangChain agents ran a clarification loop for 11 days straight because no one set a step cap. The bill was $47,000.
This is why every production agent system MUST have stopping criteria. Your max_iter=5 setting is a stopping criterion. It tells the agent: "If you cannot complete the task in 5 attempts, stop and return your best answer."
Learn error recovery patterns
In production, APIs fail. Networks drop. Models return garbage. Your agent system needs to handle these failures gracefully.
What is max_retry_limit?
CrewAI agents have a max_retry_limit parameter (default: 2) that controls how many times an agent retries when it encounters an error. This is separate from max_iter which limits normal task iterations.
Think of it this way:
- max_iter = how many times the agent tries to improve its answer (normal operation).
- max_retry_limit = how many times the agent retries after a crash or API failure (error recovery).
Together, these form your agent's resilience layer. If Groq's API returns a 500 error, the agent will retry up to max_retry_limit times before failing gracefully.
What should you say in interviews?
When asked about production agent patterns, mention these four concepts together:
- Guardrails (max_iter = iteration cap so agents don't loop forever).
- Cost Control (max_tokens + max_rpm = budget caps on token usage and API calls).
- Stopping Criteria (the conditions under which an agent must stop, even if the task is incomplete).
- Error Recovery (max_retry_limit = graceful degradation when external services fail).
Interview mein bolna: "Production agents need circuit breakers, budget caps, and graceful degradation. I implemented these patterns in my project."
Your multi-agent system is live and generating real interview prep material. You have seen the ReAct pattern in action and understand every production safety pattern that interviews test. Ready for a bonus challenge? The Secret Mission awaits.
Secret mission
Interviewer Agent Add Karo
Teri crew abhi 3 agents ke saath kaam kar rahi hai. Lekin kya hoga agar ek 4th agent ho jo teri answers ko evaluate kare aur score de? Yeh evaluator pattern production AI systems mein quality assurance ke liye use hota hai. Is mission mein tu ek Senior Technical Interviewer agent add karegi jo har answer ko critically evaluate karega.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely on the Groq free tier, so there are no ongoing costs. Decide whether to keep your resources in place, pause them, or delete everything.
Resources you used:
- interview_prep_crew project folder on your Desktop.
- Groq API key stored in the project's .env file.
- CrewAI CLI (installed via uv tool install crewai).
- Python 3.13 (installed from python.org).
- uv package manager (installed via PowerShell script).
Keep everything running
No action needed. Choose this if you plan to keep building with CrewAI or want to rerun the crew on different topics.
- Your interview_prep_crew folder stays on your Desktop ready to use.
- Your Groq API key remains active in the free tier (no charges).
- Python 3.13, uv, and CrewAI CLI remain installed on your system.
- Your Groq account stays active with no billing impact.
Pause - I'll come back to this later
Free up space without losing your work. You can always reinstall the tools later.
- Close IntelliJ IDEA to free memory.
- Delete your Groq API key from the Groq Console to prevent unauthorized use. You can create a new one when you return.
- Keep the interview_prep_crew folder so you can pick up where you left off.
Delete - I don't want to use this again
Remove all project resources and start fresh. Follow each step below.
- Delete the project folder. On Windows, open a terminal and run:
- On macOS/Linux, run:
rmdir /s /q %USERPROFILE%\Desktop\interview_prep_crew
rm -rf ~/Desktop/interview_prep_crew
- Delete your Groq API key by going to console.groq.com, clicking API Keys in the left sidebar, and deleting the key you created for this project.
- Uninstall the CrewAI CLI by running:
uv tool uninstall crewai
- Uninstall Python 3.13 via Windows Settings > Apps > Installed apps. Search for "Python 3.13" and click Uninstall.
- Uninstall uv by running:
uv self uninstall
- If the above command does not work on Windows, manually delete the uv.exe file from your user .local\bin directory.
That's a Wrap!
That's a Wrap!
Badhai ho yaar! Tu ab officially ek Agentic AI builder hai. Tune aaj ek complete Multi-Agent AI system build kiya with specialized agents collaborating like a real team.
You've learned how to:
- Build a production-style Multi-Agent System using CrewAI with role-based agent composition, sequential orchestration, and Groq for fast, free inference.
- Apply core Agentic AI interview concepts hands-on: the ReAct Pattern (Reason, Act, Observe loop), Agent Architecture (role, goal, backstory), and production guardrails like max_iter and max_rpm for cost control.
- Configure a full Sequential Process pipeline where agents pass output to each other (Research, Questions, Answers) and generate real interview prep material saved to Markdown files.
- Secret Mission: Added a 4th Interviewer Agent implementing the evaluator pattern for automated quality assurance in multi-agent systems.
Ready to quiz yourself?