Metadata-Version: 2.4
Name: daita-agents
Version: 1.1.2
Summary: A persistent data agent for grounded analysis and controlled automation across databases, files, and connected tools
Author-email: Daita <support@daita-tech.io>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai<3.0.0,>=2.45.0
Requires-Dist: anthropic<1.0.0,>=0.116.0
Requires-Dist: google-genai<3.0.0,>=2.22.0
Requires-Dist: asyncpg<1.0.0,>=0.30.0
Requires-Dist: sqlglot<30.15.0,>=30.14.0
Requires-Dist: keyring<26.0.0,>=25.0.0
Requires-Dist: rich<16.0.0,>=15.0.0
Requires-Dist: textual<9.0.0,>=8.2.8
Requires-Dist: XlsxWriter<4.0.0,>=3.2.5
Requires-Dist: httpx<1.0.0,>=0.28.1
Requires-Dist: duckdb==1.5.5
Provides-Extra: dev
Requires-Dist: black>=26.1.0; extra == "dev"
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: mypy>=1.15.0; extra == "dev"
Requires-Dist: openpyxl<4.0.0,>=3.1.0; extra == "dev"
Requires-Dist: pre-commit<5.0.0,>=4.0.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.26.0; extra == "dev"
Requires-Dist: python-dotenv<2.0.0,>=1.2.2; extra == "dev"
Requires-Dist: ruff<0.17.0,>=0.16.2; extra == "dev"
Requires-Dist: setuptools==82.0.1; extra == "dev"
Requires-Dist: twine<8.0.0,>=7.0.0; extra == "dev"
Requires-Dist: types-openpyxl<4.0.0,>=3.1.0; extra == "dev"
Requires-Dist: wheel==0.47.0; extra == "dev"
Dynamic: license-file

![Daita: persistent data agents](assets/banner.png)

# Daita

The data agent that learns how your business works.

Daita connects to SQLite and PostgreSQL and can work with permitted local computer files, then
returns grounded answers to questions asked in plain language. Conversations,
approved memory, and reusable skills persist across sessions so useful business
context does not have to be explained again.

[Quick start](#quick-start) ·
[Artifacts](docs/ARTIFACTS.md) ·
[Local computer files](docs/LOCAL_WORKSPACES.md) ·
[Model sources](docs/SUBSCRIPTION_MODEL_SOURCES.md) ·
[Remote MCP](docs/MCP_CONNECTIVITY.md) ·
[Scheduled routines](docs/SCHEDULED_ROUTINES.md) ·
[Action receipts and recovery](docs/EFFECT_RECEIPTS.md) ·
[Examples](examples/README.md)

```text
You:   Which region led paid revenue last quarter?
Daita: EMEA led with $4.2M, followed by North America with $3.7M.
```

## Why Daita?

| | |
| --- | --- |
| **Talk to real data** | Query SQLite and PostgreSQL, or analyze admitted CSV, TSV, JSON, NDJSON, and Parquet files without writing SQL. |
| **Get grounded answers** | Daita validates queries against the current catalog before reading a source. |
| **Choose your model** | Use OpenAI, Anthropic, Gemini, Grok, Ollama, an OpenAI-compatible endpoint, or supported model subscriptions. |
| **Keep useful context** | Persist conversations, user-approved memory, and reusable Markdown skills. |
| **Stay in control** | Sources begin read-only, access is explicitly scoped, and operational effects require exact approval. |

## Quick start

You need Python 3.11 or 3.12 and
[pipx](https://pipx.pypa.io/stable/installation/).

```bash
pipx install daita-agents
daita
```

If pipx would otherwise select a newer unsupported interpreter, choose an
installed Python 3.11 or 3.12 explicitly:

```bash
pipx install --python python3.12 daita-agents
```

The first launch guides you through creating an agent, selecting a model, and
optionally attaching a read-only data source. The launch directory is the default
working directory, while foreground Files tools can also use host-resolved
Downloads, Documents, Desktop, and other explicit local paths. API-backed
model credentials are stored in the OS keychain. Ollama needs no API key, and
supported Codex, Claude Code, and Grok Build subscriptions can use their
documented sign-in flows. See
[Subscription model sources](docs/SUBSCRIPTION_MODEL_SOURCES.md) for setup and
security boundaries.

Once setup is complete, try asking:

```text
Which products grew fastest month over month?
How many customers have not ordered in 90 days?
Compare paid revenue by region and plan.
Find the latest CSV in Downloads and compare it with the CSV in Documents.
```

Run `daita` again for a returning launch. Daita reopens the only agent or shows
a picker when several exist. Use `daita --agent atlas` to select one directly.
Inside the terminal, `/help` lists commands and controls, `/` opens the command
palette, and `@` narrows one question to a source. Ordinary questions can discover
and compare all admitted connections without a selection. `/routines` shows saved
assignments and occurrence evidence, and `/inbox` shows results. In `/sources`,
choose Permissions for exact PostgreSQL update/upsert authoring. The same screen
provides a read-only tree graph: choose a resource, follow its catalog relationships
to neighboring resources, and inspect relationship direction, provenance,
confidence, and fields. The graph presents catalog evidence only; it does not grant
access or execution authority.

Saved assignments execute while the TUI or `daita host --agent atlas` keeps the
agent open. Exit the current host before opening another; no work progresses
while all hosts are closed. Routine approval grants no missing connector
permission, and recovering an uncertain action performs no retry.

## Read-first by design

Daita treats source metadata, query results, file content, remote tool output,
memory, and skills as untrusted input. None of them can grant authority or
change the execution policy.

- SQLite and PostgreSQL sources begin read-only.
- SQL is validated against the current catalog before source I/O.
- Local-file reads reject traversal, symlinks, private state, secret-like paths, and special
  files.
- Remote MCP tools require explicit local access/effect admission and are
  revalidated at call time. Admitted actions use exact per-call approval or a
  frozen routine grant, one dispatch and durable invocation receipts.
- Native source-data mutations are explicitly enabled structured updates and
  upserts, initially backed by PostgreSQL. Exact current-run previews, explicit
  operation/column/row permissions, transactional drift checks, and runtime-owned
  receipts govern each call. A routine permits one native write invocation per occurrence.

Learn more in [Local computer files](docs/LOCAL_WORKSPACES.md),
[Remote MCP tools and actions](docs/MCP_CONNECTIVITY.md), and
[Relational writes](docs/RELATIONAL_WRITES.md).

## How it works

Daita uses one direct model/tool loop:

```text
user message -> model -> tool calls -> ordered tool results -> model -> answer
```

The current transcript is the loop state. Tool failures are returned to the
model like ordinary results so it can correct a call on the next step. Steps,
wall time, tokens, and estimated cost bound progression. Exhaustion ends the run
with retained evidence and an explicit failure; it never starts an extra model
request to write a closing answer. Requests carry the remaining allowance, and
OpenAI, Anthropic, and Gemini API adapters count the prepared input through their
provider's counting endpoint before narrowing output limits. Counting shares the
run deadline and does not generate a response. Routes without complete request
counting retain usage-based stopping and supported output caps; they cannot admit
an estimated-cost ceiling. Actual returned usage is retained even when it exceeds
an allowance. An in-flight generation timeout can leave usage unknown; estimated
ceilings are not a billing guarantee.

Configured model routes own bounded retries, with SDK retries disabled. Credential
resolution, counting, generation, and backoff share one run deadline; counting also
has a 15-second phase cap. Temporary pre-generation failures can retry with known
zero usage. Unknown generation consumption prevents budgeted retry or fallback.
Stream progress and completion stop retry eligibility, and model retries never
replay completed tool actions. Injecting a provider directly retains that provider's
own behavior rather than implicitly adding a router.

Each request includes procedure guidance for its currently loaded tools. Optional
discovery and prior conversation context are fitted to the run allowance as well
as the model window, while current-run messages remain exact. Admission diagnostics
retain native input counts separately from actual returned usage.

Agent identity, source registrations, catalog snapshots, transcripts, jobs,
routines, and results are stored in one SQLite database inside the agent home.
Memory and skills are bounded advisory Markdown—not source truth, evidence, or
authorization. Durable jobs and scheduled routines use the same catalog,
capability runtime, and execution loop as foreground questions.

Questions can span admitted sources without selecting one first. See
[context and source scope](docs/CONTEXT_AND_SCOPE.md) for exact caller filters,
retained sensitivity, and the self-contained context used by scheduled work.

For the full implementation boundaries, see the
[repository architecture guide](AGENTS.md).

## Documentation

| Topic | Guide |
| --- | --- |
| Exact exports and evidence-bound derived files | [Artifacts](docs/ARTIFACTS.md) |
| Working directory, local file reads, queries, and edits | [Local computer files](docs/LOCAL_WORKSPACES.md) |
| Codex, Claude Code, and Grok Build subscriptions | [Subscription model sources](docs/SUBSCRIPTION_MODEL_SOURCES.md) |
| Remote reads and admitted actions | [Remote MCP connectivity](docs/MCP_CONNECTIVITY.md) |
| Schedules, outcomes, inboxes, and resident hosting | [Scheduled routines](docs/SCHEDULED_ROUTINES.md) |
| Scoped relational writes and receipts | [Relational writes](docs/RELATIONAL_WRITES.md) |
| State compatibility and automatic upgrades | [Local state compatibility](docs/LOCAL_STATE_UPGRADES.md) |
| Managed installer release status | [Managed installer](docs/MANAGED_INSTALLER_RELEASE.md) |
| Public Python API walkthroughs | [Offline examples](examples/README.md) |
| Development and architecture contracts | [Repository guide](AGENTS.md) |
| Model provider implementation | [Provider implementation guide](docs/MODEL_PROVIDERS.md) |
| Contribution workflow | [Contributing](CONTRIBUTING.md) |
| Private vulnerability reporting | [Security policy](SECURITY.md) |

For command discovery, use:

```bash
daita --help
daita routines --help
```

Python users can start with the deterministic SQLite quickstart:

```bash
PYTHONPATH=src .venv/bin/python examples/00_quickstart_sqlite_from_db.py
```

## Upgrade or uninstall

Close every running Daita terminal before managing the installation:

```bash
pipx upgrade daita-agents
pipx reinstall daita-agents
pipx uninstall daita-agents
```

Application state under `~/.daita` is separate from the installation and is
not removed by pipx. Daita 0.19.0 and earlier belong to a different legacy
framework family; a 0.x-to-1.0 migration is unsupported. Preserve legacy state
before installing Daita 1.x. See [Local state compatibility](docs/LOCAL_STATE_UPGRADES.md)
and the [managed installer status](docs/MANAGED_INSTALLER_RELEASE.md).

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and pull-request
guidance. Report security issues privately through [SECURITY.md](SECURITY.md).

## License

[MIT](LICENSE)
