An exercise in building a new codebase from scratch using a modern AI coding agent as your partner.
Today, you will act as a developer starting a new project, using an AI agent as your primary coding partner to go from a high-level idea to a working prototype. First, set up your notes document.
Before you begin, create your notes document in the class Google Drive folder. Throughout the exercise, track your prompts, the agent's responses, any errors you encounter, and your overall experience.
Open Class Notes Folder →Challenge Yourself: We encourage you to select an environment you haven't used before. The goal is to explore new workflows, not just stick to what's familiar.
Pro Tip: Use Personas. In every prompt you write, assign an expert persona to the agent (e.g., "Act as a senior software engineer specializing in scientific Python..."). This consistently focuses the AI and improves the quality of its responses.
Pro Tip: Create Reusable Gems & Superprompts. In the Gemini web UI, you can create "Gems." Think of these as a way to save the reusable "master prompts" or "superprompts" you've developed in previous exercises. If you find yourself repeating a complex set of instructions for a specific persona or workflow (like debugging), saving it as a Gem creates your own specialized assistant you can call on anytime.
An AI assistant deeply integrated into a familiar IDE (like VS Code). Best for complex file management and a traditional development feel.
In VS Code, go to the Extensions tab, search for "Google Gemini Code Assist", and install it. Follow the setup instructions to log in with your Google account.
An AI integrated directly into a notebook environment. Excellent for data-heavy tasks, rapid prototyping, and visualization.
Open a new Google Colab notebook. You should see Gemini features integrated, including a "Generate" button in cells to help write code.
A fully conversational agent that generates and modifies code based on high-level commands. This is the most "agentic" approach.
Can be set up via the Google Cloud SDK (`gcloud`). This is an advanced option for those comfortable with the command line.
⚠️ Important: To use the free quota, make sure to authenticate with a personal Google account using OAuth. If you use an API key, you will be charged.
For those already familiar with coding agents, consider a more complex setup: having one agent call another. This is known as orchestration. For example, you could set up CLine to orchestrate a series of calls to the Gemini CLI, or have a custom script where Claude Code generates high-level logic and then calls a local model to flesh out the details.
This is a highly advanced, self-directed path that requires significant setup but offers a glimpse into the future of agentic software development.
Select a small, self-contained coding task from your own research that you can start from scratch (e.g., a data processing script, a utility function, a simple model).
⚠️ Warning: This is an experiment. Do not work on your main codebase. Create a new, separate folder and be sure to back up any important work beforehand.
An Echo State Network is a type of recurrent neural network with a wonderfully weird twist: most of its connections are fixed and random! You only train the final layer. This makes it incredibly fast to train and surprisingly powerful for time-series tasks.
The concept was detailed in this technical report: The "Echo State" Approach... by Herbert Jaeger.
Before you write any code, use a standard LLM to understand the paper. Ask it questions to get familiar with the concepts.
Pro Tip: Bridge Theory to Practice. After asking for an explanation, ask the LLM to generate *pseudo-code* for the core algorithm described in the paper. This is a great way to solidify your understanding before writing actual Python code.
"Explain the key components of an Echo State Network based on the attached paper."
"What is the 'reservoir' and why is it kept fixed?"
"Based on section 2.1 of the paper, generate a simplified pseudo-code implementation of the ESN's state update equation."
It's time to build. If you chose your own task, adapt these steps as needed. The following tasks are based on the ESN implementation.
Use your chosen AI agent to create a high-level plan for your project.
Pro Tip: For the best results, consider using a powerful reasoning LLM (like Gemini 2.5 Pro, GPT-4, or Claude 3) to generate your high-level plan first. You can then feed this detailed plan to your more specialized coding agent for implementation.
I want to implement a simple Echo State Network in Python using NumPy. Based on the ESN paper, generate a step-by-step plan. The plan should include creating a synthetic dataset, defining the ESN class, writing a training loop, and testing its performance.
Execute your plan step-by-step, using the agent to generate code for each part.
Pro Tip (Hierarchical Planning): Instead of writing a simple instruction for each task, try generating a detailed plan for the sub-task first. Then, use that plan as the prompt for your agent. For example, first ask a reasoning LLM to "generate a detailed plan for a Python function that creates a synthetic sine wave dataset." Then, give that detailed plan to your coding agent.
Write a Python function to generate a synthetic time-series dataset for training the ESN. The task should be to predict the next value in a sine wave.
Based on our plan, generate a Python class for the Echo State Network. It should have methods for initialization (__init__), running the reservoir (call it 'forward' or '__call__'), and a method for training the output layer (call it 'fit').
Write a Python script that uses the ESN class and the synthetic data. It should initialize the model, train it on the sine wave data, and then generate predictions. Plot the true values and the predicted values on a Matplotlib graph to see how well it learned.
Execute the script and see what happens. It's time to debug!
It's likely you'll encounter errors. When you do, use your agent to help.
Pro Tip: Effective Debugging. Don't just paste the error message. Provide the error, the code that caused it, and ask the AI to "think step-by-step to explain the cause of the error and then suggest a fix." This encourages a more thorough analysis.
I ran the test script and got this error: [paste full error traceback]. Here is the code for my ESN class and the test script. Explain what this error means and suggest a fix.
Once you have a working prototype, a great next step is to use the AI to improve it. This can involve making the code faster, cleaner, or better documented. Try one of the following improvements with your agent.
Pro Tip: Guide the Improvement. Be specific about your goals. Instead of asking to "make it better," provide clear constraints. For example: "Refactor this code to improve readability by separating the data logic from the model logic."
Here is the working code for my ESN prototype. Please help me improve it.
1. **Refactor for Modularity:** Can we refactor this into cleaner, more modular functions? For example, separating the data generation, model training, and plotting logic.
2. **Add Documentation:** Please add professional-level docstrings to the ESN class and all major functions, explaining what they do, their parameters, and what they return.
3. **Check for Inefficiencies:** Is there any way to make the training or prediction code more efficient or faster using NumPy vectorization?
1. Which coding agent environment did you choose, and why?
2. How did the experience of using an AI agent compare to your usual coding workflow? What was faster? What was slower?
3. Did the AI-generated plan help structure your work? Did you deviate from it?
4. Describe your experience with the debugging process. Was the AI helpful in identifying and fixing errors?
5. What was the biggest strength of your chosen AI agent? What was its biggest weakness?
6. How could you see yourself incorporating a tool like this into your day-to-day research and coding work?