{"id":32533236,"url":"https://github.com/gugrajah/building-database-agent","last_synced_at":"2026-05-01T23:39:46.724Z","repository":{"id":320565299,"uuid":"1082523516","full_name":"gugrajah/building-database-agent","owner":"gugrajah","description":"Building a database agent as part of a course from deeplearning.ai","archived":false,"fork":false,"pushed_at":"2025-11-10T15:12:42.000Z","size":956,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T23:39:38.037Z","etag":null,"topics":["agents","database"],"latest_commit_sha":null,"homepage":"https://deeplearning.ai","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gugrajah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T11:18:23.000Z","updated_at":"2025-11-10T15:12:46.000Z","dependencies_parsed_at":"2025-10-24T15:19:52.163Z","dependency_job_id":null,"html_url":"https://github.com/gugrajah/building-database-agent","commit_stats":null,"previous_names":["gugrajah/building-database-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gugrajah/building-database-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gugrajah%2Fbuilding-database-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gugrajah%2Fbuilding-database-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gugrajah%2Fbuilding-database-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gugrajah%2Fbuilding-database-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gugrajah","download_url":"https://codeload.github.com/gugrajah/building-database-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gugrajah%2Fbuilding-database-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32517232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","database"],"created_at":"2025-10-28T13:00:42.661Z","updated_at":"2026-05-01T23:39:46.711Z","avatar_url":"https://github.com/gugrajah.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building A Database Agent\n\nThe `building-database-agent` project explores techniques for interacting with and querying building-related data, including CSV files and SQL databases, using notebooks. The repository provides a step-by-step guide from basic data exploration in CSVs to connecting and querying a SQL database, and ultimately building an AI-powered natural language interface using Azure OpenAI's function calling capabilities.\n\n## Notebooks Overview\n\n### 1. 01 notebook.ipynb\n- **Goal:** Initial exploration of data analysis tools and their usage, likely focusing on basic Python data handling with libraries such as pandas.\n\n### 2. 02 csv_data_interact.ipynb\n- **Goal:** Demonstrates how to load CSV files, explore their structure, and interact with their contents.\n- **Key Activities:**\n  - Reading CSV building data into pandas DataFrames.\n  - Exploring the content, such as previewing rows and summarizing columns.\n  - Performing sample data manipulations.\n\n### 3. 03 Connecting to SQL Database.ipynb\n- **Goal:** Shows how to connect to a SQL database and perform queries on building-related data.\n- **Key Activities:**\n  - Setting up a connection to a SQL database (such as SQLite, PostgreSQL, etc.).\n  - Writing and executing SQL queries to extract, filter, and analyze data.\n  - Possibly translating exploratory tasks from the CSV notebook to SQL queries.\n\n### 4. 04 Azure OpenAI Function Calling Feature.ipynb\n- **Goal:** Demonstrates how to use Azure OpenAI's function calling capabilities to create an intelligent agent that can interact with databases using natural language queries.\n- **Key Activities:**\n  - **Setup:** Configuring Azure OpenAI client with proper credentials and API endpoints.\n  - **Illustrative Example:** Building a weather function calling system to demonstrate the basic concept of function calling with Azure OpenAI, including:\n    - Defining custom functions (e.g., `get_current_weather`)\n    - Creating tool definitions with proper JSON schemas\n    - Handling multiple function calls in a single conversation\n  - **SQL Database Integration:** Applying function calling to real database queries:\n    - Creating a SQLite database from COVID-19 tracking data (`all-states-history.csv`)\n    - Implementing database query functions (`get_hospitalized_increase_for_state_on_date`, `get_positive_cases_for_state_on_date`)\n    - Defining tools that allow the AI to intelligently query the database based on user questions\n    - Processing natural language queries like \"how many hospitalized people we had in Alaska on 2021-03-05?\" and automatically calling the appropriate database functions\n    - Handling function responses and generating human-readable answers from database results\n\n## Getting Started\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/gugrajah/building-database-agent.git\n   cd building-database-agent\n   ```\n\n2. **Install dependencies:**\n   ```\n   pip install -r requirements.txt\n   ```\n\n3. **Run the notebooks:**\n   Open the `.ipynb` files with Jupyter Notebook or a compatible environment to follow along with the data exploration and database interaction demonstrations.\n\n## Directory Structure\n\n- `01 notebook.ipynb` – Introduction to basic data exploration.\n- `02 csv_data_interact.ipynb` – Interacting with CSV data.\n- `03 Connecting to SQL Database.ipynb` – SQL database connectivity and querying.\n- `04 Azure OpenAI Function Calling Feature.ipynb` – AI-powered natural language database querying with Azure OpenAI.\n- `data/` – Example datasets.\n- `requirements.txt` – Python dependencies.\n\n## Requirements\n\nSee `requirements.txt` for all Python and notebook dependencies.\n\n---\n\nThis project is a practical demonstration of progressing from local CSV data work to leveraging SQL databases for richer, scalable querying—helpful for anyone working with structured building datasets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgugrajah%2Fbuilding-database-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgugrajah%2Fbuilding-database-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgugrajah%2Fbuilding-database-agent/lists"}