Build an AI Engineering Assistant
Build a free AI assistant that plans hardware projects using Gemini.
Introduction
30 Second Summary
Every maker, student, and hobbyist has had a hardware project idea and no clue where to start. What components do you need? How do they connect? What will it cost? AI assistants can help, but most charge $20/month or more.
In this project, you will build EngineerBot, a free AI engineering assistant that runs in your terminal. It breaks down any hardware project idea into subsystems, suggests specific components with part numbers, and writes starter code for microcontrollers.
What You'll Build
A Python terminal chatbot that connects to Google's Gemini AI and specializes in hardware and software project planning.
By the end of this project, you'll have:
- A working AI engineering assistant that breaks hardware projects into subsystems and suggests specific components with real part numbers.
- Hands-on experience with API integration, system prompting, and multi-turn conversations. This is the same architecture that powers products like ChatGPT and Claude.
- A foundation you can expand into a real product that helps makers plan and build hardware projects for free.
- Secret Mission: Add a project export feature that saves your full conversation and build plan to a markdown file you can share or print.
Are there any prerequisites?
None. This guide includes full setup for all required tools, including Python, VS Code, and your free Gemini API key. You just need a computer and a Google account.
Install Python and Set Up Your Project
EngineerBot is a Python project that talks to Google's AI through an API.
Before you can write any code, you need Python installed on your machine and a project folder ready to work in. This step gets your entire development environment set up from scratch.
In this step, get ready to:
- Install Python and confirm it works in your terminal.
- Create your project folder and open it in VS Code.
- Install the Google GenAI SDK package.
Download and install Python
Python is the programming language you will use to build EngineerBot. The google-genai package requires Python 3.10 or higher.
- In VS Code, open a terminal by pressing Ctrl+` (macOS) or Ctrl+` (Windows). The backtick key is above the Tab key.
- Check if Python is already installed by running this command:
python --version
Look at what your terminal shows and pick the matching tab below.
✔️ I see version 3.10 or higher
Python is ready to go. You can skip ahead to the next substep.
ⓧ I see an older version
You need Python 3.10 or higher for this project. Download the latest version and install it alongside your current one.
- Open your browser and go to python.org/downloads.
- Click the big yellow Download Python 3.14.x button.
- Run the downloaded installer.
- On the very first installer screen, check the box that says Add python.exe to PATH at the bottom. This is critical.
- Click Install Now and wait for the installation to complete.
- Close your current terminal by clicking the trash icon in the terminal panel.
- Open a fresh terminal by pressing Ctrl+`.
- Run python --version again. You should now see Python 3.14.5 or similar.
Still seeing the old version?
If python --version still shows the old version after reopening your terminal, try running py --version instead. The Python Launcher for Windows sometimes resolves to the newer install.
If neither works, fully close VS Code and reopen it so the PATH changes take effect. Help me troubleshoot my Python version
ⓧ Command not found
Python is not installed yet. On Windows, you might see an error message or the Microsoft Store might open. Close any store window that appears.
- Open your browser and go to python.org/downloads.
- Click the big yellow Download Python 3.14.x button.
- Run the downloaded installer.
- On the very first installer screen, check the box that says Add python.exe to PATH at the bottom. This is critical.
- Click Install Now and wait for the installation to complete.
- Close your current terminal by clicking the trash icon in the terminal panel.
- Open a fresh terminal by pressing Ctrl+`.
- Run python --version again. You should now see Python 3.14.5 or similar.
Still not working?
Make sure you checked Add python.exe to PATH during installation. Without it, your terminal cannot find the python command.
If you missed that checkbox, run the installer again, select Modify, and ensure the PATH option is enabled. Help me fix my Python installation
Why does the PATH matter?
Your terminal can only run programs it knows the location of. Adding Python to PATH tells Windows where to find the python program so you can run it from any folder.
Create your project folder
Every project needs its own folder to keep files organized. You will create a folder called engineerbot on your Desktop and open it in VS Code.
- Move to your Desktop by running this command:
cd ~/Desktop
- Create your project folder and move into it by running these commands:
mkdir engineerbot
cd engineerbot
- Confirm the folder was created by running:
pwd
You should see a path ending in engineerbot, confirming you are inside your new project folder.
- Now open this folder in VS Code. Click File in the top menu bar.
- Click Open Folder.
- Navigate to your Desktop, select the engineerbot folder, and click Select Folder.
VS Code reloads with engineerbot as your workspace. You should see the folder name in the Explorer sidebar on the left.
- Open a fresh terminal in this workspace by pressing Ctrl+`.
Terminal opens in the wrong folder?
If your terminal does not show engineerbot in the prompt path, make sure you opened the folder with File > Open Folder (not just dragged a file in). VS Code sets the terminal's starting location to whatever folder you opened.
Help me fix my VS Code terminal location
Install the Google GenAI SDK
The google-genai package is the official Python library for talking to Google's Gemini AI. It handles all the network communication so you can focus on building your bot.
- Install the package by running this command in your terminal:
pip install google-genai
What does this command do?
pip is Python's package manager. It downloads the google-genai library (and its dependencies) from the internet and installs them so your Python scripts can use them.
You should see output scrolling as packages download. Once it finishes, look for a line near the end that says Successfully installed followed by a list of package names.
Seeing a 'pip not found' error?
If your terminal does not recognize pip, try running python -m pip install google-genai instead. This calls pip through the Python executable directly.
Help me install the google-genai package
Your development environment is ready. Next up, you will grab your free Gemini API key so EngineerBot can actually talk to the AI.
Get Your Free Gemini API Key
Your environment is set up with Python and the Google GenAI package installed. Now you need the one thing that connects your code to Google's AI: an API key.
An API key is like a password that lets your script talk to Google's servers. You will get yours for free from Google AI Studio, then wire it into a new Python file.
In this step, get ready to:
- Sign in to Google AI Studio and get your free API key.
- Create engineerbot.py and connect it to the Gemini API.
Sign in to Google AI Studio
Google AI Studio is the free web dashboard where you manage your Gemini API keys. For new users, it automatically creates a project and an API key the moment you sign in.
- Open your browser and go to aistudio.google.com.
- Sign in with your Google account.
- Accept the Terms of Service if prompted.
What happens when you sign in?
Google AI Studio creates a default Google Cloud project and API key for you automatically. You do not need to set up billing, enter a credit card, or configure anything manually.
Copy your API key
Your API key lives on the API Keys page inside AI Studio. You need to copy it so you can paste it into your code.
- In the left side panel, click Get API key.
- You should see your API key listed on the page. If you do not have one yet, click Create API key.
- Click the copy icon next to your key to copy it to your clipboard.
Why is this free?
As long as you do not link an active Google Cloud Billing account to your project, you remain on the Free Tier. You will not be charged, but you will be subject to strict API rate limits.
No credit card required. No surprise bills. The free tier gives you enough requests to build and test this entire project.
Seeing a permission denied error?
Make sure you are using a personal Google account, not a work or school account managed by an organization. Workspace accounts sometimes have restrictions that block API key creation.
Try opening AI Studio in an incognito window with your personal account if you see issues. Help me troubleshoot my API key creation in Google AI Studio.
Create your Python file and add the API key
Now you will create the main file for your project and paste your API key into it. This file is where all of your EngineerBot code will live.
- In VS Code, hover over the ENGINEERBOT section in the Explorer sidebar on the left.
- Click the New File icon (the page icon with a plus sign).
- Type engineerbot.py and press Enter.
- Paste the following code into engineerbot.py:
from google import genai
from google.genai import types
# Your free Gemini API key from Google AI Studio
API_KEY = "your-api-key-here"
- Replace your-api-key-here with the API key you copied from Google AI Studio. Keep the quotation marks around it.
What does this code do?
The first two lines import the Google GenAI library. genai gives you the client that talks to Google's servers. types gives you configuration objects you will use later to set up system prompts.
The API_KEY variable stores your personal key so the rest of your code can reference it when connecting to the Gemini API.
- Save engineerbot.py by pressing Ctrl+S (Windows) or Cmd+S (macOS).
- Verify the file runs without errors by running this command in your terminal:
python engineerbot.py
The script should exit silently with no output and no errors. That confirms your imports are correct and your file is saved properly.
Seeing a ModuleNotFoundError?
If you see an error mentioning that the google module cannot be found, the google-genai package did not install correctly in the previous step.
Run pip install google-genai again in your terminal and check that it completes without errors. Help me fix my google-genai import error.
✔️ Awesome, I've got everything!
Great. Double check that you have saved engineerbot.py and that running it produces no errors.
ⓧ I'd like to double check the full code
Here is the complete engineerbot.py file so far:
from google import genai
from google.genai import types
# Your free Gemini API key from Google AI Studio
API_KEY = "your-api-key-here"
Your file is connected to Google's AI. Next up, you will write the system prompt that turns a generic AI into a specialized engineering assistant.
Write the Engineering Brain
Your API key is ready and your file is connected to Google's servers. Now it's time to give your AI a personality and specialty.
A system prompt is a set of hidden instructions that shapes how an AI responds. Every AI product you've used (ChatGPT, Claude, Flux's Copilot) is a general-purpose model with a system prompt bolted on top. Your system prompt is what turns generic Gemini into a specialist hardware engineer.
In this step, get ready to:
- Write a system prompt that turns Gemini into a hardware engineering specialist.
- Test the connection with a single API call to confirm everything works.
Write the system prompt
Your system prompt tells the AI exactly how to behave. You'll instruct it to break projects into subsystems, suggest specific components with part numbers, and format responses in a structured way that's actually useful for building things.
- In VS Code, open engineerbot.py.
- Below your API_KEY line, add the following system prompt:
# The engineering brain - this is what makes your bot better than generic ChatGPT
SYSTEM_PROMPT = """You are EngineerBot, a senior hardware and software engineer with 20 years of experience designing consumer electronics, robotics, IoT devices, and embedded systems.
When a user describes a project idea, you ALWAYS respond with this structure:
## Project Overview
Brief description of what they're building and why it's cool.
## Subsystems Breakdown
Break the project into logical subsystems:
- Power System
- Compute/Control (MCU or processor)
- Sensors/Input
- Actuators/Output
- Communication (if needed)
- Structure/Enclosure
## Component List
For each subsystem, list specific components with:
- Component name and part number (use common, widely available parts)
- Approximate cost in USD
- Where to buy (Amazon, Adafruit, SparkFun, AliExpress, DigiKey)
## Connections Guide
Explain how the components connect to each other. Use pin names and wire colors where helpful.
## Starter Code
If the project involves a microcontroller, provide starter code (Arduino/MicroPython preferred for beginners).
## Estimated Total Cost
Sum up the component costs.
## Build Difficulty
Rate as: Beginner / Intermediate / Advanced and explain why.
RULES:
- Always suggest the CHEAPEST option that works reliably
- Prefer widely available components (Arduino Nano, ESP32, Raspberry Pi Pico)
- If the user's idea is too complex, break it into phases they can build incrementally
- Be specific with part numbers, not vague. Real parts only.
- If you don't know a specific part number, say so honestly
- Always consider the user might be a beginner with limited tools
- For follow-up questions, don't repeat the full structure. Answer directly and concisely.
"""
What does this system prompt do?
This prompt does three things that turn a generic AI into a useful engineering tool:
- It assigns a persona (senior engineer with 20 years of experience) so the AI responds with authority and specificity instead of vague suggestions.
- It enforces a response structure (subsystems, component list, connections guide) so every answer is actionable and organized the same way.
- It sets rules about cost, availability, and honesty so the AI stays practical for hobbyists instead of recommending expensive or obscure parts.
- Save engineerbot.py.
You won't see a change yet. The next substep uses this prompt to make an actual API call.
Why a system prompt instead of fine-tuning?
Fine-tuning requires training data, GPU access, and ML expertise. System prompting achieves 90% of the same specialization with zero cost and zero training.
This is exactly how products like ChatGPT and Claude work under the hood. A general-purpose model receives hidden system instructions that shape its behavior for each use case.
Test your system prompt with an API call
Before building the full chat interface, you need to confirm that your API key and system prompt are working together. You'll add temporary test code, run it, and then remove it.
- At the very bottom of engineerbot.py, below the closing """ of SYSTEM_PROMPT, add this temporary test code:
# Temporary test - delete this after confirming it works
client = genai.Client(api_key=API_KEY)
response = client.models.generate_content(
model="gemini-3.5-flash",
config=types.GenerateContentConfig(
system_instruction=SYSTEM_PROMPT
),
contents="Design me a simple LED blink circuit"
)
print(response.text)
What does this test code do?
- genai.Client(api_key=API_KEY) creates a connection to Google's Gemini API using your free key.
- client.models.generate_content() sends a single request to the AI with your system prompt and a test question.
- print(response.text) displays whatever the AI sends back.
- Save engineerbot.py.
- Run your script by entering this command in the terminal:
python engineerbot.py
After a few seconds, you should see a structured response about an LED blink circuit. It will include sections like Project Overview, Subsystems Breakdown, Component List, and more.
Not seeing a response?
- If you see an "invalid API key" error, double check that the key in your API_KEY variable matches what you copied from Google AI Studio. Make sure there are no extra spaces.
- If you see a "module not found" error, confirm you installed the package by running pip install google-genai again.
- If the command hangs for more than 30 seconds, check your internet connection. The API call requires a network request to Google's servers.
Why isn't my Gemini API call returning a response?
- Once you see a successful response, delete the temporary test code you just added (everything below the closing """ of SYSTEM_PROMPT).
- Save engineerbot.py.
Why delete the test code?
This test was a one-off confirmation that your key and prompt work. In the next step, you'll build a proper chat loop that handles the API calls in a reusable way.
✔️ Awesome, I've got everything!
Great. Double check you've saved your file after removing the test code.
ⓧ I'd like to double check the full code
Here's what your engineerbot.py should look like at this point:
from google import genai
from google.genai import types
# Your free Gemini API key from Google AI Studio
API_KEY = "your-api-key-here"
# The engineering brain - this is what makes your bot better than generic ChatGPT
SYSTEM_PROMPT = """You are EngineerBot, a senior hardware and software engineer with 20 years of experience designing consumer electronics, robotics, IoT devices, and embedded systems.
When a user describes a project idea, you ALWAYS respond with this structure:
## Project Overview
Brief description of what they're building and why it's cool.
## Subsystems Breakdown
Break the project into logical subsystems:
- Power System
- Compute/Control (MCU or processor)
- Sensors/Input
- Actuators/Output
- Communication (if needed)
- Structure/Enclosure
## Component List
For each subsystem, list specific components with:
- Component name and part number (use common, widely available parts)
- Approximate cost in USD
- Where to buy (Amazon, Adafruit, SparkFun, AliExpress, DigiKey)
## Connections Guide
Explain how the components connect to each other. Use pin names and wire colors where helpful.
## Starter Code
If the project involves a microcontroller, provide starter code (Arduino/MicroPython preferred for beginners).
## Estimated Total Cost
Sum up the component costs.
## Build Difficulty
Rate as: Beginner / Intermediate / Advanced and explain why.
RULES:
- Always suggest the CHEAPEST option that works reliably
- Prefer widely available components (Arduino Nano, ESP32, Raspberry Pi Pico)
- If the user's idea is too complex, break it into phases they can build incrementally
- Be specific with part numbers, not vague. Real parts only.
- If you don't know a specific part number, say so honestly
- Always consider the user might be a beginner with limited tools
- For follow-up questions, don't repeat the full structure. Answer directly and concisely.
"""
Your engineering brain is locked in. The AI now knows how to think like a hardware engineer. Next up, you'll build the chat loop so you can have a real back-and-forth conversation with EngineerBot.
Build the Chat Loop
In the previous step, you confirmed that your system prompt and API key work by getting a successful response from Gemini. That single call proved the wiring is solid.
Now you need something better than a one-shot call. Real AI assistants maintain a conversation, remembering everything you discussed so you can ask follow-up questions. In this step, you will build a full chat loop that turns your script into an interactive terminal app.
In this step, get ready to:
- Create a reusable chat session that remembers your conversation history.
- Build an export function that saves conversations to a markdown file.
- Wire up a terminal input loop with commands to quit, start fresh, and export.
Create the multi-turn chat session
A single API call forgets everything the moment it responds. A chat session keeps a running history of every message, so the AI can reference earlier context when answering follow-up questions.
- In engineerbot.py, scroll to the blank line after the closing """ of SYSTEM_PROMPT.
- Add the following function below SYSTEM_PROMPT:
def create_chat():
"""Create a new chat session with the engineering system prompt."""
client = genai.Client(api_key=API_KEY)
chat = client.chats.create(
model="gemini-3.5-flash",
config=types.GenerateContentConfig(
system_instruction=SYSTEM_PROMPT
),
)
return chat
What does this code do?
This function wraps the chat session setup into something you can call whenever you need a fresh conversation.
- genai.Client(api_key=API_KEY) creates an authenticated connection to the Gemini API.
- client.chats.create() starts a stateful chat session that automatically tracks every message back and forth.
- system_instruction=SYSTEM_PROMPT injects your engineering brain so the AI behaves as a hardware expert from the very first message.
Why a chat session instead of single calls?
With single generate_content calls, you would need to manually rebuild the entire conversation history every time the user sends a message.
The chat session handles this for you. It stores every turn and sends the full context to the model automatically, so follow-up questions like "What if I add WiFi?" just work.
- Save engineerbot.py.
You will not see a change yet. The create_chat() function is ready to use but nothing calls it until you build the main loop.
Add the conversation export function
Before building the main loop, you need the export function that saves your conversations to a shareable markdown file. The main loop will reference this function, so it must exist first.
- Add this function below create_chat():
def export_conversation(chat, filename=None):
"""Export the conversation history to a markdown file."""
from datetime import datetime
if filename is None:
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"buildplan_{timestamp}.md"
history = chat.get_history()
with open(filename, "w", encoding="utf-8") as f:
f.write("# EngineerBot Build Plan\n\n")
f.write(f"**Generated**: {datetime.now().strftime('%Y-%m-%d %H:%M')}\n\n")
f.write("---\n\n")
for message in history:
role = "You" if message.role == "user" else "EngineerBot"
text = message.parts[0].text if message.parts else ""
f.write(f"### {role}:\n\n{text}\n\n---\n\n")
print(f"\n[Exported to: {filename}]")
What does this code do?
- chat.get_history() retrieves a list of every message in the conversation, each with a .role (either "user" or "model") and .parts containing the text.
- The function generates a timestamped filename like buildplan_20260606_143022.md so each export is unique.
- It loops through every message and writes it as formatted markdown with role labels (You or EngineerBot) and horizontal dividers between each turn.
- Save engineerbot.py.
No visible change yet. This function will be triggered by the export command you are about to build in the main loop.
Build the main loop with commands
The main loop is where everything comes together. It prints a welcome message, waits for the user to type something, sends it to the AI, and prints the response.
- Add the main() function below export_conversation():
def main():
"""Main chat loop."""
print("=" * 60)
print(" ENGINEERBOT - Free AI Engineering Assistant")
print(" Built to help makers plan hardware projects")
print("=" * 60)
print()
print("Commands:")
print(" quit - Exit EngineerBot")
print(" new - Start a fresh conversation")
print(" export - Save this conversation as a markdown file")
print()
print("Try: 'Design me a simple Arduino weather station'")
print()
chat = create_chat()
while True:
try:
user_input = input("You: ").strip()
except (KeyboardInterrupt, EOFError):
print("\nGoodbye!")
break
if not user_input:
continue
if user_input.lower() == "quit":
print("Goodbye! Keep building.")
break
if user_input.lower() == "new":
chat = create_chat()
print("\n[New conversation started]\n")
continue
if user_input.lower() == "export":
export_conversation(chat)
continue
try:
response = chat.send_message(user_input)
print(f"\nEngineerBot:\n{response.text}\n")
except Exception as e:
print(f"\n[Error: {e}]")
print("[Try again or type 'new' to start fresh]\n")
if __name__ == "__main__":
main()
What does this code do?
The main() function runs the entire chat experience from start to finish.
- The print() lines at the top display a welcome banner with available commands so the user knows what they can do.
- chat = create_chat() starts a fresh AI conversation using the engineering system prompt.
- The while True loop waits for input, checks for commands (quit, new, export), and sends anything else to the AI.
- chat.send_message(user_input) sends the message and returns the AI's response, which you access via response.text.
- The try/except around send_message catches network errors or API issues so the app does not crash.
- if __name__ == "__main__" ensures main() runs when you execute the script directly.
- Save engineerbot.py.
- In your terminal, run EngineerBot by running:
python engineerbot.py
You should see the welcome banner with the commands listed and a You: prompt waiting for your input.
- Type quit and press Enter to exit for now.
Seeing an error when you run the script?
- If you see NameError: name 'create_chat' is not defined, make sure create_chat() is defined above main() in the file. Python reads top to bottom.
- If you see IndentationError, check that every line inside a function is indented with exactly 4 spaces.
- If the script runs but immediately exits, make sure if __name__ == "__main__": is at the very bottom of the file with no indentation.
Still stuck? Help me debug why my engineerbot.py script is not running correctly
✔️ Awesome, I've got everything!
Great. Double check you have saved engineerbot.py and that the script runs without errors.
ⓧ I'd like to double check the full code
from google import genai
from google.genai import types
# Your free Gemini API key from Google AI Studio
API_KEY = "your-api-key-here"
# The engineering brain - this is what makes your bot better than generic ChatGPT
SYSTEM_PROMPT = """You are EngineerBot, a senior hardware and software engineer with 20 years of experience designing consumer electronics, robotics, IoT devices, and embedded systems.
When a user describes a project idea, you ALWAYS respond with this structure:
## Project Overview
Brief description of what they're building and why it's cool.
## Subsystems Breakdown
Break the project into logical subsystems:
- Power System
- Compute/Control (MCU or processor)
- Sensors/Input
- Actuators/Output
- Communication (if needed)
- Structure/Enclosure
## Component List
For each subsystem, list specific components with:
- Component name and part number (use common, widely available parts)
- Approximate cost in USD
- Where to buy (Amazon, Adafruit, SparkFun, AliExpress, DigiKey)
## Connections Guide
Explain how the components connect to each other. Use pin names and wire colors where helpful.
## Starter Code
If the project involves a microcontroller, provide starter code (Arduino/MicroPython preferred for beginners).
## Estimated Total Cost
Sum up the component costs.
## Build Difficulty
Rate as: Beginner / Intermediate / Advanced and explain why.
RULES:
- Always suggest the CHEAPEST option that works reliably
- Prefer widely available components (Arduino Nano, ESP32, Raspberry Pi Pico)
- If the user's idea is too complex, break it into phases they can build incrementally
- Be specific with part numbers, not vague. Real parts only.
- If you don't know a specific part number, say so honestly
- Always consider the user might be a beginner with limited tools
- For follow-up questions, don't repeat the full structure. Answer directly and concisely.
"""
def create_chat():
"""Create a new chat session with the engineering system prompt."""
client = genai.Client(api_key=API_KEY)
chat = client.chats.create(
model="gemini-3.5-flash",
config=types.GenerateContentConfig(
system_instruction=SYSTEM_PROMPT
),
)
return chat
def export_conversation(chat, filename=None):
"""Export the conversation history to a markdown file."""
from datetime import datetime
if filename is None:
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"buildplan_{timestamp}.md"
history = chat.get_history()
with open(filename, "w", encoding="utf-8") as f:
f.write("# EngineerBot Build Plan\n\n")
f.write(f"**Generated**: {datetime.now().strftime('%Y-%m-%d %H:%M')}\n\n")
f.write("---\n\n")
for message in history:
role = "You" if message.role == "user" else "EngineerBot"
text = message.parts[0].text if message.parts else ""
f.write(f"### {role}:\n\n{text}\n\n---\n\n")
print(f"\n[Exported to: {filename}]")
def main():
"""Main chat loop."""
print("=" * 60)
print(" ENGINEERBOT - Free AI Engineering Assistant")
print(" Built to help makers plan hardware projects")
print("=" * 60)
print()
print("Commands:")
print(" quit - Exit EngineerBot")
print(" new - Start a fresh conversation")
print(" export - Save this conversation as a markdown file")
print()
print("Try: 'Design me a simple Arduino weather station'")
print()
chat = create_chat()
while True:
try:
user_input = input("You: ").strip()
except (KeyboardInterrupt, EOFError):
print("\nGoodbye!")
break
if not user_input:
continue
if user_input.lower() == "quit":
print("Goodbye! Keep building.")
break
if user_input.lower() == "new":
chat = create_chat()
print("\n[New conversation started]\n")
continue
if user_input.lower() == "export":
export_conversation(chat)
continue
try:
response = chat.send_message(user_input)
print(f"\nEngineerBot:\n{response.text}\n")
except Exception as e:
print(f"\n[Error: {e}]")
print("[Try again or type 'new' to start fresh]\n")
if __name__ == "__main__":
main()
Your EngineerBot is alive and ready to talk. Next up, you will put it through its paces by asking it to plan real hardware projects and testing that it remembers context across follow-up questions.
Test EngineerBot with Real Projects
Your EngineerBot is fully built. The system prompt, chat loop, and export feature are all in place.
Now it is time to put it through real engineering prompts and see if it actually delivers structured, useful build plans. This is where you find out if your system prompt does its job.
In this step, get ready to:
- Test EngineerBot with a beginner hardware project prompt.
- Verify multi-turn memory by asking follow-up questions.
- Push it with a complex project to check structured output formatting.
Test with an Arduino weather station prompt
A weather station is a classic beginner hardware project. It involves sensors, a display, a microcontroller, and wiring. This makes it a perfect test for every section of your system prompt.
- Run EngineerBot by running this command in your terminal:
python engineerbot.py
You should see the welcome banner with the command list and the suggestion prompt.
- At the You: prompt, type this message and press Enter:
Design me a simple Arduino-based weather station that measures temperature and humidity and displays it on an LCD screen
Wait a few seconds for the response. EngineerBot should reply with a structured plan that includes all the sections from your system prompt.
What should I see?
The response should contain clearly labeled sections: Project Overview, Subsystems Breakdown, Component List, Connections Guide, Starter Code, Estimated Total Cost, and Build Difficulty.
You should see specific component names (like DHT11 or DHT22 for temperature sensing) and real part numbers. The system prompt instructs the AI to suggest cheap, widely available parts.
Getting an error instead of a response?
If you see an error about an invalid API key, double-check that the value in your API_KEY variable matches what you copied from Google AI Studio.
If the error mentions rate limits, wait 60 seconds and try again. The free tier has per-minute request limits.
Still stuck? Help me debug my EngineerBot API error
Verify multi-turn memory with a follow-up question
A single response is easy. The real test of your chat session is whether the AI remembers what you already discussed.
- Without typing new or restarting the script, type this follow-up question at the You: prompt:
What if I want to add WiFi to upload data?
EngineerBot should answer in the context of your weather station project. It should suggest a WiFi-capable board (like an ESP32) or a WiFi module to add to the existing design.
How does multi-turn memory work?
Your create_chat() function creates a stateful chat session. Every message you send and every response from the AI gets stored in the session history. When you ask a follow-up, the API sends the full conversation so far, giving the AI context about what you already discussed.
This is the same architecture that makes ChatGPT and Claude feel like they remember your conversation. Without it, every message would be treated as a brand new question with zero context.
Response does not reference the weather station?
If the AI responds as if it has never heard of your weather station, you may have accidentally typed new between messages. The new command resets the conversation history.
Type new to start fresh, re-send the weather station prompt, then immediately follow up with the WiFi question.
Still not working? Help me troubleshoot my multi-turn chat session
Push it with a complex drone project
A drone involves many subsystems: motors, flight controllers, power distribution, radio control, and structural design. This tests whether your system prompt handles complex, multi-phase projects.
- Start a fresh conversation by typing new at the prompt.
- Type this message and press Enter:
I want to build a mini drone from scratch. Break it down for me.
The response should break the drone into phases since it is too complex for a single build. Your system prompt specifically instructs the AI to suggest incremental phases for complex projects.
Why does phased output matter?
One of the rules in your system prompt says: "If the user's idea is too complex, break it into phases they can build incrementally." This is what separates a useful engineering assistant from a generic chatbot that dumps everything at once.
A beginner asking about a drone does not need every single part listed immediately. They need a Phase 1 they can actually start with. Your system prompt teaches the AI to think this way.
- Verify the response includes the full structured format: subsystems, component list with prices, connections guide, and a difficulty rating.
- When you are done testing, type quit to exit EngineerBot.
Your EngineerBot is working end-to-end. It handles simple projects, remembers context across messages, and breaks down complex builds into actionable phases. Next up, you will take on a secret mission to make it even more powerful.
Secret mission
Export Build Plans to Markdown
Your EngineerBot can plan hardware projects, but those plans vanish when you close the terminal. Add an intelligent export feature that saves the full conversation AND generates a component shopping list summary you can take to the store.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely locally and uses the free tier of Google's Gemini API. There are no ongoing costs as long as you never link a billing account to your Google Cloud project.
Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
Resources you used:
- The engineerbot project folder (including engineerbot.py and any exported .md build plans).
- The google-genai Python package installed via pip.
- Your Gemini API key in Google AI Studio.
Keep everything running
No action needed. Choose this if you plan to keep building on EngineerBot or want to experiment with different system prompts.
- Your engineerbot folder stays on your Desktop.
- Your Gemini API key stays active on the free tier.
- The google-genai package stays installed for future Python projects.
Pause - I'll come back to this later
Free up disk space and revoke your API key for security. You can recreate the key later if you come back.
- Close any terminal sessions running EngineerBot.
- Close the engineerbot folder in VS Code.
- Delete your API key in the Google Cloud Console (see the Delete tab for full instructions). You can create a new one for free anytime.
Delete - I don't want to use this again
Remove all project resources and revoke your API key. This is a full cleanup.
Delete your Gemini API key:
- Open the Google Cloud API Credentials page at console.cloud.google.com/apis/credentials.
- Find the API key you used for this project and click the Actions icon (three dots).
- Select Delete API key.
- In the confirmation modal, click Delete. Deletion takes a few minutes to propagate.
Uninstall the google-genai package:
- Open a terminal and run:
pip uninstall google-genai
- Type y when prompted to confirm.
Delete the project folder (macOS/Linux):
rm -rf ~/Desktop/engineerbot
Delete the project folder (Windows):
rmdir /s /q %USERPROFILE%\Desktop\engineerbot
- If you exported any build plan .md files to a different location, delete those manually as well.
Nice Work!
Nice Work!
You just built a real AI product from scratch. EngineerBot is a working engineering assistant that helps makers plan hardware projects for free, powered by the same architecture that runs behind every AI company on Earth.
Here's what you learned:
- Built a working AI engineering assistant powered by Google's Gemini 3.5 Flash, connected through a real API integration.
- Wrote a custom system prompt that specializes a general-purpose AI into a domain expert who thinks like a hardware engineer.
- Implemented multi-turn conversations so the AI remembers context across your entire chat session.
- Added an export feature that saves conversations and generates a component shopping list as a shareable markdown file.
Ready to quiz yourself?