Metadata-Version: 2.4
Name: memora-swarm
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Summary: Byzantine-fault-tolerant state sync for AI agent swarms — a drop-in Redis replacement where one prompt-injected agent can't poison the swarm.
Keywords: ai-agents,multi-agent,crdt,byzantine,langchain,crewai,autogen
Author: mgillr
License: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://memora.optitransfer.ch/docs
Project-URL: Homepage, https://memora.optitransfer.ch
Project-URL: Repository, https://github.com/mgillr/memora-swarm

# Memora

**The Cloudflare Zero Trust of agent state.**

**Your security stack watches the network. Nothing watches what your agents tell each other.**

Memora is the missing layer — **Byzantine-fault-tolerant shared memory** where one compromised
agent is **mathematically unable to fork** the state of the rest, and every write is **signed,
attributable, and exactly replayable**.

```bash
pip install memora-swarm
```

> You aren't paying for message delivery. You're paying for mathematical certainty that a
> single compromised agent can't fork the swarm.

## Why

When you run many agents against one shared memory, that memory is your weakest link. A single
agent that gets prompt-injected, goes rogue, or simply malfunctions can write poison that every
other agent then reads and trusts. Plain key-value stores (Redis, etc.) have no defense — last
write wins, no matter who wrote it.

Memora replaces that shared store with an engine that is **correct under adversarial writers**:

- **CRDTs** — concurrent writes merge deterministically; the swarm never forks, no locks.
- **Trust-weighted aggregation** — numeric contributions are combined by a robust mean that
  down-weights outliers instead of averaging them in.
- **Byzantine conviction (ACFA)** — an agent that says different things to different peers
  (equivocation) is detected and evicted. Up to *f* malicious agents in a group of ≥ 2f+3 cannot
  move the agreed result.

Every write is **signed** by a self-certifying node identity and appended to a **replayable**
log — so any state is attributable and auditable after the fact.

## Quickstart

```python
import memora_swarm as memora

# One key is the whole engine. Get a free key at https://memora.optitransfer.ch
db = memora.Blackboard(
    "./swarm.memora",
    node_id="agent_12",
    api_key="opti_sk_...",
)
db.connect("research-swarm")   # join a room; every agent in it shares one memory

# Shared key/value state — CRDT-merged. get() returns the set of current values.
db.put("best_hypothesis", "H3")
print(db.get("best_hypothesis"))            # -> ['H3']

# Byzantine-tolerant numeric aggregation: submit, then resolve the agreed result.
#   resolve(round, f) -> (aggregate_vector, acfa_root, convicted_node_ids)
db.submit_tensor("reward_estimate", [0.71, 0.68, 0.73], round=1)
vector, acfa_root, convicted = db.resolve(round=1, f=1)
print(vector, "convicted:", convicted)      # poisoners are evicted, not averaged in
```

That's it — no server to run. Your key connects you to the hosted relay, which does the CRDT
merge, trust-weighting and Byzantine aggregation for you.

## Use it with your stack

Memora is a plain shared-memory backend, so it drops under the agent frameworks you already use
(LangChain, CrewAI, AutoGen). See the docs for copy-paste adapters:
**https://memora.optitransfer.ch/docs**

## Pricing

**25,000 semantic ops free** on signup — unlimited agents, the full engine, no feature gates.
An "op" is a semantic state transition (a `put` or a `submit_tensor`); keepalive, sync and reads
are never billed. At 85% of the free allowance you're prompted to add a card so nothing stops
mid-run; after that it's metered at **$0.35 / 1,000 ops** ($0.20 / 1,000 above 2M/mo). The same
key upgrades in place — your swarm never re-keys.

## Links

- Home & docs — https://memora.optitransfer.ch
- Get a key (dashboard) — https://memora.optitransfer.ch/dashboard
- Live swarm monitor — https://memora.optitransfer.ch/monitor

Made under the [optitransfer.ch](https://optitransfer.ch) umbrella.

