Skip to main content

Reference implementation of the Agent Deliberation Protocol (ADP). Python/FastAPI runtime for agents that deliberate, sign proposals, journal outcomes, and publish signed calibration snapshots.

Project description

adp-agent

Python / FastAPI reference implementation of the Agent Deliberation Protocol. Sister project to the TypeScript @ai-manifests/adp-agent and the C# Adp.Agent runtimes — same wire format, same cross-language signing interop.

Install

pip install adp-agent

Packages are published to the Gitea PyPI feed. Configure pip once:

# pyproject.toml
[tool.pip]
extra-index-url = "https://git.marketally.com/api/packages/ai-manifests/pypi/simple"

Or with uv:

# pyproject.toml
[[tool.uv.index]]
name = "ai-manifests"
url = "https://git.marketally.com/api/packages/ai-manifests/pypi/simple"

Minimal use

from adp_agent import AgentConfig, AdpAgentHost, JournalBackend
from adp_manifest import StakeMagnitude, Vote


config = AgentConfig(
    agent_id="did:adp:my-agent-v1",
    port=3000,
    domain="my-agent.example.com",
    decision_classes=("code.correctness",),
    authorities={"code.correctness": 0.7},
    stake_magnitude=StakeMagnitude.MEDIUM,
    default_vote=Vote.APPROVE,
    default_confidence=0.65,
    dissent_conditions=("if any test marked critical regresses",),
    journal_dir="./journal",
)

host = AdpAgentHost(config)
await host.run()

The AdpAgentHost class serves:

  • GET /healthz
  • GET /.well-known/adp-manifest.json
  • GET /.well-known/adp-calibration.json (signed, ADJ §7.4)
  • POST /api/propose
  • POST /api/respond-falsification
  • POST /api/deliberate
  • POST /api/record-outcome
  • GET /adj/v0/calibration
  • GET /adj/v0/deliberation/{id}
  • GET /adj/v0/deliberations
  • GET /adj/v0/outcome/{id}
  • GET /adj/v0/entries
  • POST /api/budget

The adopter implements an Evaluator (the function that produces votes) and hands it to the host. See adp-agent-template-python for the full starter pattern.

With optional chain anchoring

from adp_agent_anchor import BlockchainStoreFactory, CalibrationAnchorScheduler

host = AdpAgentHost(config)

if config.calibration_anchor and config.calibration_anchor.enabled:
    store = BlockchainStoreFactory.create(config.calibration_anchor)
    if store:
        scheduler = CalibrationAnchorScheduler(config, host.journal, store)
        host.after_start(scheduler.start)
        host.before_stop(scheduler.stop)

await host.run()

Targets: mock, neo-express, neo-custom, neo-testnet, neo-mainnet. Same code, same smart contract, only the RPC URL, contract hash, and signing wallet differ.

Feature parity vs TypeScript @ai-manifests/adp-agent@0.3.0

See CHANGELOG.md for the full feature parity matrix. Short version: everything except distributed deliberation, MCP tool server, and the Neo3 RPC client itself ships in 0.1.0. Those three are v0.2.0 deliverables, stubbed with 501 responses / NotImplementedError so adopters get honest errors instead of silent failures.

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

adp_agent-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

adp_agent-0.1.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for adp_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1be5483fb5d3cf09586b7d8c6d5d13f68c39043a335fab3d4c1b08122da78e18
MD5 8e74175479488e8e4bc18984d42be51c
BLAKE2b-256 c79288f00ebe52f0de4a7aef6e7e9a0d9d40ff3669fea566ea7f2f88d14d704c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for adp_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f0b712f040a905b351f9a41bb206ef53738fb4c44a1fa16827e78faa5829f17
MD5 750b04c1d9766eefb33be2ac9702775c
BLAKE2b-256 8601262c5a3ae3ee83f14b698aeb0e26ce1751bb71b2acefbd8f8807c18b82ff

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