ADK Basics & Setting Up

In Python, every time you work on a project, you create a virtual environment so it isn’t messy.

Root Agent — the entry point of all requests.

Agent properties

  • Name — matches the folder name.
  • Model — which LLM to use.
  • Description — for other agents to know who to delegate to.
  • Instruction — for the agent to know what to do.
  • Tools — the capabilities the agent has.

Folder structure

agent_name/
├── __init__.py        # Needs to know what agent it has access to
├── .env               # Store all env variables; keep in the root agent
│                      # (don't need it in multi-agent sub-folders)
├── .env.example
└── agent.py           # Main code

The set-up process

  1. python -m venv .venv — put the virtual env in .venv
  2. source .venv/bin/activate
  3. pip install -r requirements.txt
  4. Create the GCP project (if not done already)
  5. Set up API keys (paste into the .env file)

ADK CLI commands

  • adk api_server — run as an API server
  • adk create — create an agent folder
  • adk deploy — deploy agent to the cloud
  • adk eval — run tests against the agent
  • adk run — run agents in your terminal
  • adk web — spin up a website to chat with the agent

See next