This project integrates the Neon Management API in Python using Neon SDK with Azure AI Agent Service to create, manage, and interact with Neon projects, databases, branches, and more using AI-driven commands.
- Create and manage Neon projects, databases, branches, roles, and endpoints.
- Accept user commands from the console to trigger Neon API operations.
The following tools are supported through Neon API:
- Project Management
- Create, update, list, delete projects
- Branch Management
- Create, update, delete branches
- Set a branch as primary
- Database Management
- Create, update, delete databases
- Retrieve database details
- Endpoint Management
- Create, update, delete endpoints
- Start and suspend endpoints
- Role Management
- Create, delete roles
- Reveal and reset role passwords
- SQL Execution
- Run queries on Neon databases
- API Key Management
- Create, list, and delete API keys
- Operations Monitoring
- List and track project operations
- Consumption Metrics
- Retrieve usage and consumption data
Before running the project, ensure you have:
- Python 3.8+
- An Azure AI Agent setup
- A Neon API Key
-
Clone this repository:
git clone https://github.com/neondatabase-labs/neon-azure-ai-agent-demo.git cd neon-azure-ai-agent-demo
-
Create a new virtual environment:
python -m venv venv && source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables by creating a
.env
file:PROJECT_CONNECTION_STRING=your_azure_project_connection_string AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=your_deployment_name NEON_API_KEY=your_neon_api_key
Start the AI agent and interact with Neon API:
python ai-gent.py
After running the script, you can enter commands in the console:
- Create a project:
Create a project called My Neon Project
- List Projects:
List existing projects
neon-azure-ai/
│── ai-agent.py # Main AI Agent application entry point
│── neon_functions.py # Neon API interaction functions
│── .env # Environment variables (not committed)
│── requirements.txt # Required dependencies
│── README.md # Project documentation
Contributions are welcome! Feel free to submit a pull request with improvements.