Metadata-Version: 2.4
Name: tethr-engine
Version: 0.3.0
Summary: Local-first behavioral intelligence engine with collectors, AI agent, and task executor
Author: Jeff Draper
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.20.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: requests>=2.28.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pillow>=9.0.0
Requires-Dist: sentence-transformers>=2.2.0
Requires-Dist: rich>=13.0.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: groq
Requires-Dist: anthropic
Requires-Dist: watchdog
Requires-Dist: mcp
Requires-Dist: pywin32>=305; sys_platform == "win32"
Provides-Extra: ml
Requires-Dist: scikit-learn; extra == "ml"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# tethr-engine

[![PyPI](https://img.shields.io/pypi/v/tethr-engine)](https://pypi.org/project/tethr-engine)
[![Python](https://img.shields.io/pypi/pyversions/tethr-engine)](https://pypi.org/project/tethr-engine)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

TETHR is a local-first behavioral intelligence engine.
It passively observes your devices, detects behavioral
patterns without cloud processing, and serves real-time
presence context to AI agents in under 300 tokens.

```bash
pip install tethr-engine
tethr start
```

---

## What it does

- **Passive observation** — watches active windows, typing cadence, system state via background POTS process
- **Pattern detection** — identifies focus areas, app clusters, work rhythms from local data only
- **Agent-ready API** — `/identity/context` returns a compact behavioral summary, ready to inject into any system prompt
- **MCP server** — native Claude Desktop integration via `python -m tethr_engine.mcp_server`
- **Zero cloud** — everything stays on your device; Groq API used only for LLM inference calls

---

## Quick start

```bash
pip install tethr-engine
tethr start          # first run prompts for Groq API key, then serves on :8001
tethr status         # confirm health
curl http://127.0.0.1:8001/identity/context
```

Full walkthrough → [docs/quickstart.md](docs/quickstart.md)

---

## Agent integration

```python
import requests

context = requests.get("http://127.0.0.1:8001/identity/context", timeout=3).json()["context"]
system_prompt = f"{your_base_prompt}\n\n[User context]\n{context}"
```

Query once per session, inject into system prompt. ~200–300 tokens.

Full guide → [docs/integration.md](docs/integration.md)

---

## CLI

| Command | Description |
|---|---|
| `tethr start` | Start server on `localhost:8001` |
| `tethr start --host 0.0.0.0` | Network accessible |
| `tethr start --reload` | Dev mode |
| `tethr status` | Health check |
| `tethr version` | Print version |

---

## Configuring data storage

By default TETHR stores data in the package directory. To use an external drive set `data_path` in `config.yaml`:

```yaml
data_path: D:\tethr-data
```

Or set it during first-run setup when prompted. TETHR creates the directory if it does not exist.

---

## Links

- [PyPI](https://pypi.org/project/tethr-engine)
- [Quickstart](docs/quickstart.md)
- [Integration guide](docs/integration.md)
