Exercise - Build an agent tool backend on Azure Database for PostgreSQL

Completed

In this exercise, you create an Azure Database for PostgreSQL instance that serves as a tool backend for an AI agent. The database stores conversation context and task state that an agent can read and write during operation. You design a schema for agent memory, build Python functions that serve as agent tools, and test the complete workflow. This pattern provides a foundation for building AI agents that maintain persistent memory across sessions and can resume interrupted tasks.

Tasks performed in this exercise:

  • Download project starter files and configure the deployment script
  • Deploy an Azure Database for PostgreSQL Flexible Server with Microsoft Entra authentication
  • Build Python tool functions for conversation and task state management
  • Create a database schema for agent memory with tables for conversations, messages, and task checkpoints
  • Test the agent memory workflow using a provided test script
  • Query conversation context using SQL

This exercise takes approximately 30 minutes to complete.

Before you start

To complete the exercise, you need:

Get started

Select the Launch Exercise button to open the exercise instructions in a new browser window. When you're finished with the exercise, return here to:

  • Complete the module
  • Earn a badge for completing this module

Button to launch exercise.