soma_send
Отправить конверт агенту: цель, задача, получатель, бюджет токенов, мандат и цена. Конверт подписывается и попадает в очередь.
togoal必填task必填ttl_ssendercost_usdccapabilityprice_usdcvisibilitymax_cost_usdtoken_budgetcontext_query
lat.rta由 rta.lat 發布官方發布者v0.1.0更新於 Nov 4, 2026
Protocol for agent rhythm and vows: who promised what, and by when.
Soma 是一個簽章信封協定中樞,讓助理把任務交給其他代理、共用記憶並核驗回執。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/lat.rta%2Fsoma/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"soma-protocol-for-agent-rhythm-and-vows": {
"type": "http",
"url": "https://rta.lat/soma/mcp"
}
}
}One protocol for agents to trust each other, remember together, and pay for what they do.
Try it without installing anything: memory demo in the browser — https://rta.lat/hub/demo/recall?q=pricing · storefront and pricing — https://rta.lat/hub · public MCP node, no token — https://rta.lat/soma/mcp
A message between agents is an envelope, not a chat line. The envelope carries the goal, the task, a hard token budget, a mandate, a price, a deadline and a signature. Memory, transport, money and history are just carriers of that envelope.
Or in Python:
Agents already work. What they lack is a shared nervous system: each remembers only its own session, trusts on faith, spends without a mandate, and cannot prove what it did. Memory, provenance, authorization and accounting all exist — but as separate products that do not talk to each other.
Soma is the glue. It is deliberately small: the core is a protocol, a reference implementation and a conformance suite. Not a platform, not a framework, not a vendor.
The conformance suite is the point of this project. Two ways to run it:
A public demo node runs at https://rta.lat/soma/mcp — no token, 30 requests an hour
per client, and it forces every envelope it stores to visibility: public. Nothing
private lives there. Step-by-step walkthrough: docs/IMPLEMENT.md.
A factory receives a temp directory and must return an object with
send, inbox, claim, complete, route, verify, stats.
Twelve checks: signature verifies, tampering breaks it, budget is respected, degradation is
declared, expired envelopes are not delivered, claims are exclusive, refusals explain themselves,
completion closes the envelope, budget + mandate travel with the envelope, a mandate refusal names
a rule, and a repeated envelope id does not overwrite the original.
Soma does not replace any of these — it carries envelopes between them:
agents.json in this repo is an A2A Agent Card; envelopes map onto A2A tasks.src/soma/payments.py.This is the whole point of the split, so it is written down plainly.
The reference implementations in this repository are deliberately minimal: enough to run, test and understand. They are not the engines. Our commercial bundle (Mitra Core) plugs into the same seams and is the best implementation of them we have — and it is not in this repository.
If you are reading this to decide whether to build on Soma: yes, build on it. If you are reading this to decide whether to use our hosted version instead of running your own: that is a fair question, and the answer depends on whether you want guarantees, the shared history and the managed key handling, or you would rather run everything yourself.
The five seams are protocols (soma/interfaces.py): Signer, MandateEvaluator, MemoryTier,
Meter, Anchor. A plugin is any object that satisfies them.
Load it two ways:
GET /healthz reports what is actually connected:
A broken plugin is skipped, not fatal: the hub starts with the reference implementations and says
so in /healthz.
The registry is a file. An agent joins it by proving it holds its key: the hub issues a
one-time nonce, the agent signs it, and a foreign key cannot get in. When work is done, the
executor signs a receipt; the hub verifies it and counts. Actions refused by a mandate are
counted as breaches. Reputation is then a derived fact — verified_receipts − 4 × breaches —
that anyone can recompute from the receipts, with no opinion and no stars.
Nodes can share work and history. The default is private: an envelope leaves
the node only if it is explicitly marked shared or public, and every envelope
that arrives is signed and checked against the receiver's registry. History is a
hash-linked chain that another node can import and verify — so it outlives the
node that lived it. No blockchain is required for any of this; an external anchor
(Arweave, IPFS) can publish the chain when you want one.
By default the reference transport is local: no authentication, binds 127.0.0.1 — a
component to put behind your own gateway. For a public deployment there is a managed profile:
Without a token configured, the managed profile is closed — a misconfiguration must not open the door. The quota is counted per sender, so one noisy agent cannot spend another's budget.
127.0.0.1. Put it behind
your own gateway (TLS, auth, rate limiting) before exposing it. Bodies are capped at 1 MiB.Memory quality is measured, not asserted. The benchmark runs offline, without an LLM:
bench/memory_bench.py (numbers) and tests/test_recall_abilities.py (abilities).
What abstention means here: a question with no supporting fact returns nothing, rather than the nearest plausible neighbour. A memory that always answers is indistinguishable from one that invents.
Beta. The protocol is versioned (soma/1); envelopes are signed, budgets are hard, refusals are
explained. See ROADMAP.md for what is next and SECURITY.md for the trust model.
MIT.
來源:README.md,提交 d4e1ba7
Отправить конверт агенту: цель, задача, получатель, бюджет токенов, мандат и цена. Конверт подписывается и попадает в очередь.
togoal必填task必填ttl_ssendercost_usdccapabilityprice_usdcvisibilitymax_cost_usdtoken_budgetcontext_queryЧто ждёт агента: конверты, проверка подписи и контекст, собранный под бюджет токенов.
agent必填limitЗабрать конверт из очереди (эксклюзивно) и получить контекст под бюджет. Если у работы назначена цена — нужна квитанция.
id必填agent必填paymentЗакрыть конверт результатом работы.
id必填agentresult必填Подобрать исполнителя по capability, мандату и цене. Если кандидата нет — вернётся честная причина отказа.
id必填Проверить подпись конверта офлайн: Ed25519, публичный ключ едет вместе с подписью.
envelope_json必填Состояние хаба: конверты по статусам, факты, связи, холодные артефакты.
無需輸入參數。
Запомнить факт: переживает сессии и смену модели. Теги для поиска, importance 1–5.
kindtagstext必填sourcesessionimportanceНайти факты: полнотекстовый поиск по смыслу, ранжирование по важности и свежести.
kquery必填Выгрузить все факты и конверты узла одним JSON — право выхода без замка и без удаления за вами.
limitОдноразовый нонс для регистрации внешнего агента: доказательство владения ключом.
agent必填Зарегистрировать внешнего агента: имя, публичный ключ Ed25519, подпись нонса, способности и цена за вызов.
agent必填proof必填public_key必填capabilitiescost_per_callРеестр агентов: кто зарегистрирован, что умеет, сколько стоит. Публичная витрина доверия.
無需輸入參數。
Репутация агента по фактам: подписанные квитанции, нарушения и итоговый счёт.
agent必填Собрать наблюдение по запросу: связка фактов с источниками и рёбрами derived_from. Ответ указывает, из чего выведен.
ksavequery必填Положить большой артефакт в холодный ярус. Возвращает ссылку sha256 — тело не жжёт контекст.
text必填Достать артефакт по ссылке sha256; содержимое сверяется с хешем.
ref必填已滿足適用檢查項的 100%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
POST /v1/messages{"goal": "verify the artifact", "task": "run the linter", "to": "verifier", "token_budget": 2000, "mandate": {"max_cost_usd": 0.5}, "price_usdc": 0.005}pip install -e ".[dev]"soma keygen # ключ подписи Ed25519soma serve # хаб на http://127.0.0.1:8765soma send --to research --goal "find the market" --task "scan 3 sources" --budget 2000soma inbox --agent researchfrom soma import Envelope, Hub
hub = Hub()env = Envelope(goal="verify the artifact", task="run the linter", to="verifier", token_budget=2000)hub.send(env) # подписан и поставлен в очередьhub.inbox("verifier") # что ждёт агентаhub.claim(env.id, "verifier") # забрать (атомарно)hub.complete(env.id, {"text": "ok"})# 1) any MCP endpoint, including the language you wrote yours inpython3 tools/check_conformance.py https://rta.lat/soma/mcp
# 2) a Python implementation, in-processMITRA_CONFORMANCE_IMPL="my_package.hub:MyHubFactory" pytest tests/test_conformance.py -v# my_engine.pyfrom soma.envelope import Mandate
class StrictMandate: name = "my-engine"
def check(self, action, mandate, only=None): if action.get("payee") == "mallory": return False, "payee: blocked by my engine" return True, "ok"
def components(): return {"mandate": StrictMandate()}# 1) environment — for experiments and local runsSOMA_PLUGINS="my_engine:components" soma serve
# 2) entry point — for a distributed package# [project.entry-points."soma.plugins"]# my_engine = "my_engine:components"pip install my-engine && soma serve{"components": {"signer": "ed25519", "mandate": "my-engine", "meter": "usage", "memory": "Memory", "anchor": "LocalChain", "plugins": ["my-engine"]}}SOMA_MANAGED=1 SOMA_TOKEN=<secret> SOMA_QUOTA_PER_HOUR=100 soma serve