# AI use cases for Agent Py (kkjiangk/agent-py)

Repo: [kkjiangk/agent-py](https://github.com/kkjiangk/agent-py) | Use cases: 4 | Page: https://dedupedai.com/use-cases/kkjiangk-agent-py/

Agent Py is a personal AIOps project that investigates alerts with tool-backed evidence, retrieves runbooks, and reviews remediation proposals.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run the local alert investigation stack in one command: https://dedupedai.com/use-cases/kkjiangk-agent-py/run-local-alert-investigation-stack/
- Check backend and frontend health before editing code: https://dedupedai.com/use-cases/kkjiangk-agent-py/verify-backend-and-frontend-before-changes/
- Run the synthetic incident evaluation against one API: https://dedupedai.com/use-cases/kkjiangk-agent-py/rerun-synthetic-incident-evaluation/
- Build a remediation executor that dedupes commandId: https://dedupedai.com/use-cases/kkjiangk-agent-py/build-idempotent-remediation-executor/

## How to run the local alert investigation stack in one command with Agent Py

Repo: [kkjiangk/agent-py](https://github.com/kkjiangk/agent-py) | Difficulty: Intermediate | Time: 1 hour 30 minutes | Basis: From the README

Start the API, worker, frontend, and Docker services to investigate alerts locally.

**Who it is for:** An engineer who wants to test alert diagnosis on their own machine before trusting it with real alert data.

**The problem:** Running the diagnosis pipeline needs Kafka, Redis, Milvus, the API, the event worker, and the frontend all started and wired to model and CLS settings.

**The outcome:** A running local workspace where you can open a chat or diagnosis session and watch progress stream in the browser.

### Steps

1. Run `npm ci` at the repository root.
2. Run `cp config/project.template.json config/project.json` and `cp config/user.project.template.json config/user.project.json`.
3. Edit both local JSON files to set the model API key, chat and embedding model names, and the required CLS fields.
4. Run `./scripts/start-local.sh`.
5. Open `http://127.0.0.1:5173` in a browser to use the workspace.

### Prompt to paste into your agent

```text
In the kkjiangk/agent-py repository, follow the local development steps in its README to start the stack with ./scripts/start-local.sh. Report which of the frontend, API, and Alertmanager addresses responded. Verify that http://127.0.0.1:8000/docs loads before you finish.
```

### Caveat

The workspace UI is in Chinese, and the setup needs a Qwen-compatible model service and, for CLS, Tencent credentials.

Risk, credentials: The local JSON config holds your model API key and CLS credentials, so keep config/project.json and config/user.project.json out of version control.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/kkjiangk-agent-py/run-local-alert-investigation-stack/

## How to check backend and frontend health before editing code with Agent Py

Repo: [kkjiangk/agent-py](https://github.com/kkjiangk/agent-py) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Run the full verification suite so changes to agents, APIs, or the UI can be checked.

**Who it is for:** A contributor about to change the FastAPI backend, the shared API contracts, or the Vue frontend.

**The problem:** Without a baseline, it is hard to tell whether a failure came from your edit or from the existing code.

**The outcome:** A recorded pass or fail result for each check, giving you a clean baseline before any change.

### Steps

1. Run `cd apps/backend` and then `uv sync --frozen`.
2. Run `uv run ruff check .`, `uv run pyright`, and `uv run pytest` inside apps/backend.
3. Return to the repository root and run `npm run contracts:typecheck` and `npm --workspace packages/api-contracts test`.
4. Run `npm run frontend:typecheck`, `npm run frontend:test`, and `npm run frontend:build`.
5. Run `python3 scripts/check_frontend_bundle.py` and `npm audit --audit-level=moderate`.

### Prompt to paste into your agent

```text
In the kkjiangk/agent-py repository, run the backend and frontend verification commands listed in the README Verification section. Report the pass or fail result of each command. Verify that the backend pytest run has no failures before you propose any edit.
```

### Caveat

The README's local results are dated 2026-10-04 and do not show that a GitHub-hosted CI run or an AWS deployment has completed.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/kkjiangk-agent-py/verify-backend-and-frontend-before-changes/

## How to run the synthetic incident evaluation against one API with Agent Py

Repo: [kkjiangk/agent-py](https://github.com/kkjiangk/agent-py) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Measure predictions and latency on versioned synthetic incident inputs.

**Who it is for:** A developer who wants to compare how the diagnosis agent behaves after a change, using a fixed set of scenarios.

**The problem:** Checking diagnosis quality by hand is slow and hard to repeat across code changes.

**The outcome:** A record of actual predictions and latency per scenario, tied to the API you selected.

### Steps

1. Read `evaluations/README.md` for the runner instructions and the required inputs.
2. Start a local API by following `./scripts/start-local.sh` or the manual steps in docs/getting-started.md.
3. Point the runner at the API address you selected, as described in evaluations/README.md.
4. Save the predictions and latency output from the run for comparison with later runs.

### Prompt to paste into your agent

```text
In the kkjiangk/agent-py repository, follow evaluations/README.md to run the synthetic incident evaluation against the API at <api address>. Report the predictions and latency for each scenario. Verify that the output lists every scenario in the versioned dataset.
```

### Caveat

The dataset is synthetic, and the runner does not measure model token cost, citation correctness, or MTTR unless you capture those separately.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/kkjiangk-agent-py/rerun-synthetic-incident-evaluation/

## How to build a remediation executor that dedupes commandId with Agent Py

Repo: [kkjiangk/agent-py](https://github.com/kkjiangk/agent-py) | Difficulty: Advanced | Time: 4 hours | Basis: From the README

Write the external consumer that applies remediation commands safely under at-least-once delivery.

**Who it is for:** A platform engineer who needs to connect approved remediation commands to a real system, since the repo does not include an executor.

**The problem:** Command delivery is at least once, so the same remediation command can arrive more than once and must not change a system twice.

**The outcome:** An executor that records each commandId before applying side effects and skips commands it has already handled.

### Steps

1. Read the remediation approval and dispatch sections of the README and docs/architecture.md to confirm the command shape.
2. Check config/project.template.json for the name of the Kafka topic that carries remediation commands. (inferred, check the README)
3. Subscribe your executor to that topic and read the stable commandId from each message.
4. Store each commandId in durable storage before you apply any side effect, and skip commands already recorded.
5. Replay one command twice in a staging environment and confirm the side effect happens once.

### Prompt to paste into your agent

```text
In the kkjiangk/agent-py repository, read the remediation approval and dispatch documentation and draft an executor that deduplicates messages by commandId before applying side effects. Report the topic name and the storage you chose. Verify with a staging replay that a duplicate commandId causes no second side effect.
```

### Caveat

The repo does not include a production remediation executor, so any executor you write changes real systems and should be tested in staging first.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/kkjiangk-agent-py/build-idempotent-remediation-executor/
