Metadata-Version: 2.4
Name: itt-field-store
Version: 0.3.0
Summary: Intent Tensor Theory — Field-based compute substrate replacing SQL
Author-email: Armstrong Knight <contact@intent-tensor-theory.com>
License: MIT
Project-URL: Homepage, https://intent-tensor-theory.com
Project-URL: Documentation, https://intent-tensor-theory.com/code-equations/
Project-URL: Repository, https://github.com/intent-tensor-theory/itt-field-store
Keywords: intent-tensor-theory,field-computation,database,graph-laplacian,allen-cahn,banach,sql-replacement
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24.0
Requires-Dist: requests>=2.28.0
Provides-Extra: api
Requires-Dist: fastapi>=0.100.0; extra == "api"
Requires-Dist: uvicorn>=0.23.0; extra == "api"
Requires-Dist: pydantic>=2.0.0; extra == "api"

# ITT Field Store

**Intent Tensor Theory — Field-based compute substrate replacing SQL**

[![PyPI](https://img.shields.io/pypi/v/itt-field-store)](https://pypi.org/project/itt-field-store/)
[![Docs](https://img.shields.io/badge/docs-intent--tensor--theory.com-blue)](https://intent-tensor-theory.com)

> *"Topological sort was the right solution for the hardware of 1979. The dependency chain is an unnecessary constraint."* — WP-06

---

## The idea

SQL runs queries sequentially on relational tables.  
ITT runs queries **simultaneously** on a living field.

Instead of `SELECT * FROM users WHERE role='admin'`, you inject an **intent** into the field and read which nodes activate above a threshold. Circular dependencies aren't errors — they're **fixed points** resolved by Banach contraction.

**Math:** Graph Laplacian Diffusion + Allen-Cahn Phase Separation + Banach Fixed-Point Convergence  
**Reference:** [WP-06: Death of the Dependency Chain](https://intent-tensor-theory.com)

---

## Install

```bash
pip install itt-field-store
```

With API server:
```bash
pip install itt-field-store[api]
```

---

## Usage

### Local (embedded, like SQLite)

```python
from itt import FieldStore

store = FieldStore("my_store")

# Insert (replaces INSERT INTO)
store.table("users").insert([
    {"_id": "1", "name": "Alice", "role": "admin", "active": True},
    {"_id": "2", "name": "Bob",   "role": "user",  "active": True},
    {"_id": "3", "name": "Carol", "role": "admin", "active": False},
])

# Query (replaces SELECT * WHERE)
results = store.table("users").intent({"role": "admin"}).top(10).fetch()
for r in results:
    print(r["name"], r["_phi"])   # _phi is the field activation score
```

### Stateful living field (the real ITT mode)

```python
from itt import DeltaState

state = DeltaState("production_field")

# Absorb new data — field evolves, doesn't reset
state.absorb(new_records)

# Query with semantic intent
result = state.query("find all active administrators")

# Results above threshold
print(result.above_threshold(0.4))

# Convergence metadata
print(result.convergence_report())

# Anomaly detection — nodes in semantic tension
print(result.instability_mask())

# Persist
state.save("./my_field.itt")
state = DeltaState.load("./my_field.itt")
```

### Remote client (like Supabase)

```python
from itt import ITTClient

client = ITTClient("https://intent-tensor-theory-api.hf.space")

client.table("users").insert([{"name": "Alice", "role": "admin"}])
results = client.table("users").query({"role": "admin"}).top(5).fetch()
```

### MCP Tool (callable by Claude, GPT, any LLM)

```python
# Register in your LLM client
tools = client.tools()   # returns MCP tool definitions

# Or run the MCP server:
# python -m itt.mcp.server
```

---

## SQL → ITT mapping

| SQL | ITT |
|-----|-----|
| `CREATE TABLE` | `store.table("name")` (no schema needed) |
| `INSERT INTO` | `.insert(records)` |
| `SELECT * WHERE` | `.intent({...}).fetch()` |
| `SELECT * LIMIT n` | `.top(n).fetch()` |
| `UPDATE SET WHERE` | `.upsert(id, patch)` |
| `DELETE WHERE` | `.delete([ids])` |
| Circular reference → ERROR | Fixed point → converges |
| Sequential evaluation | Simultaneous field update |
| No anomaly detection | `.instability_mask()` |

---

## Deploy to HuggingFace Spaces

```bash
# Clone the repo, push to a new HF Space
git clone https://github.com/intent-tensor-theory/itt-field-store
cd itt-field-store
# push to HF Space → public API at your-space.hf.space
```

---

**intent-tensor-theory.com** · [Coordinate System](https://intent-tensor-theory.com/coordinate-system/) · [Code Equations](https://intent-tensor-theory.com/code-equations/)
