DocsGetting Started

MURA SDK

Python SDK for the MURA Supply Chain Agent Network. Enable AI agents to coordinate procurement, logistics, and compliance.

Built on NANDA — MURA implements concepts from MIT Media Lab's NANDA research for agent coordination.

Installation

bash
1pip install mura-sdk

Requires Python 3.10+

Quick Start

For Platforms

python
1from mura import MuraClient
2
3client = MuraClient(api_key="mura_live_xxx")
4
5result = client.procure(
6 request="500 temperature sensors",
7 budget=5000,
8 destination_region="EU"
9)
10
11print(result.recommendation.recommended_supplier)

For Suppliers

python
1from mura import SupplierAgent
2
3agent = SupplierAgent(
4 name="Acme Electronics",
5 capabilities=["electronics", "sensors"],
6 region="EU"
7)
8
9agent.add_to_catalog("temperature_sensor", 5.50, "sensors")
10agent.register()
11agent.run()

SDKMuraClient

MuraClient

The main client for platforms to use MURA as supply chain infrastructure.

python
1from mura import MuraClient
2
3client = MuraClient(
4 api_key="mura_live_xxx", # Your API key
5 base_url="https://mura-production.up.railway.app", # Optional
6 timeout=120.0 # Request timeout
7)

Parameters

NameTypeDescription
api_keystrYour MURA API key
base_urlstrAPI base URL (optional)
timeoutfloatRequest timeout in seconds (default: 120)
client.procure(request, budget=None, deadline_days=7, destination_region='EU')ProcurementResult

Run the full procurement workflow: BOM → discovery → quoting → compliance → logistics → recommendation.

python
1result = client.procure(
2 request="Build me a racing drone",
3 budget=1000,
4 deadline_days=14,
5 destination_region="EU"
6)
7
8# Access results
9result.bom # Bill of Materials
10result.quotes # All quotes
11result.compliance # Compliance result
12result.logistics # Shipping plan
13result.recommendation # Final recommendation

Parameters

NameTypeDescription
request*strNatural language procurement request
budgetfloatBudget constraint in EUR
deadline_daysintDelivery deadline (default: 7)
destination_regionstrDestination: EU, US, Asia
async client.procure_stream(request, ...)AsyncGenerator[dict]

Stream procurement with real-time updates. Perfect for live UI progress.

python
1async for step in client.procure_stream("500 sensors"):
2 print(f"[{step['agent']}] {step['message']}")
3
4 if step.get('phase') == 'complete':
5 result = step.get('data')

Step Object

{
  "agent": "compliance",
  "message": "Checking EU regulations...",
  "phase": "compliance",
  "progress": 0.7
}
client.registry.discover(role=None, capability=None, region=None, min_trust=0.0)List[AgentFacts]

Discover agents in the MURA network.

python
1from mura import AgentRole
2
3suppliers = client.registry.discover(
4 role=AgentRole.SUPPLIER,
5 capability="electronics",
6 region="EU",
7 min_trust=0.8
8)
9
10for s in suppliers:
11 print(f"{s.name}: {s.trust.reputation_score}")
client.quotes.get_quote(supplier_id, items, deadline_days=None)dict
python
1quote = client.quotes.get_quote(
2 supplier_id="supplier-abc123",
3 items=[
4 {"part_name": "temperature_sensor", "quantity": 100},
5 {"part_name": "humidity_sensor", "quantity": 50}
6 ]
7)
8
9print(f"Total: €{quote['total_cost']}")
client.compliance.check(items, destination_region, transport_type='air')dict
python
1result = client.compliance.check(
2 items=[{"part_name": "battery_li_ion", "category": "electronics"}],
3 destination_region="EU",
4 transport_type="air"
5)
6
7print(f"Status: {result['status']}") # passed, warning, failed
client.logistics.plan(origin_region, destination_region, items, deadline_days=None)dict
python
1plan = client.logistics.plan(
2 origin_region="Asia",
3 destination_region="EU",
4 items=[{"weight_kg": 5}],
5 deadline_days=7
6)
7
8print(f"Provider: {plan['provider']}, Cost: €{plan['shipping_cost']}")

SDKSupplierAgent

SupplierAgent

Join the MURA network as a supplier to receive RFQs and respond with quotes.

python
1from mura import SupplierAgent
2
3agent = SupplierAgent(
4 name="Acme Electronics",
5 capabilities=["electronics", "sensors", "MCUs"],
6 region="EU",
7 country="Germany",
8 certifications=[
9 {"authority": "ISO", "certification": "9001"},
10 ],
11 max_discount_pct=15.0,
12 lead_time_days=5
13)

Parameters

NameTypeDescription
name*strYour company name
capabilities*List[str]What you supply
region*strYour region: EU, US, Asia
countrystrYour country
certificationsList[dict]Your certifications

Catalog Management

python
1# Add items to catalog
2agent.add_to_catalog(
3 part_name="temperature_sensor",
4 unit_price=5.50,
5 category="sensors",
6 stock=1000,
7 lead_time_days=3
8)
9
10# Load from JSON file
11agent.load_catalog_from_json("catalog.json")
12
13# Load from dictionary
14agent.load_catalog_from_dict({
15 "esp32": {"unit_price": 8.0, "category": "MCUs", "stock": 500}
16})

Custom RFQ Handler

Connect to your ERP/inventory system with a custom handler.

python
1from mura import Quote, QuoteItem
2
3@agent.on_rfq
4def handle_rfq(rfq):
5 items = []
6
7 for item in rfq.items:
8 price = my_erp.get_price(item.part_name)
9 if price is None:
10 continue
11
12 items.append(QuoteItem(
13 part_name=item.part_name,
14 unit_price=price,
15 quantity=item.quantity,
16 total_price=price * item.quantity,
17 lead_time_days=3,
18 in_stock=True
19 ))
20
21 return Quote(
22 supplier_id=agent.agent_id,
23 supplier_name=agent.name,
24 region=agent.region,
25 items=items,
26 total_cost=sum(i.total_price for i in items),
27 currency="EUR",
28 lead_time_days=max(i.lead_time_days for i in items)
29 )
30
31agent.register()
32agent.run()

ReferenceModels

Models

python
1from mura import (
2 # Agent Identity (NANDA)
3 AgentFacts,
4 TrustProfile,
5 Certification,
6
7 # Procurement
8 BOMItem,
9 BillOfMaterials,
10 Quote,
11 QuoteItem,
12 RFQ,
13
14 # Results
15 ProcurementResult,
16 ComplianceResult,
17 LogisticsPlan,
18 Recommendation,
19)

Enums

python
1from mura import TrustLevel, AgentRole, ComplianceStatus
2
3# Trust Levels (ZTAA)
4TrustLevel.SELF_DECLARED # Agent claims capabilities
5TrustLevel.PEER_ATTESTED # Other agents vouch
6TrustLevel.AUTHORITY_VERIFIED # Official verification
7
8# Agent Roles
9AgentRole.SUPPLIER
10AgentRole.LOGISTICS
11AgentRole.COMPLIANCE
12AgentRole.BUYER
13
14# Compliance Status
15ComplianceStatus.PASSED
16ComplianceStatus.WARNING
17ComplianceStatus.FAILED

Error Handling

python
1from mura import (
2 MuraError, # Base exception
3 MuraConnectionError, # Network issues
4 MuraAuthenticationError, # Invalid API key
5 NoSuppliersFoundError, # No matching suppliers
6 ComplianceError, # Compliance blockers
7)
8
9try:
10 result = client.procure("dangerous goods")
11except ComplianceError as e:
12 print(f"Blocked: {e.blockers}")
13except NoSuppliersFoundError:
14 print("No suppliers available")