Skip to main content

altruan-agenten

Schalter und Protokoll fuer die digitalen Mitarbeiter. Zwei Bausteine, die jede Persona braucht und die keine zweimal bauen sollte.

pip install altruan-agenten

Beide lesen genau eine Umgebungsvariable, MONGODB_URI_AGENTEN, und schreiben in die Datenbank agenten. Ausser pymongo haengt nichts dran.

schalter — eine Aufgabe an- und abschalten, ohne Deploy

Eine Konstante im Code umzulegen heisst: Codeaenderung, Review, Deploy. Fuer eine Testphase, die schrittweise geoeffnet werden soll, ist das der falsche Takt. Hier steht der Zustand in agenten.schalter, das Cockpit schreibt ihn, der naechste Lauf liest ihn.

from altruan_agenten import schalter

schalter.katalog_setzen(KATALOG)   # einmal beim Start

if not schalter.aktiv("BEN_MAIL_TRIAGE_AKTIV"):
    return

Der Katalog gehoert in die Anwendung, nicht in dieses Paket — er beschreibt ihre Aufgaben im Klartext. Ein Eintrag braucht mindestens _id, persona, aufgabe und art (ART_AUFGABE fuer einen eigenen Timer, ART_TEILSCHRITT fuer einen Schritt darin, den man einzeln abstellen koennen will); dazu gehoeren titel, takt, wirkung und aus_bedeutet, weil das Cockpit sie anzeigt.

Zwei Zusagen, an denen alles haengt:

  • Ein Deploy dreht keinen Schalter zurueck. Die Registrierung ueberschreibt bei jedem Kaltstart die Beschreibung, aber nie den Zustand.
  • Faellt Mongo aus, aendert sich nichts. Jeder Fehlerweg endet bei der gleichnamigen App Setting, nicht bei „aus". Eine laufende Persona haelt nicht an, eine abgeschaltete geht nicht scharf.

protokoll — Idempotenz und Trefferquote in einem Datensatz

from altruan_agenten import protokoll

neu = protokoll.vermerken(
    "sven", "delivery_date",
    {"system": "zendesk", "typ": "ticket", "id": str(ticket_id)},
    vorschlag={"antwort": text, "kategorie": kat},
    modell=MODELL, prompt_version="2026-09-05.1",
)
if not neu:
    return          # schon vermerkt — der Doppellauf kostet nichts weiter

Vor dem Schreiben ins Zielsystem aufrufen und bei False abbrechen. Der Schluessel ist <persona>|<aufgabe>|<quell-id> und damit deterministisch; ein zweiter Einfuegeversuch scheitert am Unique-Index.

Die Trefferquote faellt danach nebenbei ab: ein spaeterer Lauf ruft gegenprobe() mit dem frisch gelesenen Ist-Stand, das Paket setzt uebernommen oder korrigiert, und quote() rechnet sie je Auspraegung aus. promptVersion ist Pflichtfeld — ohne sie sind zwei Quoten nicht vergleichbar.

Veroeffentlichen

Version in setup.py hochzaehlen, auf master pushen. Der Workflow Upload to PyPi baut und laedt hoch. PyPI weist eine bereits vorhandene Version ab, das Hochzaehlen ist also Pflicht und nicht Geschmack.

Tests

python -m unittest discover -s tests

34 Tests, keiner braucht eine Datenbank — die Collection ist nachgebaut.

Metadata

Release files for altruan-agenten 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for altruan-agenten 0.1.0
File Size Uploaded Provenance Actions
altruan_agenten-0.1.0.tar.gz 14.7 kB With provenance Details for altruan_agenten-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for altruan-agenten 0.1.0
File Interpreter ABI Platform Actions
altruan_agenten-0.1.0-py3-none-any.whl Python 3 none any Details for altruan_agenten-0.1.0-py3-none-any.whl

Total release size: 25.7 kB

Release files / altruan_agenten-0.1.0.tar.gz

Download URL altruan_agenten-0.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32c8b52223efb1dfedbab3c02b091343909cf22262fac0688f5fddeb13cae06a
BLAKE2b-256 checksum
How to use checksums
da9abb64214052984968fed82c7edf43646c636e7443afc3c32e65c8ee6f5fc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release files / altruan_agenten-0.1.0-py3-none-any.whl

Download URL altruan_agenten-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74f53ecfcec5974286ebad32848ad208bf16f3f3735cf8bc1d94457e148ad414
BLAKE2b-256 checksum
How to use checksums
9f3ea5ad0e1bd6c8048823ae2cea955556cf2fb4275cbd273f20cc6bed72214e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Security for altruan-agenten 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for altruan_agenten-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page