Metadata-Version: 2.1
Name: axiomesh
Version: 4.2.0
Summary: Environment Design Pattern (EDP) + Model Environment Protocol (MEP) — Causal, contextual, multi-agent AI architecture
Home-page: https://github.com/ONE-ORIGINE/axiomesh
Author: OneOrigine
Author-email: OneOrigine <research@imperialschool.dev>
License: I.S. License — Attributed Open Architecture
Project-URL: Homepage, https://github.com/ONE-ORIGINE/axiomesh
Project-URL: Repository, https://github.com/ONE-ORIGINE/axiomesh
Keywords: environment,design-pattern,protocol,AI,LLM,multi-agent,causal,contextual,MEP,EDP,axiomesh,situated-AI
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: all
Requires-Dist: anthropic >=0.25 ; extra == 'all'
Requires-Dist: ollama >=0.2 ; extra == 'all'
Requires-Dist: openai >=1.0 ; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic >=0.25 ; extra == 'anthropic'
Provides-Extra: ollama
Requires-Dist: ollama >=0.2 ; extra == 'ollama'
Provides-Extra: openai
Requires-Dist: openai >=1.0 ; extra == 'openai'

# axiomesh

**Environment Design Pattern (EDP) + Model Environment Protocol (MEP)**

*OneOrigine / ImperialSchool Research — I.S. License*

> "A perfect balance between rationality and probability is necessary to fully leverage the logic of artificial intelligence." — Seikatsu-One

## Install

```bash
pip install axiomesh
pip install axiomesh[ollama]     # + local Ollama
pip install axiomesh[all]        # + all LLM providers
```

## Quick start — Multi-agent CLI

```bash
# Interactive school scenario (admin + teacher + accountant)
axiomesh-cli --demo
axiomesh-cli --scenario school --model gemma3:12b
axiomesh-cli --scenario bank
axiomesh-cli --scenario drone

# Run a task file
axiomesh-cli --task school_demo.axm

# Generate a demo task file
axiomesh-cli --gen-task --scenario school
```

## Chat mode commands

| Command | Description |
|---|---|
| `/agents` | List all active agents |
| `/focus admin` | Direct chat to the admin agent |
| `/focus all` | Broadcast mode (all agents) |
| `/broadcast <msg>` | Send goal to ALL agents simultaneously |
| `/ctx` | Show context + harmony-ranked actions |
| `/switch fin accountant` | Switch accountant to financial context |
| `/task file.axm` | Run a task file |
| `/spawn analyst fin` | Spawn a new agent |
| `/impact` | Session impact matrix |
| `/causal` | Causal graph (DOT) |
| `/why student.enroll` | Causal trace |
| `/savoir` | SAVOIR knowledge base |
| `/export` | Export session JSON |

## Task files (.axm)

```
# school_demo.axm
@agent admin
@context admin
@goal Add student Alice Chen

@parallel
@agent admin @context enrl
@agent admin : Enroll student STU001 courseId=CRS001

@agent accountant @context fin
@agent accountant : Process fee payment studentId=STU001
@end
```

## Python API

```python
from axiomesh import Environment, Context, Action, Reaction, Element
from axiomesh import MepGateway, SenseVector, Circumstance, EnvironmentKind, ContextKind

env = Environment("MyEnv", EnvironmentKind.REACTIVE)
ctx = env.create_context("Main", ContextKind.SEMANTIC,
      basis=SenseVector.normative("operations", 0.9))

# Add action
async def handler(actor, payload, ctx, frame):
    return Reaction.ok("my.action", f"Done: {payload}")

ctx.reg(Action("my.action", "command", "Do something",
               SenseVector.normative("action", 0.9), handler=handler))

# MEP gateway
gw      = MepGateway(env)
session = gw.connect("agent-1")
envelope = gw.build_envelope(session, actor, ctx)
reaction = await gw.dispatch(session, actor, "my.action", {}, ctx)
```

## Mathematical Foundations

- **Central equation**: `E_{t+1} = 𝔘(E_t, 𝔯(x,c,Σ, 𝔄(x,c,Σ,Γ,Ψ(D,c,Σ))))`
- **Harmony**: `H = α·cos(A,C) + β·cos(A,S) + γ·cos(R̂,R) − δ·D`
- **Admissibility**: `Adm(a) = ∧_{γ∈Γ_a} γ(E,c,Σ,x)`
- **Optimum**: `a* = argmax_{a∈Avail} H(a,c,s)`
