Metadata-Version: 2.4
Name: voluntas
Version: 0.1.0
Summary: A BDI (Belief-Desire-Intention) agent framework built on Pydantic AI
Project-URL: Homepage, https://github.com/douglaschalegre/voluntas
Project-URL: Repository, https://github.com/douglaschalegre/voluntas
Project-URL: Issues, https://github.com/douglaschalegre/voluntas/issues
Author-email: Douglas Chalegre <douglas.chalegre@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Douglas Chalegre
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agents,bdi,llm,planning,pydantic-ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.14,>=3.10
Requires-Dist: pydantic-ai<1.42,>=1.41
Description-Content-Type: text/markdown

# Voluntas

Voluntas is a BDI (Belief-Desire-Intention) agent framework built on top of
[Pydantic AI](https://ai.pydantic.dev/). It provides structured beliefs,
desires, intentions, adaptive planning, execution, reconsideration, usage
tracking, and optional human-in-the-loop intervention.

## Installation

```bash
pip install voluntas
```

Or with uv:

```bash
uv add voluntas
```

The distribution name is `voluntas` and the Python import is also `voluntas`.

## Quick start

```python
import asyncio

from pydantic_ai.models.test import TestModel
from voluntas import BDI


async def main() -> None:
    agent = BDI(
        model=TestModel(),
        desires=["Prepare a concise project status report"],
        intentions=["Inspect the available project information"],
    )

    await agent.bdi_cycle()


asyncio.run(main())
```

For production use, replace `TestModel` with a model supported by Pydantic AI
and install any provider-specific dependencies required by that model.

## Public API

The main agent and commonly used schemas are available from the package root:

```python
from voluntas import (
    BDI,
    BDIUsageTracker,
    Belief,
    BeliefSet,
    Desire,
    DesireStatus,
    Intention,
    Plan,
)
```

The complete schema surface is available from `voluntas.schemas`:

```python
from voluntas.schemas import (
    BeliefExtractionResult,
    HighLevelIntentionList,
    PlanManipulationDirective,
    ReconsiderResult,
)
```

## BDI lifecycle

Each cycle coordinates the following stages:

1. Update beliefs from the current context and action outcomes.
2. Deliberate over pending desires and their priorities.
3. Generate a high-level intention when no active intention exists.
4. Execute one intention step using Pydantic AI tools and toolsets.
5. Reconsider the remaining plan after failed or changed work.

The framework supports MCP servers through the Pydantic AI integration passed
to `BDI`, as well as structured logs and aggregate usage tracking through
`BDIUsageTracker`.

## Human-in-the-loop

Set `enable_human_in_the_loop=True` to allow failures to be presented to a
human for guidance. The guidance is interpreted into structured actions such
as retrying, modifying, replacing, inserting, skipping, or aborting plan
steps.

## Development

Clone the repository and install development dependencies with uv:

```bash
uv sync --group dev
uv run pytest
```

The repository also contains SBench and benchmark runners for research and
experiments. The runners use a local LiteLLM proxy that exposes an
OpenAI-compatible API; they are development applications and are not part of
the published `voluntas` package.

Set the proxy connection before running the local examples:

```bash
export LITELLM_BASE_URL=http://localhost:4000
export LITELLM_API_KEY=sk-1234
export LITELLM_MODEL=gpt-5.3-codex
```

The value of `LITELLM_MODEL` must match a model alias configured in the proxy.

## License

Voluntas is released under the MIT license.
