# DONNA

> *"I'm Donna. I know everything."*
> *— and I know it before you ask.*

**The memory layer your legal-AI stack forgot.** With the proactive surface that makes Donna *Donna* (v0.1.1).

[![License: MIT](https://img.shields.io/badge/License-MIT-c9a96e.svg)](LICENSE)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Status: alpha](https://img.shields.io/badge/status-alpha-orange.svg)](#)
[![Built for: Suits enthusiasts](https://img.shields.io/badge/built%20for-suits%20enthusiasts-black.svg)](#)

DONNA is the open-source memory and anticipation layer that sits underneath your existing legal-AI stack. Harvey closes cases. Mike open-sources them. Legora makes them attractive. **Donna remembers what they all forgot.**

This is the v0.1.0 MVP: a Python package with a SQLite-backed relationship and preference store, lightweight rule-based entity extraction, and an in-character response wrapper. Local-first. Zero hard dependencies. MIT licensed. Bring-your-own-LLM in v0.2.

---

## Why does this exist?

Every legal-AI tool on the market in 2026 is *very good at reasoning over a single prompt*.

Almost none of them are good at **remembering across prompts, across counterparties, across months**.

The tooling you actually need to be a good lawyer — relationship memory, preference inference, tone-shift detection — is exactly the stuff missing from the demo videos.

That's the gap DONNA fills.

She is not a closer. She is the one who hands the closer the file before he knows he needs it.

---

## Install

```bash
# from source (until we publish to PyPI)
git clone https://github.com/ai-that-suits-you/donna
cd donna
pip install -e .

# once PyPI is live (target: v0.2)
pip install donna-legal
```

Python 3.9+ required. Zero hard dependencies — everything is stdlib for v0.1.

---

## Quickstart

```bash
# Initialise the file
donna init

# Load the bundled demo dataset
donna demo

# THE PROACTIVE SURFACE — Donna's signature move
donna observe "Carla at Cherry Bank wants Section 7.4. Looking forward."
# → Noted.
# → By the way:
# →   · Carla Cherry is already on file at Cherry Bank GmbH.
# →   · Section 7.4 comes up again — pattern #2 across 2 counterparties. Standardise?

donna notes
# → Three things worth your attention this morning:
# →   · Section 7.4 has now appeared with 4 different counterparties...
# →   · John Carter has been tense for 3 interactions in a row...
# →   · Maria Bianchi has been silent for 62 days...

# Reactive — when you do want to ask
donna ask "who is John Carter"
donna ask "search Section 7.2"
donna ask "why not just use Harvey?"
donna brief "John Carter"
```

Or in Python:

```python
from donna import MemoryStore, Donna, ingest_text

with MemoryStore("my-firm.db") as store:
    # Ingest text from anywhere — emails, notes, meeting summaries.
    ingest_text(
        "John Carter at Acme Holdings AG accepted the cap of CHF 5M on Section 7.2.",
        store=store,
        channel="email",
    )

    donna = Donna(store)
    print(donna.brief("John Carter"))
    print(donna.ask("search indemnification"))
```

---

## What DONNA actually does

| Donna in *Suits* | DONNA the product |
|---|---|
| Anticipates Harvey's next move | **Anticipatory drafting**: detects recurring patterns in your work and surfaces them ("you always add Section 7.4 for vendors > 50 FTE — adding") |
| Encyclopaedic memory | **Relationship store**: SQLite-backed graph of every counterparty, every clause negotiated, every concession made |
| Reads people without speaking | **Tone-shift detection**: tracks tone over time per counterparty, flags inflection points |
| The look | **Quiet recommendations**: never speaks unless asked, but the answer is ready |
| The file | **Full-text recall**: every email, every doc, every note, indexed and queryable in natural language |
| Discretion / *Anwaltsgeheimnis* | **Local-first by default**: SQLite on-disk, no telemetry, bring-your-own-LLM for any cloud reasoning |

---

## Architecture

```
┌────────────────────────────────────────────────────────┐
│                   Your existing stack                  │
│   Harvey · Legora · mike.oss · Spellbook · Lexis+      │
└────────────────────┬───────────────────────────────────┘
                     │  context injection (v0.4 roadmap)
┌────────────────────▼───────────────────────────────────┐
│                       DONNA                            │
│  ┌──────────┐  ┌──────────┐  ┌──────────────────────┐  │
│  │ ingest   │→ │ memory   │← │  personality (Donna) │  │
│  │ (rules)  │  │ (SQLite) │  │   say · ask · brief  │  │
│  └──────────┘  └──────────┘  └──────────────────────┘  │
└────────────────────────────────────────────────────────┘
                     │
                     │  local-first SQLite file on your disk
                     ▼
                ~/.donna/memory.db
```

### Modules

- **`donna.memory`** — `MemoryStore` (SQLite-backed, schema-versioned), domain objects (`Person`, `Interaction`, `Preference`, `Clause`)
- **`donna.ingest`** — `ingest_text()`, rule-based extraction of names, organisations, dates, money, clause references, tone (zero hard deps)
- **`donna.personality`** — `Donna` class: `greet()`, `ask()`, `brief()`, `say()` — wraps outputs in Donna's voice
- **`donna.cli`** — `donna` command-line entrypoint

### Storage schema

```
people         (id, name, organization, role, email, notes, first_seen, last_seen)
interactions   (id, person_id, timestamp, channel, summary, full_text, tone, source_ref)
preferences    (id, scope, key, value, evidence_count, last_updated)
clauses        (id, name, content, used_count, last_used, contexts)
```

Schema version is tracked in `PRAGMA user_version` for clean migrations.

---

## Roadmap

| Version | Scope |
|---|---|
| **v0.1** *(current)* | Core memory + rule-based ingest + personality + CLI + tests |
| v0.2 | LLM-backed extraction (Anthropic / OpenAI / local Ollama), embedding search |
| v0.3 | Adapters: Outlook, Gmail, iManage, NetDocuments, Skribble webhooks |
| v0.4 | "Thin client" injection into Harvey / Legora / mike.oss prompts via context-window middleware |
| v0.5 | Multi-user firm mode (auth, ACL, shared and private memory partitions) |
| v0.6 | Tone-shift detection model (replacing the v0.1 lexicon) |
| v1.0 | nDSG/GDPR compliance pack: DPIA template, transfer-impact assessment, audit-ready logs, optional QES integration via Skribble |

---

## Development

```bash
# install dev tooling
pip install -e ".[dev]"

# run tests
pytest

# lint
ruff check donna/

# type-check
mypy donna/
```

**46 tests in v0.1.1, all green.** CI runs on every PR — see `.github/workflows/ci.yml`.

Test breakdown:
- `test_memory.py` — 8 tests (SQLite store, schema, persistence)
- `test_ingest.py` — 11 tests (rule-based extraction)
- `test_personality.py` — 10 tests (Donna voice routing)
- `test_proactive.py` — 10 tests (the *observe* and *notes* surface — what makes her *her*)
- `test_adapter_skribble.py` — 7 tests (Swiss QES webhook adapter)

---

## Contributing

PRs welcome. Issues welcome. Suits memes welcome.

See [CONTRIBUTING.md](CONTRIBUTING.md) and our [Code of Conduct](CODE_OF_CONDUCT.md).

The project is operated pseudonymously by [AI That Suits You](https://ai-that-suits-you.com); a 3-person steering committee will be invited from the legal-tech and OSS community by v0.5. Press, partnership and right-of-reply: hello@ai-that-suits-you.com.

---

## Privacy & data protection

DONNA is local-first by construction:

- The memory store is a SQLite file on your own disk. By default at `~/.donna/memory.db`.
- No telemetry. No analytics. Donna does not phone home.
- LLM-backed features in v0.2 will be opt-in and bring-your-own-API-key.
- A formal nDSG / GDPR compliance pack ships with v1.0 — including a DPIA template, a transfer-impact assessment for each supported LLM provider, and audit-ready logs.

If you are deploying inside a Swiss law firm and want to talk about this seriously: **hello@ai-that-suits-you.com**.

---

## Licence

MIT — see [LICENSE](LICENSE).

The DONNA package is open source. The marketing site at [ai-that-suits-you.com](https://ai-that-suits-you.com) is a satirical commentary on the legal-AI industry; see the [parody disclaimer](../PARODY-DISCLAIMER.md) for the full notice.

---

## Credits

DONNA the character is the property of NBCUniversal and her writers. **DONNA the package is named in tribute, not in association.** Written for everyone in the legal industry who has ever needed someone to know what they meant before they finished saying it.

> *"I'm Donna. I know everything."*
