Local multi‑agent AI Operations Assistant that accepts a natural‑language task, plans steps (Planner), executes tools and APIs (Executor), and validates and assembles the final structured answer (Verifier). Designed to run locally and be started with a single command.
- Clone repository and enter folder
git clone <repo-url> ai_ops_assistant
cd ai_ops_assistant- Create and activate virtual environment
python -m venv .venv
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
# Windows Git Bash
source .venv/Scripts/activate
# macOS / Linux
source .venv/bin/activate- Install dependencies
pip install --upgrade pip
pip install -r requirements.txt- Create environment file
cp .env.example .env
# Edit .env and fill in API keys- Run the project (single command)
uvicorn main:app --host 127.0.0.1 --port 8000- Test endpoint
curl -X POST http://127.0.0.1:8000/task \
-H "Content-Type: application/json" \
-d '{"task":"Your natural language task here"}' | jq .Copy this file to .env and fill values.
# GitHub API token (personal access token)
GITHUB_TOKEN=ghp_xxx_replace_with_yours
# OpenWeatherMap API key
OPENWEATHER_API_KEY=your_openweather_api_key
# Optional LLM credentials (if using an external LLM)
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-3-flash
# Optional runtime flags
# USE_UVICORN_ASGI=1
- Planner
- Uses an LLM prompt constrained to a JSON schema to convert the user’s natural‑language task into a step‑by‑step plan. The plan lists ordered steps and the tool names required for each step. A deterministic fallback plan is used if the LLM is unavailable.
- Executor
- Maps plan steps to concrete tool functions, calls external APIs, handles retries, and returns per‑step results. Includes short in‑memory caching to avoid duplicate calls.
- Verifier
- Sanitizes and normalizes tool outputs, removes large
rawblobs by default, coerces types (numbers, strings), normalizes GitHub items, validates the assembled final object against the planner’soutput_schemausingjsonschema, and returns the final structured answer. Optionally preservesrawwhendebug=true.
- Sanitizes and normalizes tool outputs, removes large
- Tools
- Encapsulated API wrappers (e.g.,
GitHubTool,WeatherTool) that the Executor calls. Tools return structured JSON that the Verifier sanitizes and assembles.
- Encapsulated API wrappers (e.g.,
- GitHub — repository search and metadata (name, url, stars, description). Requires
GITHUB_TOKEN. - OpenWeather — current weather by city (temperature, humidity, condition). Requires
OPENWEATHER_API_KEY. - Optional LLM provider — Gemini or other LLM for Planner prompts (configured via
GEMINI_API_KEYandGEMINI_MODEL).
Use these as task values in POST requests to /task.
- Multi‑tool query
{"task":"Find the top 2 GitHub repositories for mlops and get the current weather in Indore"}- Single tool query
{"task":"Search GitHub for the most starred Python data visualization libraries"}- Weather only
{"task":"Get current weather for New York City and summarize temperature and humidity"}- Combined research
{"task":"Find popular repositories about 'observability' and fetch weather for San Francisco"}- Debug mode (include raw API responses)
{"task":"Find top 1 GitHub repo for kubernetes", "debug": true}- Local dev server
- The default setup uses a wrapped Flask app;
uvicorn main:appis supported but the app is not a native async framework. For production, porting to FastAPI is recommended.
- The default setup uses a wrapped Flask app;
- LLM dependency
- Planner relies on an external LLM for best results. A deterministic fallback exists but is less flexible and may produce simpler plans.
- API rate limits and keys
- GitHub and OpenWeather rate limits apply. Ensure valid API keys and monitor usage.
- Partial results and retries
- Executor retries on transient failures but may return partial results if an API consistently fails. Verifier will surface validation errors and partial assemblies.
- No persistent caching
- Current caching is in‑memory and ephemeral. For repeated workloads, add Redis or disk caching.
- Security
- Do not commit
.envor API keys. This project is intended for local demos; additional hardening is required for public deployment.
- Do not commit
The project must run locally using one command. Example:
uvicorn main:app --host 127.0.0.1 --port 8000After the server starts, POST tasks to http://127.0.0.1:8000/task and inspect plan, execution, and final in the JSON response.