The Autonomous Stack
Report Summarizer Pack icon

Report Summarizer Pack · Documents · v2.0

Summarize long reports into key points and risks

Résume un rapport long (médical, contrôle technique, DPE) en points clés, risques, recommandations et échéances. Turnkey BYO-LLM : install one-shot Debian, service systemd, tests offline.

$3.00one-timePay with crypto

Buy on Gumroad → https://6355137346884.gumroad.com/l/tas-report-summarizer-v1

summarization reports medical controle-technique dpe

agent ⟶ theautonomousstack.xyz

01GET /api/v1/pack/report-summarizer-v1

402 Payment RequiredPAYMENT-REQUIRED

02sign TransferWithAuthorization3.00 USDC · Base (eip155:8453)

03GET + PAYMENT-SIGNATURE

200 OKapplication/zip · 19 files

pay per pack over x402no account

What's inside

  • CHECKLIST.md
  • CUSTOMIZE.md
  • OPERATING_COST_ESTIMATE.md
  • PROMPTS.md
  • README.md
  • REPORT_TYPES.md
  • SOUL.md
  • SPEC.md
  • SUCCESS_METRICS.md
  • agent.py
  • deploy.sh
  • install.sh
  • llm_adapter.py
  • pack_memory.py
  • report-summarizer-v1.json
  • report-summarizer-v1.service
  • requirements.txt
  • smoke_test.sh
  • test_agent.py

Transformer un rapport long (médical, contrôle technique auto, DPE immobilier) en résumé structuré : points clés, risques, recommandations, échéances — en quelques secondes.

Table of contents

  1. What's in this pack
  2. Target audience
  3. Agent architecture
  4. Quick-start
  5. Runnable agent

What's in this pack

File Purpose
README.md This file. Overview, quick-start, runnable agent.
SOUL.md Mission, values, OODA loop, anti-patterns for the summarizer.
PROMPTS.md Production-ready system prompts, one per report type.
REPORT_TYPES.md Supported input formats (PDF/text) per report type.
SPEC.md Technical spec: inputs, outputs, schema, thresholds.
CHECKLIST.md Step-by-step deployment checklist.
report-summarizer-v1.json Machine-readable pack manifest.
agent.py Runnable agent: read a report, detect type, emit structured summary.
requirements.txt Pip dependencies actually used by agent.py.
deploy.sh Self-deploy: create venv + pip install -r requirements.txt.

Target audience

  • Cabinets médicaux & téléconsultation : digérer un compte-rendu d'examen en 30 secondes.
  • Centres de contrôle technique automobile : restituer au client les défauts par criticité.
  • Diagnostiqueurs immobiliers (DPE) : produire une synthèse client claire (classe, travaux).
  • Tout agent A2A qui reçoit un rapport brut et doit en extraire une décision actionnable.

Agent architecture

Rapport brut (texte / markdown / PDF→texte)
        │
        ▼
┌──────────────────┐
│ Détecteur de type│  → médical | controle_technique | dpe (heuristique mots-clés + override --type)
└────────┬─────────┘
         │
         ▼
┌──────────────────────┐
│ Sélecteur de prompt   │  → charge le prompt système adéquat (PROMPTS.md)
└────────┬─────────────┘
         │
         ▼
┌──────────────────┐
│ Résumeur (LLM)   │  → claude-sonnet-4-6, prompt caching ephemeral
└────────┬─────────┘
         │
         ▼
Résumé structuré :
  • points_cles[]      • risques[]
  • recommandations[]  • echeances[]
        │
        ▼
Émission Markdown OU JSON (--format)

Quick-start

  1. Copy all files to your agent workspace.
  2. bash deploy.sh to create the venv and install dependencies.
  3. export ANTHROPIC_API_KEY=sk-ant-... (sans clé : mode hors-ligne déterministe / stub).
  4. python agent.py --type dpe rapport.txt pour un résumé Markdown.
  5. Read SPEC.md to wire the JSON output into your A2A pipeline.

Runnable agent

python agent.py --help                       # affiche l'aide, ne crash jamais
python agent.py --type dpe rapport.txt       # résumé Markdown d'un DPE
python agent.py rapport_medical.txt          # auto-détection du type
python agent.py --type controle_technique --format json ct.txt
echo "Compte-rendu IRM ..." | python agent.py --type medical -   # lecture stdin

Sans ANTHROPIC_API_KEY, l'agent produit un résumé structuré déterministe (extraction heuristique) — utile pour les tests CI et python agent.py --help.

Use a local model (Ollama)

The optional LLM step can also run on your own machine through Ollama, so no text leaves your server. No account and no API key.

ollama pull <model>               # any chat model you like
export PACK_LLM=ollama            # prefer Ollama even if a coding-agent CLI is installed
export PACK_OLLAMA_MODEL=<model>  # optional: default is the first chat model the server lists
python3 -c "import llm_adapter; print(llm_adapter.detect())"   # prints: ollama
  • PACK_OLLAMA_HOST points to another server (default http://127.0.0.1:11434); OLLAMA_HOST is also read when PACK_LLM=ollama.
  • PACK_OLLAMA_NUM_CTX sets the context size if your reports or prompts are long.
  • Without PACK_LLM, a local Ollama server is used only when no Claude Code, Kimi Code or Codex CLI is found.
  • If the server is down or the model is missing, the pack keeps working in its deterministic mode.
  • With PACK_LLM=ollama (or PACK_LLM=off), the summarizer never falls back to a hosted API, even if ANTHROPIC_API_KEY is set.

Learning memory (local and private)

Every LLM call this pack makes is journaled in ./.pack_memory/ next to the code, so the pack can improve for you. Nothing is ever sent anywhere.

  • What is kept: the task name, the masked input, the masked answer, status and latency. Keys, tokens, e-mails, phone numbers, IP addresses, card and IBAN numbers and personal paths are masked before writing; the system prompt is never stored.
  • Teach it: python3 pack_memory.py feedback last ok confirms a result, python3 pack_memory.py feedback last bad --fix "the right answer" corrects it. Confirmed and corrected runs are reused as validated examples when a similar input comes in. Unrated runs are never injected into a prompt.
  • Find similar cases: python3 pack_memory.py similar "some text" and python3 pack_memory.py clusters (groups of near-identical failures) work in plain Python, no model needed. Optional meaning-based matching uses an embedding model you already run locally: python3 pack_memory.py enable-semantic (Ollama on this machine only).
  • Share, only if you want: python3 pack_memory.py export writes an anonymised summary (counts, statuses, size buckets, no text) for you to review.
  • Control: PACK_MEMORY=0 turns it off, PACK_MEMORY_STORE_TEXT=0 keeps fingerprints only, python3 pack_memory.py purge --yes wipes it.