{"id":30302718,"url":"https://github.com/xreedev/sql-orchestrator-agent-gemini","last_synced_at":"2025-08-17T05:34:28.524Z","repository":{"id":306798243,"uuid":"1027252285","full_name":"xreedev/SQL-Orchestrator-Agent-Gemini","owner":"xreedev","description":"A minimal Python prototype that uses the Google Gemini API to generate, optimize, and run agentic pipelines that coordinate and run SQL queries and fetch data","archived":false,"fork":false,"pushed_at":"2025-07-27T16:42:09.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T18:43:30.246Z","etag":null,"topics":["agent","agent-based-model","agent-framework","gemini","llm","python","rag"],"latest_commit_sha":null,"homepage":"","language":"Python","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/xreedev.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}},"created_at":"2025-07-27T16:27:58.000Z","updated_at":"2025-07-27T16:42:13.000Z","dependencies_parsed_at":"2025-07-27T18:53:48.807Z","dependency_job_id":null,"html_url":"https://github.com/xreedev/SQL-Orchestrator-Agent-Gemini","commit_stats":null,"previous_names":["xreedev/sql-orchestrator-agent-gemini"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/xreedev/SQL-Orchestrator-Agent-Gemini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreedev%2FSQL-Orchestrator-Agent-Gemini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreedev%2FSQL-Orchestrator-Agent-Gemini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreedev%2FSQL-Orchestrator-Agent-Gemini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreedev%2FSQL-Orchestrator-Agent-Gemini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xreedev","download_url":"https://codeload.github.com/xreedev/SQL-Orchestrator-Agent-Gemini/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xreedev%2FSQL-Orchestrator-Agent-Gemini/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270811431,"owners_count":24650047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"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":["agent","agent-based-model","agent-framework","gemini","llm","python","rag"],"created_at":"2025-08-17T05:34:27.569Z","updated_at":"2025-08-17T05:34:28.512Z","avatar_url":"https://github.com/xreedev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Orchestrator Agent\n\nA Python orchestrator that directs user prompts to specialized agents—SQLAgent for database queries and GenericAgent for general questions—then formats and presents results via a FinalAgent.\n\n## Overview\n\n* **OrchestratorAgent**: Analyzes user input and decides which agent to invoke.\n* **SQLAgent**: Constructs SQL queries based on user questions and returns the query string.\n* **GenericAgent**: Handles general knowledge or reasoning questions.\n* **FinalAgent**: Merges raw results (from SQLAgent or GenericAgent) into a human-readable response.\n* **DataBase**: Wrapper around an SQLite database providing table creation and data retrieval.\n\n## Workflow\n\n1. **Read Input**: Continuously prompt the user until they signal to exit.\n2. **Route Prompt**: Use the OrchestratorAgent to determine if the request is a database query or a general question.\n3. **Execute and Retrieve**:\n\n   * If routed to SQLAgent, generate an SQL statement and fetch results from the DataBase.\n   * If routed to GenericAgent, compute the answer directly.\n4. **Finalize Response**: Pass the fetched data or computed answer to the FinalAgent to format a user-facing reply.\n\n## Components\n\n* **Agents**:\n\n  * `OrchestratorAgent`: Decision-maker for routing prompts.\n  * `SQLAgent`: SQL query generator with knowledge of your database schema.\n  * `GenericAgent`: Handles non-SQL tasks or open-ended queries.\n  * `FinalAgent`: Produces the final conversational response.\n\n* **Database Wrapper**:\n\n  * Automatically creates required tables (`subjects`, `teachers`, `marks`) on initialization.\n  * Offers methods for inserting sample data and retrieving query results.\n\n## Tech Stack\n\n* **Python 3.x**: Core language for agent orchestration and database interaction.\n* **SQLite**: Lightweight file-based database for storing `subjects`, `teachers`, and `marks`.\n* **GeminiAgent (via `gemini_agent`)**: Base class for all AI agents (Orchestrator, SQL, Generic, Final).\n* **SQLite3**: Python module for direct SQLite access.\n\n## Basic Setup\n\n* Ensure Python 3.x is installed and all dependencies are available.\n* Place the orchestrator, agent, and database wrapper modules in your project directory.\n* Initialize the `DataBase` with your database file (e.g., `school.db`).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreedev%2Fsql-orchestrator-agent-gemini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxreedev%2Fsql-orchestrator-agent-gemini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxreedev%2Fsql-orchestrator-agent-gemini/lists"}