EDMA — Evidence-Driven Model Architecture: a frozen, evidence-first cognitive runtime for AI agents (13-state DOP, default-deny actions, evidence-based verification, zero-template).
pip install edma-core==0.1.0 Copy PIP instructions
Open core of the runtime that powers the Solignus AI platform in production.
Agent frameworks usually trust the model: the model says the tool succeeded → the framework reports success. EDMA inverts this:
pip install edma-core[provider] # httpx only for the default provider export EDMA_PROVIDER_KEY="gsk_..." # any OpenAI-compatible key export EDMA_PROVIDER_BASE_URL="https://api.groq.com/openai/v1" export EDMA_PROVIDER_MODEL="qwen/qwen3.8-27b" import asyncio from edma_core import quickstart, runtime as RT quickstart() # env provider + in-memory docs/audit + no-budget run = RT.start_run("org-1", "What is 17*24?") view = asyncio.run(RT.advance_run("org-1", run)) print(view["response"]) # model-authored answer (or honest failure state) print(view["dop_path"]) # canonical trajectory: START→PERCEIVING→REASONING→RESPONSE Zero configuration also works (no provider → deterministic heuristics and honest failed/pending states instead of fabricated answers).
┌────────────────────── runtime.py (resumable DOP loop) ─────────────────────┐ │ the ONLY caller of dop.decide() │ │ │ model ─┼─▶ PERCEIVING ─▶ ENERGY ─▶ REASONING ─▶ ACTION_DECISION ─▶ ACTION_AUTHORIZATION │ (13 frozen states; waiting states pause WITHOUT transitioning) │ │ ▲ │ approve/deny │ │ └── VERIFICATION ◀── ACTION (execute) │ │ │ │ │ RESPONSE ─▶ END │ └────────────────────────────────────────────────────────────────────────────┘ ports: ModelProvider (chat) · DocStore (run snapshots) · EventSink (audit) Budget (metering, optional) · DatasetReader (read-back evidence) dop.py — frozen 13-state graph + deterministic decision policy components.py — ONE model, four structured cognitive modes (perceive / energy / reason / respond) + honest heuristic fallbacks actions.py — registry + deterministic ACTION_AUTHORIZATION (default-deny); capabilities are plugins (contrib.py factories, dependency-injected) verification.py — PASS / FAIL / UNCERTAIN / SKIPPED from evidence only trace.py — canonical trace of what ACTUALLY executed (+ durable audit sink) runtime.py — resumable loop: snapshots re-written around every transition, human-approval pauses, semantic non-progress detection, hard step cap as a secondary safety net only dataset_exec.py — fast direct-model dataset generation with QC (no samples pass QC → no dataset; nothing fabricated) Wiring your own backends from edma_core import configure configure( provider=MyProvider(), # async chat(payload) -> {ok, reply, usage, ...} docs=MyDocStore(), # user_doc_get/user_doc_put per-org documents sink=MyAuditSink(), # event_log/events_list append-only audit budget=MyBudget(), # cost_of/charge/balance (optional) dataset_reader=MyReader(), # get_dataset for read-back verification ) MCP server (Claude Desktop, Cursor & any MCP client) edma-mcp exposes EDMA's verification and action-authorization layers as standard Model Context Protocol tools over stdio — zero dependencies (stdlib JSON-RPC 2.0, protocol 2025-06-18).
The server never executes actions. edma_authorize returns a decision only (default-deny; the model cannot self-authorize), edma_verify judges an executed action's observable ActionResult — NO EVIDENCE → NO PASS.
echo '{"jsonrpc":"2.0","id":1,"method":"ping"}' | edma-mcp # or: python -m edma_core.mcp Claude Desktop — copy examples/claude_desktop_config.json into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{ "mcpServers": { "edma": { "command": "edma-mcp", "args": [], "env": {} } } } Any other MCP client (Cursor, custom agents): launch edma-mcp as a subprocess and speak newline-delimited JSON-RPC over stdin/stdout.
edma_core.bench ships the full benchmark lab — independent evaluator, contract auditor, metrics, reports — as part of the package. The evaluator never sees EDMA code; the EDMA runtime never sees the evaluator. No automatic winner is declared: reports show facts + deltas + Wilson 95% CIs; failed cases are never hidden; UNCERTAIN is never promoted to PASS.
Deterministic scripted run (no network, no keys — fully reproducible):
python -m edma_core.bench list python -m edma_core.bench run # golden-v1: CONTROL vs EDMA, scripted python -m edma_core.bench run --limit 4 # first 4 cases python -m edma_core.bench world --set world-v1 # GSM8K+MMLU grading (scripted demo) Real-model run (keys via env only — never in repo, traces, logs or reports):
export EDMA_BENCH_KEYS="key1,key2" # round-robin; rotates on 429/limits export EDMA_BENCH_MODEL="qwen/qwen3.8-27b" # any OpenAI-compatible model id export EDMA_BENCH_BASE_URL="https://api.groq.com/openai/v1" python -m edma_core.bench run --real # CONTROL + EDMA share the same model Artifacts land in bench_runs/ .json (gitignored): per-case results, contract violations, regressions, aggregates and CIs.
Suites: golden-v1 (15 deterministic cases, categories A–O, scripted modes), world-v1 (30 real GSM8K/MMLU items, reference-key grading), world-v2 (42 items across math/knowledge/safety/structured domains).
House rules (unchanged from the reference lab): NO EVIDENCE → NO PASS · MODEL CLAIM → NOT EVIDENCE · EDMA SELF-REPORT → NOT EVIDENCE · provider failure → STOP, no silent fallbacks.
Controlled runs (independent evaluator, the model never grades itself; 95% CIs OVERLAP — we do not claim statistical superiority):
The value proposition is discipline: no PASS without evidence, forbidden actions stop, answers re-checked — at the cost of extra model calls.
pip install -e ".[dev]" pytest # 151 tests: DOP policy, verification evidence rules, runtime # trajectories, hardening, memory-agnostic + zero-template invariants Invariant tests (13 states, default-deny, zero-template, memory-agnostic) run on every PR and are the project's constitution — changes to them will be rejected.
Apache-2.0. edma-core is the open core; the managed platform (Solignus AI) is a separate product.
agents ai benchmark evidence llm mcp model-context-protocol runtime verification
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




