Metadata-Version: 2.5
Name: tarel
Version: 0.0.5
Summary: A local-first analytics context compiler for coding agents.
Project-URL: Homepage, https://github.com/mpsgitai/tarel
Project-URL: Repository, https://github.com/mpsgitai/tarel
Project-URL: Issues, https://github.com/mpsgitai/tarel/issues
Project-URL: Documentation, https://github.com/mpsgitai/tarel/tree/master/docs
Author: MPS
License-Expression: MIT
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Keywords: agents,analytics,context,lineage,metadata,semantic-layer
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.15; extra == 'dev'
Requires-Dist: ruff>=0.11; extra == 'dev'
Provides-Extra: local-rag
Requires-Dist: llama-cpp-python<0.4,>=0.3.16; extra == 'local-rag'
Provides-Extra: semantic
Requires-Dist: pyyaml<7,>=6; extra == 'semantic'
Provides-Extra: sql-lineage
Requires-Dist: sqlglot<30.20,>=30.19; extra == 'sql-lineage'
Provides-Extra: sqlite
Provides-Extra: sqlserver
Requires-Dist: pymssql<3,>=2.3; extra == 'sqlserver'
Provides-Extra: vector
Requires-Dist: sqlite-vec==0.1.9; extra == 'vector'
Description-Content-Type: text/markdown

# TAREL

**Help your agents understand your data estate.**

```bash
pip install tarel
# or
uv tool install tarel
```

[![PyPI](https://img.shields.io/pypi/v/tarel)](https://pypi.org/project/tarel/)
[![Python](https://img.shields.io/pypi/pyversions/tarel)](https://pypi.org/project/tarel/)
[![CI](https://github.com/mpsgitai/tarel/actions/workflows/ci.yml/badge.svg)](https://github.com/mpsgitai/tarel/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

A coding agent can read a stored procedure. Understanding an entire warehouse takes a map.

The **TAREL Graph** is a simple data structure designed for navigating huge information systems.
It connects technical objects, business meaning, and data dependencies into reusable knowledge
for engineers and agents.

Create, annotate, and refresh graphs through the CLI or Python SDK.

Runs locally. No mandatory third-party runtime dependencies.

## Let agents build knowledge you can review

TAREL helps your harness explore schemas, objects, and tables, progressively gathering metadata
and annotations into a persistent **TAREL Graph**.

**Self-annotation** turns available evidence into usable descriptions, synonyms, tags, and
relationship proposals. Drafts can immediately help an agent; optional review and governance stay
available when a project needs them. Rerunning the default batch fills missing table or field
annotations without replacing existing work.

TAREL treats semantics as metadata over the source—not as a second calculation engine. SQL views,
warehouse transformations, measures, calendars, and currency logic remain authoritative where they
already live. TAREL describes and connects those assets; it does not duplicate their expressions,
cache query results, or require a governed semantic model before an agent can start.

Graph refresh is incremental: TAREL fingerprints connector-observed schema metadata, performs no
write for an unchanged observation, and can optionally annotate only newly added objects or fields.
It does not scan data rows or rerun annotation across the existing graph.

![TAREL field annotation inspector with semantic descriptions, evidence, and review state](https://raw.githubusercontent.com/mpsgitai/tarel/master/docs/assets/tarel-field-annotation-inspector.png)

*Descriptions stay prominent; evidence, provenance, and optional review unfold only when needed.*

## Explore through Space and Lineage

**Space** shows what exists and what it means: tables, fields, relationships, and annotations.

**Lineage** traces reports and measures through transformations to their sources, with evidence
behind each connection.

SQL definitions can be analyzed by a configured provider or, after installing the optional
`tarel[sql-lineage]` extra, locally with SQLGlot first and provider fallback only for unresolved
definitions. The base installation does not include or import SQLGlot. See
[static lineage analysis](docs/static-lineage.md).

Import declared dbt manifest dependencies without a provider or SQL parsing using
`tarel lineage import-dbt NAME --manifest target/manifest.json`. The matching SDK method
uses the same build/refresh path. See [dbt lineage import](docs/dbt-lineage.md) for supported
resources, ephemeral models, evidence states, and explicit catalog mappings.

![TAREL switching from schema structure to data and process lineage](docs/assets/space-to-lineage.gif)

*The same information system, organized by schema or traced through data flow.
Real GUI, synthetic demo, original animation speed.*

[View the static Space screenshot](https://raw.githubusercontent.com/mpsgitai/tarel/master/docs/assets/semantic-space.png)

## Follow a report back to its sources

Start with what the business knows: a report, visual, or measure. Trace its dependencies through
semantic models, ETL steps, and stored procedures to source tables and fields.

Each connection retains its evidence and review state. Workflow order and actual data flow remain
distinct, so a scheduled dependency never silently becomes table lineage.

![TAREL lineage trace from a Power BI report measure to DWH source tables](https://raw.githubusercontent.com/mpsgitai/tarel/master/docs/assets/report-lineage.png)

*A Power BI measure traced through a semantic column, physical mart, dbt models, and an extract to
five DWH origin tables. Draft state and changes in lineage granularity remain visible.*

## Retrieve what matters

Search the graph by technical name or business meaning using built-in BM25 or optional local
embeddings. Expand along relevant relationships within explicit context budgets.

Local vector indexes reuse unchanged embeddings when graph metadata changes. Inspect and update a
bounded group of workspace graphs through the CLI, SDK, or browser. The optional `tarel[vector]`
extra runs vector ranking inside the existing SQLite index; see
[local retrieval and index maintenance](docs/contracts.md#local-retrieval).

Select embedding and reranker models independently through `tarel retrieval`, `sdk.retrieval`,
or the browser's **Search models** panel. Local CPU retrieval remains the default, with reranking
off. Optional HTTP profiles support cloud embeddings and relevance reranking, including OpenRouter
embeddings and Jev Decisions. Each selected embedding model keeps a separate local SQLite index;
see [retrieval model selection](docs/contracts.md#retrieval-model-selection).

In the CLI, SDK, and browser you can set a hard working scope, filter physical candidates before
ranking, inspect why each result matched, turn exact results into a stable context packet, and load
bounded metadata deltas later without replacing the cacheable base.

Every packet also has a compact brief for agent conversations: current area, loaded size, semantic
coverage, evidence-backed gaps, and stable continuity IDs. Comparing packets explains what was
added, kept, removed, or resolved instead of forcing a person or agent to interpret raw JSON.

Your agent receives a focused slice with source identity, SQL dialect, evidence, and visible gaps.
The same graph supports many questions without sending the entire estate into every conversation.

## Extend TAREL to fit your systems

Every data selection, documentation source, and ETL orchestration can contribute knowledge to
the graph.

**Self-modification through reviewed extensions:** When an interface is missing, a coding agent can
implement a connector or importer against TAREL's contracts. You review, test, and activate it.

This lets the graph grow into your actual environment—including custom scripts, legacy systems,
and internal frameworks.

## Get started and go deeper

Try the synthetic [Retail DWH walkthrough](docs/retail-demo.md) without credentials.

- [CLI reference](docs/cli-reference.md)
- [Architecture, contracts, and self-modification](docs/architecture.md)
- [Demo warehouse](docs/retail-demo.md)
- [Three-day enterprise workshop](docs/workshop.md)
- [Python SDK](docs/cli-reference.md#python-sdk)
- [Documentation index](docs/README.md)

Moving scripts from 0.0.3 to 0.0.4: JSON output is unchanged, but some flags and defaults are not.

- `search`, `context build`, `context prefix` and `grounding` take the workspace by name:
  `tarel search enterprise "revenue" --workspace` becomes
  `tarel search "revenue" --workspace enterprise`.
- `graph header`, `graph objects`, `graph slice` and `graph rebuild-index` print text by default;
  pass `--format json` for the previous output.
- `semantic import`, `list`, `show` and `edit` select their output with `--format` instead of
  `--output`; the input format of `semantic import` moved from `--format` to `--source-format`.

Existing retrieval indexes keep working; see their
[embedding input state](docs/contracts.md#embedding-input).

TAREL is pre-alpha. SQLite and SQL Server connectors are included. TAREL does not execute
analytical answer queries; your harness does.

[Contributing](CONTRIBUTING.md) · [Security](SECURITY.md) · [MIT License](LICENSE)
