Metadata-Version: 2.5
Name: decido
Version: 0.1.0
Summary: Typed provider-neutral decisions and bounded semantic web exploration
Project-URL: Repository, https://github.com/yairshy/decido
Project-URL: Issues, https://github.com/yairshy/decido/issues
Author: yairshy
License-Expression: MIT
License-File: LICENSE
Keywords: decisions,jev,mcp,probabilities
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.2; extra == 'mcp'
Requires-Dist: pydantic<3,>=2.11; extra == 'mcp'
Provides-Extra: playwright
Requires-Dist: markdownify<2,>=1.2; extra == 'playwright'
Requires-Dist: playwright<2,>=1.63; extra == 'playwright'
Provides-Extra: typesafe
Requires-Dist: typesafe-sdk<0.7,>=0.6.0; extra == 'typesafe'
Description-Content-Type: text/markdown

# Decido

Ask typed questions about evidence, keep every probability, and use the results in
ordinary Python. Start with Jev or supply your own decision provider.

Decido adds validated distributions, batching, request budgets, ranking, and
exportable decision records around a small provider contract. It also includes
optional web crawling and local MCP tools.

## Install

Python 3.11+:

```sh
pip install "decido[typesafe]"
export TYPESAFE_API_KEY="your-api-key"
```

Get a key from the [TypeSafe console](https://console.typesafe.ai).
Jev requests use your account and may incur charges.
[Environment setup](https://github.com/yairshy/decido/blob/main/docs/setup.md)

## Make a decision

```python
from decido import Choice, SyncSession
from decido.providers.typesafe import TypeSafeProvider

session = SyncSession(TypeSafeProvider()).start()
result = session.decide(
    state="Every API call fails after our signing-key rotation.",
    questions={
        "team": Choice(
            "Which team should handle this? Use unknown if the evidence is unclear.",
            ("billing", "technical", "unknown"),
            descriptions={
                "billing": "Charges, invoices, or subscriptions",
                "technical": "Broken software or integrations",
                "unknown": "The evidence does not establish a team",
            },
        ),
    },
)
answer = result.choice("team")
print(answer.choice)
print(dict(answer.distribution.probabilities))
session.close()
```

Add questions to the same call; the runtime batches them within the provider's
limits. Use `result.binary("id")`, `result.choice("id")`, or `result.ordinal("id")`
for typed answers. A context manager is also available for scripts.

Keep missing evidence separate from neutral evidence. “Margins were not reported”
is unknown; “margins were unchanged” supports a neutral answer. Model probabilities
are not automatically calibrated, and independent questions do not form a joint
distribution.

## Try it without a key

```sh
pip install decido
decido rank
```

This runs a bundled token-overlap example. The lexical provider exercises the API
without network access; its scores are heuristics, not semantic judgments.

## Use your own inputs

The CLI accepts JSON files or stdin:

```sh
decido decide --input request.json --provider typesafe
decido rank --input candidates.json --provider typesafe
```

[JSON format](https://github.com/yairshy/decido/blob/main/docs/json.md) ·
[Local MCP setup](https://github.com/yairshy/decido/blob/main/docs/mcp.md)

## Examples to edit

Clone the repository to run these scripts:

- [Support routing](https://github.com/yairshy/decido/blob/main/examples/route_support.py):
  classify a request and send uncertain cases to review.
- [Document ranking](https://github.com/yairshy/decido/blob/main/examples/rank_documents.py):
  select useful documents with independent relevance probabilities.
- [Evidence factors](https://github.com/yairshy/decido/blob/main/examples/extract_evidence.py):
  distinguish reported changes, unchanged conditions, and missing information.

[Run the examples](https://github.com/yairshy/decido/blob/main/examples/README.md) ·
[Crawl toward a goal](https://github.com/yairshy/decido/blob/main/docs/crawling.md) ·
[Evaluate six labeled examples](https://github.com/yairshy/decido/blob/main/docs/evaluation.md)

## Extend it

Implement the provider protocol, then pass your object to `SyncSession` or
`DecisionModel`. Browser backends are separate and optional.

[Custom provider example](https://github.com/yairshy/decido/blob/main/examples/custom_provider.py) ·
[Provider contract](https://github.com/yairshy/decido/blob/main/docs/providers.md) ·
[API usage and records](https://github.com/yairshy/decido/blob/main/docs/usage.md) ·
[Contributing](https://github.com/yairshy/decido/blob/main/CONTRIBUTING.md)

Alpha release under the [MIT license](https://github.com/yairshy/decido/blob/main/LICENSE).
The API may change before 1.0. Tests verify contracts and mechanics; no model-quality
or financial-performance advantage is claimed.
