Skip to content

Commit 0ea74f9

Browse files
author
Neo
committed
Wire full protocol autonomy, intent classification, component registry, and polish
- runtime/protocols/integration.py: Wire intent classifier into pre_process gate (match_intent → system prompt enrichment with action hints and param prompts). Wire OutcomeLearning patterns into pre_process (learned patterns injected for matched actions). Wire OutcomeLearning → Trajectory feedback loop (post_action updates base success rates from observed outcomes). Add confidence calibration comparing predictions to actual results. - runtime/chat/intent_actions.py: Improve match_intent() with filler-word stripping and fuzzy keyword matching for natural language ("create a DAO", "help me get a loan" etc.) - gateway/bridge.py: Add component registry with COMPONENT_REGISTRY (15 services with UI flow schemas, version, capabilities, min_app_version). Add /bridge/v1/components, /bridge/v1/components/{id}, and /bridge/v1/components/manifest endpoints for dynamic iOS component delivery without app recompilation. - examples/README.md: Add mainnet deployment guide, EAS attestation on every action documentation, and revenue routing to NeoSafe docs. Add 09_full_user_journey.py example (complete journey across 8 services). - README.md: Add Try It Now section with 5 curl examples, Architecture diagram, Example Scripts table, and Protocol Stack descriptions. - Python 3.9 compat: Add from __future__ import annotations to all example scripts.
1 parent f36c00c commit 0ea74f9

14 files changed

Lines changed: 1120 additions & 11 deletions

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,100 @@ Every decision made by every agent on 0pnMatrx passes through the Unified Rexhep
120120

121121
---
122122

123+
## Try It Now
124+
125+
After setup and starting the gateway with `python -m gateway.server`, try these:
126+
127+
**Chat with Trinity**
128+
```bash
129+
curl -X POST http://localhost:18790/chat \
130+
-H "Content-Type: application/json" \
131+
-d '{"agent": "trinity", "message": "Hi Trinity, what can you help me with?"}'
132+
```
133+
134+
**Convert a contract**
135+
```bash
136+
curl -X POST http://localhost:18790/chat \
137+
-H "Content-Type: application/json" \
138+
-d '{"agent": "trinity", "message": "Convert this rental agreement into a smart contract: Monthly rent of $2000, 12 month term, $4000 security deposit, late fee of $100 after 5 days"}'
139+
```
140+
141+
**Check platform health**
142+
```bash
143+
curl http://localhost:18790/health
144+
```
145+
146+
**Get platform status**
147+
```bash
148+
curl http://localhost:18790/status
149+
```
150+
151+
**Run an example script**
152+
```bash
153+
python examples/01_contract_conversion.py
154+
```
155+
156+
---
157+
158+
## Architecture
159+
160+
```
161+
User → MTRX iOS App → Bridge (/bridge/v1/) → Gateway → ReAct Loop → Protocol Stack → Tools
162+
163+
Jarvis · Ultron · Friday
164+
Vision · Trajectory · Morpheus
165+
Rexhepi · Glasswing · Omega
166+
167+
30 Blockchain Services
168+
136 Platform Actions
169+
```
170+
171+
---
172+
173+
## Example Scripts
174+
175+
All examples live in `examples/` and run against Base Sepolia testnet.
176+
177+
| Script | Description |
178+
|---|---|
179+
| `01_contract_conversion.py` | End-to-end contract conversion from plain English to deployed smart contract |
180+
| `02_defi_loan.py` | Collateralised DeFi lending — deposit, borrow, repay, withdraw |
181+
| `03_nft_with_royalties.py` | Mint an NFT, list it, sell it with automatic royalty enforcement |
182+
| `04_parametric_insurance.py` | Weather-based crop insurance with oracle-triggered automatic payouts |
183+
| `05_marketplace_flow.py` | List, buy, and escrow a marketplace transaction |
184+
| `06_eas_attestation_chain.py` | Every action creates a verifiable on-chain attestation record |
185+
| `07_revenue_to_neosafe.py` | Platform fee routing and tracking to the NeoSafe multisig wallet |
186+
| `08_oracle_routing.py` | Multi-source oracle routing with fallback and aggregation |
187+
| `09_full_user_journey.py` | Every major platform capability in a single coherent user flow |
188+
189+
---
190+
191+
## Protocol Stack
192+
193+
The protocol stack gives Neo, Trinity, and Morpheus their cognitive abilities. Every user interaction passes through these protocols before a response is produced.
194+
195+
**Jarvis** — Identity foundation. Handles agent personality persistence, voice consistency, memory integration, and structured planning that feeds into the ReAct loop.
196+
197+
**Ultron** — Strategic reasoning engine. Decomposes goals into multi-step plans with risk assessment at each stage.
198+
199+
**Friday** — Proactive monitoring. Watches for opportunities, risks, and relevant events, then surfaces suggestions before the user asks.
200+
201+
**Vision** — Pattern recognition and emergence detection. Identifies trends, anomalies, and correlations across user activity to anticipate needs.
202+
203+
**Trajectory** — Outcome prediction and path optimization. Predicts likely results of actions and suggests the optimal sequence to reach a goal.
204+
205+
**Outcome Learning** — Feedback loop. Captures the results of past decisions and uses them to improve future reasoning.
206+
207+
**Morpheus Triggers** — Determines when Morpheus appears. Activates before irreversible actions, significant events, and high-stakes moments.
208+
209+
**Rexhepi Gate** — The execution gate. Every agent decision passes through the Unified Rexhepi Framework before it reaches the user.
210+
211+
**Omega** — The synthesis layer. Combines all protocol outputs into a single unified agent response — the orchestration brain.
212+
213+
**Protocol Stack (Integration)** — Wires all protocols into the agent runtime. The single entry point that the ReAct loop calls on every turn.
214+
215+
---
216+
123217
## Contributing
124218

125219
See `CONTRIBUTING.md` for the Möbius loop contribution model.

examples/01_contract_conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
01 — Contract Conversion: End-to-End Pipeline
55

examples/02_defi_loan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
02 — DeFi Loan: Collateralised Lending on Base Sepolia
55

examples/03_nft_with_royalties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
03 — NFT with Royalties: Mint, List, Sell with Automatic Royalty Enforcement
55

examples/04_parametric_insurance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
04 — Parametric Insurance: Weather-Based Crop Insurance on Base Sepolia
55

examples/05_marketplace_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
05 — Marketplace Flow: List, Buy, and Escrow on Base Sepolia
55

examples/06_eas_attestation_chain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
06 — EAS Attestation Chain: Every Action Creates a Verifiable Record
55

examples/07_revenue_to_neosafe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
07 — Revenue to NeoSafe: Platform Fee Routing and Tracking
55

examples/08_oracle_routing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import annotations
21
#!/usr/bin/env python3
2+
from __future__ import annotations
33
"""
44
08 — Oracle Gateway: Multi-Source Oracle Routing on Base Sepolia
55

0 commit comments

Comments
 (0)