From Zero to Code: Prototyping with AI Agents

An exercise in building a new codebase from scratch using a modern AI coding agent as your partner.

Part 1: Introduction & Setup

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.

Choose Your Environment

A) The IDE Copilot

An AI assistant deeply integrated into a familiar IDE (like VS Code). Best for complex file management and a traditional development feel.

Setup (Gemini Code Assist):

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.

Other Options:

B) The Interactive Notebook

An AI integrated directly into a notebook environment. Excellent for data-heavy tasks, rapid prototyping, and visualization.

Setup (Gemini in Colab):

Open a new Google Colab notebook. You should see Gemini features integrated, including a "Generate" button in cells to help write code.

Other Options:

C) The Command-Line Agent

A fully conversational agent that generates and modifies code based on high-level commands. This is the most "agentic" approach.

Setup (Gemini CLI):

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.

Other Options:
  • Claude (Paid)
  • CLine (Paid, or free with local LLMs)
  • Aider (Open-source, requires setup)
  • Devin by Cognition (Limited access)

For Advanced Users

D) The Advanced Challenge: Agent Orchestration

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.

Part 2: Choosing Your Mission

Option 1: Your Own Research Project

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.

Option 2: The Suggested Task - An Echo State Network (ESN)

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.

First Step: Understand the Paper

Before you write any code, use a standard LLM to understand the paper. Ask it questions to get familiar with the concepts.

Example Prompts
"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."

Part 3: The Coding Sprint

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.

Task 1: The Blueprint - Generate an Implementation Plan

Use your chosen AI agent to create a high-level plan for your project.

Example Prompt
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.

Task 2: The Building Blocks - Code Generation

Execute your plan step-by-step, using the agent to generate code for each part.

A) Generate Synthetic Data:

Example Prompt
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.

B) Implement the Model:

Example Prompt
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').

Task 3: Quality Control - Testing

A) Write Test Scripts:

Example Prompt
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.

B) Run the Tests:

Execute the script and see what happens. It's time to debug!

Task 4: The Bug Hunt - Debugging with AI

It's likely you'll encounter errors. When you do, use your agent to help.

Example Prompt
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.

Task 5: Code Improvement (Optional)

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.

Example Prompt
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?

Part 4: Reflection

Final Analysis Questions

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?