Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

AI Ops Assistant

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.


Setup instructions to run locally on localhost

  1. Clone repository and enter folder
git clone <repo-url> ai_ops_assistant
cd ai_ops_assistant
  1. 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
  1. Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
  1. Create environment file
cp .env.example .env
# Edit .env and fill in API keys
  1. Run the project (single command)
uvicorn main:app --host 127.0.0.1 --port 8000
  1. 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 .

Environment variables required (.env.example)

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

Brief architecture explanation (agents and tools)

  • 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 raw blobs by default, coerces types (numbers, strings), normalizes GitHub items, validates the assembled final object against the planner’s output_schema using jsonschema, and returns the final structured answer. Optionally preserves raw when debug=true.
  • Tools
    • Encapsulated API wrappers (e.g., GitHubTool, WeatherTool) that the Executor calls. Tools return structured JSON that the Verifier sanitizes and assembles.

List of integrated APIs

  • 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_KEY and GEMINI_MODEL).

Example prompts to test the system

Use these as task values in POST requests to /task.

  1. Multi‑tool query
{"task":"Find the top 2 GitHub repositories for mlops and get the current weather in Indore"}
  1. Single tool query
{"task":"Search GitHub for the most starred Python data visualization libraries"}
  1. Weather only
{"task":"Get current weather for New York City and summarize temperature and humidity"}
  1. Combined research
{"task":"Find popular repositories about 'observability' and fetch weather for San Francisco"}
  1. Debug mode (include raw API responses)
{"task":"Find top 1 GitHub repo for kubernetes", "debug": true}

Known limitations and tradeoffs

  • Local dev server
    • The default setup uses a wrapped Flask app; uvicorn main:app is supported but the app is not a native async framework. For production, porting to FastAPI is recommended.
  • 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 .env or API keys. This project is intended for local demos; additional hardening is required for public deployment.

Running the Project

The project must run locally using one command. Example:

uvicorn main:app --host 127.0.0.1 --port 8000

After the server starts, POST tasks to http://127.0.0.1:8000/task and inspect plan, execution, and final in the JSON response.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages