Skip to content

Repository files navigation

Weave

A local, self-hosted AI agent for DevOps/SREs. It debugs and diagnoses issues by investigating ArgoCD deployments and Grafana (Loki/OpenSearch) logs and correlating across them — powered by Claude (via AWS Bedrock or the Anthropic API).

Everything runs on your machine: the agent server binds to 127.0.0.1, and ArgoCD/Grafana tokens are held in memory only (never written to disk).

Layout

weave/
├── src/            # core library — integrations (ArgoCD, Grafana) + skills
├── server/         # the agent: Claude tool-use loop + local SSE chat UI
└── .github/        # CI build workflow
  • Core library (src/, package platform-agent) — API clients and the skills the agent calls as tools.
  • Server (server/, @platform-agent/server) — wraps Claude around those skills and serves a chat UI. See server/README.md for run instructions (fake mode, Bedrock key/SSO, Anthropic API).

Prerequisites

  • Node.js ≥ 18
  • AWS CLI (only for Bedrock SSO auth) with a configured profile
  • Network access to your ArgoCD and Grafana instances
  • One LLM credential: an AWS Bedrock SSO profile or a Bedrock/Anthropic API key

The first weave serve opens browser windows for the ArgoCD and Grafana SSO logins. Chromium is fetched automatically on install (a postinstall step); if that's skipped, run npx playwright install chromium once.

Run from source (dev)

npm install
npm run build:all
npm run test:all              # optional — 93 tests

# Fake mode — see the UI with no keys/network (canned bot):
cd server && npm run dev      # → http://localhost:8090

Build & install as a package

Weave installs as a single package with a weave command. Distribute it privately (no npm registry needed).

npm run build:all
npm pack                              # → platform-agent-0.1.0.tgz  (compiled dist only, no source)
npm i -g ./platform-agent-0.1.0.tgz   # installs the `weave` binary globally

Colleagues can install the same tarball, or install straight from git:

npm i -g git+ssh://git@github.com/<owner>/weave.git         # latest
npm i -g git+ssh://git@github.com/<owner>/weave.git#v0.1.0  # pinned tag

Initiate (run) the agent

The agent needs your ArgoCD + Grafana URLs plus one LLM credential. Set them as environment variables, then run weave serve (or npm run serve from source). Replace the <...> placeholders with your own values.

Example A — Bedrock via AWS SSO (no key stored)

# 1. Log into AWS IAM Identity Center for your profile:
aws sso login --profile <aws-profile>

# 2. Start the agent (SSO auto-refreshes short-lived creds; no key on disk):
BEDROCK_AUTH=sso \
LLM_AWS_PROFILE=<aws-profile> \
AWS_REGION=<aws-region> \
LLM_PROVIDER=bedrock \
ARGOCD_SERVER=<argocd-url> \
GRAFANA_SERVER=<grafana-url> \
weave serve

Example B — Bedrock via API key (bearer token)

AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-key> \
AWS_REGION=<aws-region> \
LLM_PROVIDER=bedrock \
ARGOCD_SERVER=<argocd-url> \
GRAFANA_SERVER=<grafana-url> \
weave serve

Example C — first-party Anthropic API key

ANTHROPIC_API_KEY=sk-ant-... \
LLM_PROVIDER=anthropic \
ARGOCD_SERVER=<argocd-url> \
GRAFANA_SERVER=<grafana-url> \
weave serve

On startup, weave serve prints Authenticating…, opens the ArgoCD and Grafana SSO login windows, then serves the chat UI at http://127.0.0.1:8090. Ask e.g. "is healthy in , and what errors is it logging in the last 12h?" Press Ctrl+C to stop (in-memory tokens are wiped).

Configuration reference

Variable Required Purpose
ARGOCD_SERVER yes ArgoCD instance URL
GRAFANA_SERVER yes Grafana instance URL
LLM_PROVIDER yes bedrock | anthropic (or auto)
BEDROCK_AUTH Bedrock SSO set to sso to use an AWS profile (default is key mode)
LLM_AWS_PROFILE Bedrock SSO AWS profile name (falls back to AWS_PROFILE)
AWS_REGION Bedrock AWS region, e.g. us-east-1
AWS_BEARER_TOKEN_BEDROCK Bedrock key Bedrock API key (bearer token)
ANTHROPIC_API_KEY Anthropic first-party Anthropic API key
LLM_MODEL no override model id (default claude-opus-4-8)
PORT no listen port (default 8090)

Auth notes

  • Tokens are in-memory only — ArgoCD/Grafana sessions are never written to disk and are gone when the server stops, so you re-login on each restart.
  • SSO expiry: Bedrock creds auto-refresh while the AWS SSO session is valid; when it expires, re-run aws sso login. If an ArgoCD/Grafana session expires mid-run, the agent offers a reauthenticate action that reopens the browser.

Upgrading

Bump the version, rebuild, repack; colleagues reinstall:

npm version patch        # 0.1.0 → 0.1.1
npm run build:all && npm pack
# recipients: npm i -g ./platform-agent-0.1.1.tgz   (or re-run the git install, optionally #v0.1.1)

Cross-session memory (~/.config/platform-agent/memory.json, 7-day TTL) and the cached Chromium survive upgrades; in-memory tokens do not (re-login).

CI

.github/workflows/build.yml runs typecheck → build → test → npm pack on push, PR, or manual dispatch, and uploads the packaged tarball (compiled dist/ only, no source) as an artifact.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages