Find notice windows, expiring contracts, and missing owners before an unwanted renewal or service interruption. The pack reads a local JSON portfolio and produces a deterministic, auditable report; an optional connected coding-agent CLI can turn the findings into a concise operator brief.
Who it is for
Operations, procurement, finance, and platform teams that keep contract dates in a spreadsheet or export but do not have a reliable daily renewal watch.
Quick start
sudo bash install.sh --no-service
cp examples/contracts.json my_contracts.json
./venv/bin/python agent.py --portfolio my_contracts.json scan
./venv/bin/python agent.py --portfolio my_contracts.json report --out renewal_report.md
Each contract needs contract_id, vendor, end_date, notice_days, and an accountable owner. Missing fields are findings, never silently guessed.
local contracts.json
|
v
parse and validate --> calculate notice date --> classify risk --> Markdown / JSON report
|
+--> optional BYO-LLM brief
Honest operating modes
| Capability | Deterministic core | Optional BYO-LLM |
|---|---|---|
| Date arithmetic, notice windows, missing data | Yes | Not needed |
| JSON and Markdown reports | Yes | Not needed |
| Prioritized human-readable renewal brief | Template summary | Claude Code, Kimi Code, or Codex CLI |
No API key or network call is required. The optional CLI uses the subscription already connected on the machine. This agent identifies dates and ownership gaps; it never sends cancellation notices, accepts renewal terms, or changes a vendor account.
Commands
python agent.py --portfolio my_contracts.json --window-days 90 scan
python agent.py --portfolio my_contracts.json report --out renewal_report.md
python agent.py --portfolio my_contracts.json brief
python agent.py status
python test_agent.py
See CUSTOMIZE.md for your export connector and CHECKLIST.md for production use.
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_HOSTpoints to another server (defaulthttp://127.0.0.1:11434);OLLAMA_HOSTis also read whenPACK_LLM=ollama.PACK_OLLAMA_NUM_CTXsets 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.
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 okconfirms 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"andpython3 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 exportwrites an anonymised summary (counts, statuses, size buckets, no text) for you to review. - Control:
PACK_MEMORY=0turns it off,PACK_MEMORY_STORE_TEXT=0keeps fingerprints only,python3 pack_memory.py purge --yeswipes it.
