Skip to main content

Python reference implementation of the Agent Deliberation Journal (ADJ)

Project description

adj-manifest

PyPI Downloads Python License Spec

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://github.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-1.0.0.tar.gz (14.0 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-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for adj_manifest-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e0417dd28d2bf7e3b168776fc212f144a8c6d07596f0527d5bae064b7874b8b9
MD5 1effac9d89b3b9268ee0d2f81ecfa7df
BLAKE2b-256 6dd7a91e07b3f82d43c8cb249c901f4cc60db6227e521b741799297b2a244d8d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for adj_manifest-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4efba7db4d0c0920b73cce8d061ce88f015ec63e69d95a151617476aa1480ba0
MD5 fbab2373ccf58ba4da861727ad01128b
BLAKE2b-256 9f387c2c6505a86e763b6c80b174ae5d24a9cd8515dca2bdaec2ed5a8eacf85e

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