Skip to main content

adp-agent

PyPI Downloads Python License Spec

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.

Metadata

Release files for adp-agent 0.7.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 adp-agent 0.7.0
File Size Uploaded
adp_agent-0.7.0.tar.gz 51.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adp-agent 0.7.0
File Interpreter ABI Platform
adp_agent-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 105.9 kB

Release files / adp_agent-0.7.0.tar.gz

Download URL adp_agent-0.7.0.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8048c81a22e1115f3da4168ed30c972d3152081e67c1f1f65388f4ae232dc8d7
BLAKE2b-256 checksum
How to use checksums
f9db0d73e377e10dbc6d69b5bd0b8ef0df27f5b14b2ba05508042c2ae5eb25b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release files / adp_agent-0.7.0-py3-none-any.whl

Download URL adp_agent-0.7.0-py3-none-any.whl
Size 54.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fc2727a8fc38540feb0f2b722b86d72a20b074a27a7d222d39a8c0765a13d75
BLAKE2b-256 checksum
How to use checksums
8052bbca3794260598154ec3cf8d2ebea0614c791b03cfefb7afcef4e898c7a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.1.0

2 release files

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