Agentic AI in Software Engineering | Module 4 Instructor: Prof. Apparsamy Perumal | Semester 5
CodePilot AI Studio builds a real AI coding assistant stage by stage in Google Colab.
Zero installation. No admin rights. Works on any browser with a free Groq API key.
| Stage | Concept | Session |
|---|---|---|
| Stage 1 | Hello Groq — talk to Llama 3 via API | ✅ In Class |
| Stage 2 | Memory — agent remembers your conversation | ✅ In Class |
| Stage 3 | Tools — intent routing to specialist skills | ✅ In Class |
| Stage 4 | RAG — long-term memory with ChromaDB | 📚 Homework |
| Stage 5 | Reflection — agent improves its own output | 📚 Homework |
| Stage 6 | LangGraph — stateful graph workflow | 📚 Homework |
You need a free Groq API key. Do this before class day.
- Go to: https://console.groq.com
- Click Sign Up (top right)
- Sign up with your Google account or email — no credit card needed
- After logging in, click "API Keys" in the left sidebar
- Click "Create API Key"
- Name it anything (e.g.
codepilot) - Click Submit
- Copy the key immediately — looks like:
gsk_xxxxxxxxxxxxxxxxxxxx - Save it in Notepad or your phone Notes
⚠️ The key is shown only ONCE. If you lose it, just create a new one — takes 30 seconds.
💡 Colab Secrets stores your key ONCE and all 6 notebooks find it automatically.
- Go to https://colab.research.google.com
- Open any notebook
- Click the 🔑 key icon in the left sidebar
- Click "Add new secret"
- Name:
GROQ_API_KEY← must be exactly this - Value: paste your key
gsk_xxxx... - Toggle "Notebook access" to ON
- Done! Every notebook will now find your key automatically
Each student must use their own key — never share keys.
- Go to this repository on GitHub
- Click on any
.ipynbfile (e.g.stage1_hello_groq/Stage1_Hello_Groq.ipynb) - Click the orange "Open in Colab" badge at the top of the file
- The notebook opens directly in Google Colab
- Cell 1 (API Key): Run it — if you set up Colab Secrets, it loads automatically. If not, paste your key manually between the quotes.
- Cell 2 (Setup): Run it — installs packages (~30 seconds first time)
- Press Ctrl+F9 to run all remaining cells at once
- Read the output below each cell
- Try the experiments at the bottom
⏱ First run: ~1 minute (package install). All runs after that: instant.
| Step | What to do |
|---|---|
| 1 | Click the 🔑 key icon in the Colab left sidebar |
| 2 | Click "Add new secret" |
| 3 | Name: GROQ_API_KEY |
| 4 | Value: paste your gsk_xxxx... key |
| 5 | Toggle "Notebook access" ON |
| Done! | All 6 notebooks load your key automatically |
If Secrets is not set up, find this line in Cell 1:
GROQ_API_KEY = "paste-your-groq-key-here"Replace paste-your-groq-key-here with your actual key. Works immediately.
codepilot-colab/
│
├── README.md ← this file (start here)
│
├── stage1_hello_groq/
│ ├── Stage1_Hello_Groq.ipynb ← Colab notebook (click Open in Colab)
│ └── Stage1_README.md ← detailed concept guide
│
├── stage2_memory_agent/
│ ├── Stage2_Memory_Agent.ipynb
│ └── Stage2_README.md
│
├── stage3_tool_agent/
│ ├── Stage3_Tool_Agent.ipynb
│ └── Stage3_README.md
│
├── stage4_rag_explain/
│ ├── Stage4_RAG_Explain.ipynb
│ └── Stage4_README.md
│
├── stage5_reflection/
│ ├── Stage5_Reflection.ipynb
│ └── Stage5_README.md
│
└── stage6_langgraph/
├── Stage6_LangGraph.ipynb
└── Stage6_README.md
| Tool | Purpose |
|---|---|
| Google Colab | Browser-based Python — no install needed |
| Groq API | Fast LLM cloud service (free tier) |
| Llama 3.1 8B | Open-source AI model by Meta |
| LangChain | Python AI agent framework |
| ChromaDB | Vector database for RAG (Stage 4) |
| HuggingFace Embeddings | Text-to-vector conversion (Stage 4) |
| LangGraph | Graph-based workflow (Stage 6) |
Your GROQ_API_KEY is wrong or Secrets not set up. Go to https://console.groq.com → create a fresh key → add to Secrets OR paste manually.
Click the 🔑 icon → find GROQ_API_KEY → toggle Notebook access to ON → re-run Cell 1.
Run Cell 2 (the pip install cell) again. Sometimes Colab resets between sessions.
Colab sessions expire after ~12 hours. Re-open the notebook and run from Cell 1. Your Groq key in Secrets is still there — no need to add it again.
Go to https://console.groq.com → API Keys → Create a new one → update Secrets value.
By Stage 6 you will have built a complete AI coding assistant that can:
- Talk to a fast cloud LLM (Groq + Llama 3.1)
- Remember your full conversation across multiple turns
- Detect what you want (debug / explain / review) automatically
- Retrieve relevant knowledge before answering (RAG)
- Critique and improve its own output (reflection)
- Execute a stateful workflow with loops and branching (LangGraph)
Built for Agentic AI Software Development — Module 4 Department of Computer Science & Engineering | Semester 5 Prof. Apparsamy Perumal
Tech: Groq · LangChain · LangGraph · ChromaDB · HuggingFace