Metadata-Version: 2.4
Name: oliviadb-agent-framework
Version: 0.1.3
Summary: Microsoft Agent Framework history and memory providers backed by OliviaDB
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: oliviadb>=0.1.0
Requires-Dist: agent-framework-core<2,>=1.26

<!-- SPDX-License-Identifier: Apache-2.0 -->
# oliviadb-agent-framework

[Microsoft Agent Framework](https://github.com/microsoft/agent-framework) providers in
[OliviaDB](https://olivia-db.com/): session history (`OliviaDBHistoryProvider`) and long-term
memory recalled into the instructions before a run and remembered after it
(`OliviaDBMemoryProvider`). Tested with agent-framework-core 1.26.0.

## Install

```sh
pip install oliviadb-agent-framework
```

Python 3.10 or later.

## Example

A server from the core image (`docker run -d -p 8443:8443 -v oliviadb-data:/data
ghcr.io/oliviadb/oliviadb`), its API key in `OLIVIADB_API_KEY` and its certificate in
`oliviadb-ca.pem` (`docker cp <container>:/data/tls/server.pem oliviadb-ca.pem`):

```python
import os

from agent_framework import Agent
from oliviadb import OliviaDbClient
from oliviadb_agent_framework import OliviaDBHistoryProvider, OliviaDBMemoryProvider

client = OliviaDbClient("https://localhost:8443", api_key=os.environ["OLIVIADB_API_KEY"], ca_file="oliviadb-ca.pem")
chat_client = ...  # any Agent Framework chat client
agent = Agent(
    chat_client,
    "You are a helpdesk agent.",
    context_providers=[
        OliviaDBHistoryProvider(client, root=["helpdesk", "history"]),
        OliviaDBMemoryProvider(client, thread="helpdesk"),
    ],
)
```

## Links

* Documentation: <https://docs.olivia-db.com/>
* Repository: <https://github.com/OliviaDB/oliviadb-python> (`adapters/agent-framework`)

Licence: Apache-2.0.
