Skip to main content

Python reference implementation of the Agent Deliberation Journal (ADJ)

Project description

adj-manifest

A Python reference implementation of the Agent Deliberation Journal (ADJ) specification — the append-only journal format that records every step of a multi-agent deliberation: when it opened, what proposals were emitted, what falsifications happened, when it closed, and what outcome was eventually observed.

This library is one of several reference implementations (C#, TypeScript) of the same spec. The spec itself is at adp-manifest.dev and is the source of truth; this library implements what the spec says.

Zero runtime dependencies. Requires Python 3.10+.

Install

pip install adj-manifest

Or from source:

git clone https://git.marketally.com/ai-manifests/adj-ref-lib-py.git
cd adj-ref-lib-py
pip install -e .

Quick example

from datetime import datetime, timezone
from adj_manifest import (
    InMemoryJournalStore,
    DeliberationOpened,
    ActionDescriptor,
    DeliberationConfig,
    BrierScorer,
)

store = InMemoryJournalStore()

store.append(DeliberationOpened(
    entry_id="adj_01HMX",
    deliberation_id="dlb_42",
    timestamp=datetime.now(timezone.utc),
    prior_entry_hash=None,
    action=ActionDescriptor(kind="code.merge", tier="auto", blast_radius="team-scope"),
    config=DeliberationConfig(min_agents=3, timeout_seconds=300),
))

# ... append proposals, round events, deliberation close, outcome ...

score = BrierScorer.compute_calibration(scoring_pairs)
# score.value is the Brier-scored calibration score in [0, 1]

API

All public symbols are exported from the adj_manifest package root.

Entry types

JournalEntry, DeliberationOpened, ProposalEmitted, RoundEvent, DeliberationClosed, OutcomeObserved

Value types

ActionDescriptor, DeliberationConfig, TallyRecord, ProposalData, ConditionRecord, CalibrationScore, ScoringPair, ConditionQualityMetrics

Scorers

  • BrierScorercompute_calibration(pairs) returns a calibration score from (confidence, outcome) pairs. update(score, pair) folds a new observation into an existing score.
  • ConditionQualityScorercompute(entries) returns per-condition quality metrics (how often each dissent condition was falsified, how often it was load-bearing, etc.)

Store

  • InMemoryJournalStore — thread-safe in-memory journal store suitable for tests and prototypes. Implements the store contract from the spec.

Testing

pip install -e .[dev]
pytest

Spec

This library implements the Agent Deliberation Journal specification. Read the spec at adp-manifest.dev. If the spec and this library disagree, the spec is correct and this is a bug.

License

Apache-2.0 — see LICENSE for the full license text and NOTICE for attribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adj_manifest-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adj_manifest-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file adj_manifest-0.1.0.tar.gz.

File metadata

  • Download URL: adj_manifest-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for adj_manifest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 46acb5e011659e6d880e72375c16da9c3ffd354addeb7519c956f9e514c950ac
MD5 80acaf7f3791779e34deba0efc0db220
BLAKE2b-256 cf4f59a954fd58c0be8cde0f9ddfc3805331e81e5057253a211be193b9706c53

See more details on using hashes here.

File details

Details for the file adj_manifest-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: adj_manifest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for adj_manifest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b201dfbb9e50f53668e0154f5dd474f0e8f01d6e9b9de020e5d862bde28208a9
MD5 fb6329d381f4774ffaeeadfb71b6cec4
BLAKE2b-256 9042d70fde22ef8eaf87ecd32d41affec199fcbd0a225ee6f365477aea82eb5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page