← Terug naar dashboard

Technische documentatie

Architectuur, bestanden, database, API, agent — alles op één plek
Inhoud
  1. Architectuur
  2. Bestanden
  3. Database
  4. API endpoints
  5. Agent werkwijze
  6. Dashboard pagina's
  7. CLI commando's
  8. Design systeem

1. Architectuur

Browser
nginx
443 / SSL
FastAPI
:8000
SQLite
itsm.db
Claude API
Sonnet 4
ComponentDetails
ServerVPS, Linux, user bprevaes
Pad/opt/agentic-demo/
Python venv/opt/agentic-demo/venv/
Database/opt/agentic-demo/data/itsm.db (SQLite)
SSLLet's Encrypt via Certbot, domein sdm.prevaes.nl
Nginx/etc/nginx/sites-enabled/sdm.prevaes.nl → proxy naar localhost:8000
Systemditsm-simulator.service — enabled, auto-restart
Env.env bevat ANTHROPIC_API_KEY

2. Bestanden

5085 regels verdeeld over 28 bestanden.

API (api/)

BestandRegelsFunctie
main.py481FastAPI app: alle endpoints, agent runner thread, ticket library runner
models.py275SQLAlchemy modellen (Customer, CMDB, Incident, Run, RunResult) + Pydantic schemas
database.py18SQLAlchemy engine + session factory
config_internal.py1ITSM_BASE_URL = "http://localhost:8000"

Agent (agent/)

BestandRegelsFunctie
runner.py171Agentic loop: ticket → Claude API → tool calls → update. Tracked tokens, tool calls, timing
tools.py1667 tool definities voor Claude function calling
tool_executor.py40Voert tool calls uit tegen de ITSM API via httpx
prompts.py74System prompt (Nederlands) + user message builder
config.py14Model: claude-sonnet-4-20250514, temp=0, max 10 rondes
run_all_new.py69CLI: verwerk alle nieuwe tickets, --name param
run_single.py68CLI: verwerk één ticket op ID, --name param
run_selection.py202CLI: selecteer uit ticket library met filters

Dashboard (dashboard/)

BestandRegelsFunctie
index.html162Hoofdpagina: topbar, ticketlijst + audit trail, overlays
app.js747Alle JS: polling, rendering, stats, formulier, sortering
style.css813Dark theme, alle componenten
admin.html447Beheerpagina: acties, library selectie, run historie
guide.html385Handleiding: 9 secties
docs.htmlDeze pagina

Seed (seed/)

BestandRegelsFunctie
data.json5654 klanten, 31 CI's, 10 incidents
ticket_library.json33430 scenario-tickets met tags, complexity, expected_outcome, demo_worthy
load_seed.py54Laadt data.json in DB. Behoudt runs bij reset.

3. Database

SQLite met 5 tabellen in /opt/agentic-demo/data/itsm.db

customers

KlantTierP1 SLABijzonderheden
Velder Logisticsplatinum15 minSAP-omgeving, 24/7 monitoring
Rijnmond Zorggold30 minNIS2, patiëntdata, weekend freeze (vr 17:00 – ma 08:00)
KantoorPlus BVsilver60 minKlein bedrijf, 40 werkplekken
Brouwers & Partnersgold30 minAdvocatenkantoor, GDPR, kantooruren freeze (ma-vr 08-18)

cmdb (31 CI's)

Velder Logistics (13 CI's)

SAP-FIN-01, SAP-HR-01, SAP-GATEWAY-01, SAP-BW-01, DC-FIREWALL-01 freeze, BACKUP-NAS-01, AD-DC-01, DNS-SRV-01, VPN-GW-01, SQL-DB-01, MONITOR-SRV-01, CITRIX-FARM-01, MONITORING-01

Rijnmond Zorg (8 CI's)

EXCH-MAIL-03 3 incidenten, EPD-APP-01, LAB-INTF-01, VDI-CLUSTER-01, CITRIX-GW-01, AD-DC-02, WEB-PROXY-01, WIFI-CTRL-01

KantoorPlus BV (5 CI's)

PRINT-SRV-02, FILE-SRV-01, NAS-FILE-01, ROUTER-WAN-01, LAPTOP-IMG-01

Brouwers & Partners (5 CI's)

DMS-LEGAL-01, EXCH-MAIL-05, SEC-SCAN-01, AD-DC-03, VPN-GW-02

runs

Kolommen: id, run_name, started_at, completed_at, total_tickets, model_used, temperature, system_prompt_hash

run_results

Kolommen: id, run_id (FK), incident_id, incident_title, status_before, status_after, priority_assigned, resolver_group, category_assigned, agent_reasoning, enrichment (JSON), questions_asked (JSON), tool_calls (JSON), tool_call_count, rounds, processing_time_ms, token_usage (JSON), created_at

token_usage formaat
{
  "total_input": 12500,
  "total_output": 3200,
  "per_round": [
    {"round": 1, "input": 8000, "output": 1500},
    {"round": 2, "input": 4500, "output": 1700}
  ]
}

4. API endpoints

Core

MethodeEndpointBeschrijving
GET/healthHealth check
POST/resetReset seed data (behoudt runs)
POST/runStart agent. Params: demo=true, ids=4,5, name=x
GET/agent/statusVoortgang: running, processed, total, run_id

Incidents

MethodeEndpointBeschrijving
GET/incidentsAlle incidents. Filter: ?status=new
GET/incidents/{id}Incident detail
POST/incidentsAanmaken (title, description, customer_id, ci_id)
PATCH/incidents/{id}Bijwerken

CMDB & Klanten

MethodeEndpointBeschrijving
GET/cmdbAlle CI's, optioneel ?search=SAP
GET/cmdb/{id}CI detail
GET/cmdb/{id}/historyCI incidenthistorie
GET/customersAlle klanten
GET/customers/{id}Klant detail met SLA's
GET/customers/{id}/freezesActieve freezes

Runs

MethodeEndpointBeschrijving
GET/runsAlle runs (nieuwste eerst)
GET/runs/{id}Run detail met alle results
GET/runs/{id}/compare/{other}Vergelijk twee runs per ticket
GET/runs/{id}/results/{incident_id}Eén result
POST/runsMaak run record
PATCH/runs/{id}Update completed_at / total_tickets
POST/runs/{id}/resultsVoeg result toe
POST/runs/clearWis alle runs

Ticket Library

MethodeEndpointBeschrijving
GET/libraryAlle 30 tickets uit ticket_library.json
POST/run/librarySelecteer + maak aan + verwerk. Params: demo_worthy, tags, complexity, ticket_ids, name

5. Agent werkwijze

Configuratie

Model: claude-sonnet-4-20250514
Temperature: 0 (deterministisch)
Max rondes: 10 per ticket
Max tokens: 4096 per response

7 tools

ToolWat het doet
get_incidentHaal incident details op
get_customerKlantinfo incl. SLA's en contract
get_customer_freezesActieve change freezes
get_ciCI details uit CMDB
search_cmdbZoek CI op naam (partial match)
get_ci_historyIncidenthistorie van een CI
update_incidentWerk ticket bij met alle verrijking

Agentic loop per ticket

  1. Lees het ticket (titel, beschrijving, klant, CI)
  2. Haal klantinfo op (SLA's, tier, freezes)
  3. Zoek het CI (direct op ID of via CMDB-zoekactie)
  4. Check CI-historie (patronen, recent major incident)
  5. Analyseer en neem beslissing
  6. Update het ticket met alles in één keer

Beslislogica

SituatieResultaat
Ticket onvolledig (< 2 zinnen, geen CI, essentiële info mist)triaged + terugvragen
Change freeze op CI + ticket betreft wijzigingescalated
3+ recente incidenten op CI (patroon)escalated
P1 (productie volledig down)escalated
Volledig ticket met voldoende infodispatched

Tracking

Per ticket wordt opgeslagen: verwerkingstijd (ms), aantal tool calls met input/output per call, token usage per ronde (input + output), totaal rondes. Beschikbaar in run_results en in incident.enrichment._agent_meta.

6. Dashboard pagina's

index.html — Hoofdpagina

admin.html — Beheer

guide.html — Handleiding

9 secties voor eindgebruikers: Wat is dit, Architectuur, Dashboard, Agent, Tickets, Runs, CLI, API, Demo tips.

7. CLI commando's

Alle commando's vanuit /opt/agentic-demo:

# Seed data resetten
venv/bin/python -m seed.load_seed

# Alle nieuwe tickets verwerken
venv/bin/python -m agent.run_all_new --name "naam"

# Eén ticket verwerken
venv/bin/python -m agent.run_single 4 --name "naam"

# Selectie uit bibliotheek
venv/bin/python -m agent.run_selection --demo-worthy --name "naam"
venv/bin/python -m agent.run_selection --tags gdpr,escalatie --name "naam"
venv/bin/python -m agent.run_selection --complexity hoog --name "naam"
venv/bin/python -m agent.run_selection --ids TL-004,TL-011 --name "naam"
venv/bin/python -m agent.run_selection --demo-worthy --dry-run

# Service beheer
sudo systemctl restart itsm-simulator
sudo systemctl status itsm-simulator
sudo journalctl -u itsm-simulator -f

8. Design systeem

Kleuren

VariabeleHexGebruik
--bg#0a1628Achtergrond
--panel#111d32Panelen, topbar
--card#1a2a45Kaarten, inputs
--cyan#00C7F9Accent, links, logo
--success#10b981Dispatched, groen
--danger#ef4444Escalated, P1
--warning#f59e0bTriaged, P2

Prioriteiten

P1 P2 P3 P4

Statussen

new triaged dispatched escalated resolved

Fonts

UI: Segoe UI / system. Mono: Cascadia Code / Fira Code / Consolas.