Skip to content

mpi-astronomy/ai-agents

Repository files navigation

AI Agents in VS Code (Astronomy) — Beginner Tutorial

A hands-on tutorial for astronomers who want to use AI agents inside VS Code for day-to-day research coding: exploring unfamiliar repos, iterating on analysis scripts, and extending agents with MCP servers.

This material assumes you’re using GitHub Copilot in VS Code (Copilot Chat + Agent mode), but most ideas transfer to similar “agentic” assistants.

Who this is for

  • Astronomy PhD students / postdocs writing Python (common: numpy, matplotlib, astropy)
  • Anyone who frequently:
    • inherits a repo from a collaborator
    • needs quick plots / tables for a paper or talk
    • wants a safe, reproducible way to “pair program” with an agent

What you’ll learn

  • Part 1: Start with tab autocompletion (inline suggestions)
  • Part 2: Use an agent to do tasks (edits, refactors, quick checks)
  • Part 3: Use an agent on large/unfamiliar repos (trace flow, find ownership)
  • Part 4: Advanced: a minimal MCP server (your own tools in chat)

Prerequisites

  • VS Code (recent version)
  • GitHub Copilot + Copilot Chat enabled
  • Comfort running Python scripts (terminal in VS Code is fine)

Installing Python Packages

  • We'll use pip+venv to install this environment.
python -m venv .venv

# bash/zsh
source .venv/bin/activate

# fish
# source .venv/bin/activate.fish

python -m pip install -r requirements.txt

Note you can clear your astropy cache after this with:

python -c "from astropy.utils.data import clear_download_cache; clear_download_cache()"

Parts

  1. 01-tab-autocomplete/README.md
  2. 02-agent-tasks/README.md
  3. 03-large-repos/README.md
  4. 04-mcp-server/README.md

Extras (optional)

Safety + research hygiene (read once)

  • Don’t paste unpublished results, credentials, or private data into chat.
    • If you have private code/data you want to use Agents on, come see DS Group.
  • Prefer asking the agent to edit files and run small checks over “trust me” changes.
  • Treat agent output like a fast, but junior, collaborator: useful, but needs review.

About

AI-Agents Tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published