Metadata-Version: 2.4
Name: antahkarana
Version: 0.1.0
Summary: A trainable continual-learning architecture (manas/buddhi/ahaṃkāra/citta) you train on your own data — no forgetting, novelty/zero-day detection, calibrated abstention.
Author: Deepak Soni
License: Apache-2.0
Project-URL: Homepage, https://huggingface.co/deepakdsoni/antahkarana-base
Keywords: continual-learning,lifelong-learning,catastrophic-forgetting,ood,lora,antahkarana
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0
Requires-Dist: numpy
Provides-Extra: text
Requires-Dist: transformers>=4.40; extra == "text"
Requires-Dist: peft>=0.10; extra == "text"

# antahkarana — train a continual-learning mind on **your** data

`antahkarana` is a **trainable architecture**, not a frozen model. You bring your data (and optionally your
backbone); it trains a model that **learns continually without forgetting**, **detects novelty / zero-days**,
**abstains when unsure**, and **consolidates in sleep**. Four organs — *manas · buddhi · ahaṃkāra · citta* —
the mind is the same for every domain; only a thin adapter changes.

Built on the validated [Antaḥkaraṇa-base](https://huggingface.co/deepakdsoni/antahkarana-base) core (gated
G0–G5, proven across language · vision · security).

## Install
```bash
pip install antahkarana            # core + tabular
pip install antahkarana[text]      # + HuggingFace LLM adapter
```

## Train on your data in ~10 lines (tabular)
```python
from antahkarana import Antahkarana, TabularAdapter

# YOUR data: a list of tasks, each (X_train, y_train, X_test, y_test)
stream = TabularAdapter.make_stream(your_tasks)

bb   = TabularAdapter(input_dim=122, n_tasks=4, n_classes=2)   # built-in MLP — bring only data
mind = Antahkarana(bb, replay_strategy="der", avidya_strategy="energy")
res  = mind.train(stream)

print(res["forgetting"], res["final_row"], res["risk_coverage"])
```

## Text (any HuggingFace causal-LM + LoRA)
```python
from antahkarana import Antahkarana, TextAdapter
bb     = TextAdapter("mistralai/Mistral-7B-v0.1")             # frozen base, small LoRA trains
stream = TextAdapter.make_stream(your_text_tasks)             # [(train_pairs, eval_pairs), …]
Antahkarana(bb).train(stream)
```

## Any other modality
Copy `antahkarana/adapters/template.py` (`CustomAdapter`) and implement 5 methods over **your** encoder
(audio, graph, multi-modal, robotics, …). The continual-learning mind is unchanged.

## What you get back
`train()` returns: the task×task accuracy `matrix`, `final_row`, `final_avg`, **`forgetting`**,
**`risk_coverage`** (calibrated abstention), `recovery` (sleep), and the `trajectory` (per-task guṇa/novelty).

## Knobs
`Antahkarana(bb, samskara=, replay_strategy="naive"|"der", avidya_strategy="msp"|"energy", sleep=, base_lr=, epochs=)`
— turn each organ on/off and swap in the SOTA implementation (DER++ dark-knowledge replay, energy-OOD novelty).

## Ship it closed-source
`python build_wheel.py` compiles the engine to binary `.so` (Nuitka) and drops the source, leaving only the
public interface readable — others can `pip install` and **train on their data without seeing your code**.
(For maximum IP protection, serve it behind an API instead.)

---
*Author — Deepak Soni · Apache-2.0*
