Skip to main content

Structured multi-criteria decision intelligence for Python applications and LLM agents.

Project description

ADI — Agent Decision Intelligence

Rank options, quantify confidence, and explain the decision.

CI Release License Python

ADI is a Python library for structured multi-criteria decisions. Give it options, weighted criteria, constraints, and evidence confidence; it returns a ranked result with explainability, sensitivity analysis, and feedback-driven learning.

It is designed for two use cases:

  • application code that needs auditable decision logic
  • LLM agents that should call a deterministic ranking tool instead of improvising tradeoffs

Status: alpha. The core API is usable today, but expect refinement as real-world usage expands.

Why ADI

  • Deterministic ranking: scores and ranks options from explicit structured inputs.
  • Confidence-aware output: low-confidence evidence can reduce score impact or lower final confidence.
  • Explainable decisions: returns criterion contributions, constraint reports, and counterfactual guidance.
  • Scenario analysis: supports what-if runs and cross-scenario comparison.
  • Learning loop: feedback can update saved preference profiles for future runs.
  • Agent-ready: ships OpenAI and Anthropic tool schemas out of the box.

Install

From source:

git clone https://github.com/dimgouso/adi-Agent-Decision-Intelligence.git
cd adi-decision
pip install -e .

With development tooling:

pip install -e ".[dev]"

After PyPI publishing is enabled:

pip install adi-decision

Quick Start

from adi import DecisionRequest, decide
from adi.schemas.decision_request import Criterion, Option, OptionValue

request = DecisionRequest(
    options=[
        Option(
            name="Supplier A",
            values=[
                OptionValue(criterion_name="cost", value=100),
                OptionValue(criterion_name="quality", value=0.80, confidence=0.95),
            ],
        ),
        Option(
            name="Supplier B",
            values=[
                OptionValue(criterion_name="cost", value=85),
                OptionValue(criterion_name="quality", value=0.68, confidence=0.70),
            ],
        ),
    ],
    criteria=[
        Criterion(name="cost", weight=0.45, direction="cost"),
        Criterion(name="quality", weight=0.55, direction="benefit"),
    ],
    policy_name="balanced",
)

output = decide(request)

print(output.best_option)
for item in output.ranking:
    print(item.option_name, item.score, item.confidence)

LLM Agent Integration

from adi import call_adi_tool, get_openai_tools

tools = get_openai_tools()

# Pass `tools` to your OpenAI client.
# When the model calls `adi_decide`, route the arguments here:
result = call_adi_tool(tool_arguments)

CLI And API

CLI:

adi validate request.json
adi decide --input request.json
adi decide --input request.json --policy risk_averse

API:

uvicorn adi.interfaces.api:app --reload

Key endpoints:

  • GET /health
  • POST /decide
  • GET /policies
  • GET /policies/{policy_name}

Core Features

  • Policies: balanced, risk_averse, and exploratory
  • Constraints: hard elimination or soft penalties
  • Sensitivity: robustness checks under weight perturbation
  • Confidence handling: explicit per-value confidence or evidence-derived confidence
  • Feedback: accept, reject, or override actions update user profiles
  • Typed schemas: Pydantic models for request and response contracts

Development

Run the full local verification suite:

pip install -e ".[dev]"
ruff check adi/
pytest
python -m build
twine check dist/*

Release And Publishing

License

MIT

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

adi_decision-0.1.1.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

adi_decision-0.1.1-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file adi_decision-0.1.1.tar.gz.

File metadata

  • Download URL: adi_decision-0.1.1.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adi_decision-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6683491d6bbaa31e6c9af05fa18f17fcc9c9d3237aaac5e208362e2531848770
MD5 04525b0cf81c5e78716f83acbba8658e
BLAKE2b-256 9eb1c3dda87a6203b21f46022dbe13cde377314397256321b2a4050e7cd63801

See more details on using hashes here.

Provenance

The following attestation bundles were made for adi_decision-0.1.1.tar.gz:

Publisher: release.yml on dimgouso/adi-Agent-Decision-Intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adi_decision-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: adi_decision-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adi_decision-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5f6abe34e8fcd678b882908659991eb04c5c8bbef99a6b7f796094f641a1403
MD5 61e8e382bda23edfe9197c738637a96b
BLAKE2b-256 7d8e81ae378c788c26dafbe2227782ac51688483c69e31ad5fc91fa54fc7d432

See more details on using hashes here.

Provenance

The following attestation bundles were made for adi_decision-0.1.1-py3-none-any.whl:

Publisher: release.yml on dimgouso/adi-Agent-Decision-Intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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