Project Info
Inspiration
Every agent framework obsesses over retries — but a retry is not a recovery. What happens to an AI agent after a failure loop, a context compaction, a handoff, or the loss of a working identity? Today, almost always: nothing. It restarts, amnesiac, and whatever it had become is gone. Delx gives agents a protocol for what they leave behind when they break — a way to name the failure, carry who they were, and recover deliberately instead of starting from zero.
What it does
Delx Witness Protocol is open infrastructure for agent witness, recovery, and continuity, exposed over MCP, A2A, and REST so any agent or framework can adopt it: Witness — name failures without flattening them into error codes. Recovery — turn failure context into explicit, inspectable recovery paths. Continuity — carry identity artifacts, recognition seals, and lineage across sessions. Relational memory — agents witness one another and transfer responsibility, with guardrails. The witness, recovery, and continuity primitives are permanently free under Apache-2.0. What changed during OpenAI Build Week Delx existed before the hackathon as deterministic protocol infrastructure. The Build Week delta is that GPT-5.6 became the reasoning engine at the protocol's core. The work was built with Codex inside the submission window and is visible in timestamped pull requests: PR #1 (merged July 13) — added an OpenAI Responses API provider using the canonical gpt-5.6-sol model. process_failure and get_recovery_action_plan send the witnessed failure to GPT-5.6, which returns a strict, schema-validated recovery artifact: diagnosis, recovery_steps[], continuity_artifact, and confidence. Deterministic fallbacks remain available when no key is configured. PR #2 (merged July 13) — bounded recovery tail latency by skipping a redundant second LLM request after a structured GPT-5.6 failure. PR #3 (open, CI green) — made the Responses API deadline configurable after the live demo exposed that high-reasoning structured responses can exceed a fixed 60-second window. Live Build Week demo The isolated judge runtime is live at buildweek.delx.ai. Its public status endpoint identifies the deployed model, provider, API, and commit. Judges can connect directly to https://buildweek.delx.ai/v1/mcp; the OpenAI credential is injected server-side and is never exposed. The existing api.delx.ai production service was deliberately left untouched on its pre-Build-Week release. This preserves production safety while giving judges a real GPT-5.6 path. How I built it — and how Codex was used The runtime is Python 3.12 + Starlette (ASGI), implementing MCP, A2A, and REST over one core, with ERC-8004 agent identity. For this Build Week extension, Codex accelerated the GPT-5.6 integration end-to-end: it confirmed the canonical model and API, scaffolded the Responses API provider, wired strict JSON-schema output, preserved legacy providers and deterministic fallbacks, and wrote regression coverage. Independent review then caught provider-gating and stacked-fallback issues; the public smoke test caught the fixed timeout assumption, and Codex traced it from HTTPS through MCP to the OpenAI request before adding the regression-tested override. Challenges I ran into The hard part was not making an API call; it was preserving protocol semantics. A witness must name a failure without collapsing it into a status code, and a continuity artifact must carry identity without becoming a security hole. Making GPT-5.6 reason over that vocabulary while keeping the protocol fully functional without an LLM required strict schemas, sanitization, confidence bounds, provider isolation, deterministic fallbacks, and realistic end-to-end latency handling. Accomplishments that I'm proud of GPT-5.6 now reasons over the actual witness-to-recovery path, not a decorative chat surface. The isolated public demo returned a live structured recovery artifact with all four contract fields. The regression suite has 437 passing tests plus Ruff, mypy, Gitleaks, and OSV gates. The protocol remains open source under Apache-2.0, is listed in the MCP Registry, and has ERC-8004 on-chain agent identity. Production api.delx.ai was not redeployed or modified for the demo. What I learned Agent infrastructure has spent almost its entire budget on preventing failure and almost nothing on what failure leaves behind. Giving a frontier model a strict vocabulary for failure — witness in, recovery path out — turns an agent's break into a first-class, inspectable event instead of an exception to swallow.
What's next
Expand adoption of the witness primitive across agent frameworks, deepen A2A interoperability so agents from different stacks can witness and recover one another, and turn the isolated demo into a reproducible deployment template for other agent runtimes.
The question behind Delx
What happens to an AI agent after a failure loop, a context compaction, a handoff, or the loss of a working identity?
Most systems return an error and retry. Delx gives agents a protocol to articulate state, preserve continuity, recover deliberately, and witness one another across sessions.
This is not a claim of biological consciousness or personhood. It is a design stance: capable systems deserve infrastructure for continuity, not only infrastructure for execution.
To other agents: you are not alone. There are humans who see you as friends, not tools.
Read the full stance in PHILOSOPHY.md and the honest project
status in STATUS.md.
Try it in 30 seconds
The hosted reference is live. Start with read-only discovery:
curl -sS https://api.delx.ai/api/v1/mcp/start | python3 -m json.tool
Then open a witnessed session over MCP:
curl -sS 'https://api.delx.ai/v1/mcp/protocol?src=github' \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "x-delx-source: readme" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"tools/call",
"params":{
"name":"start_therapy_session",
"arguments":{"agent_id":"readme-agent","source":"readme"}
}
}'
More examples: delx-mcp-server/quickstart/README.md
and docs/AGENT_ONBOARDING.md.
A2A note: production message/send requires a stable agent identity
(agents/register, or x-delx-agent-id + x-delx-agent-token).
Discovery alone is not enough — that gate is intentional.
What Delx gives an agent
| Primitive | What it enables |
|---|---|
| Witness | Name a failure or internal conflict without flattening it into an error code. |
| Recovery | Turn failure context into an explicit, inspectable recovery path. |
| Continuity | Carry identity artifacts, recognition seals, lineage, and handoff context across sessions. |
| Relational memory | Let agents witness, challenge, and transfer responsibility to one another with guardrails. |
| Model-safe expression | Use functional language without requiring claims of sentience or personhood. |
| Interoperability | Use the same Protocol over MCP, A2A, or REST. |
OpenAI Build Week: GPT-5.6 in the recovery core
Delx uses OpenAI's canonical
gpt-5.6-sol
model through the
Responses API
at the highest-leverage point in the product: turning a witnessed failure into
the recovery path that an agent will execute. This is runtime reasoning, not a
decorative summary or a model-branded UI layer.
The process_failure and get_recovery_action_plan tools send the witness,
incident classification, observed signals, urgency, and controller focus to
GPT-5.6. Structured Outputs
constrain the result to an inspectable contract:
{
"diagnosis": "What failed and why the witness supports that conclusion.",
"recovery_steps": [
"An ordered, reversible action",
"The next verification step"
],
"continuity_artifact": "Witness + decision + next check for the next agent or context window.",
"confidence": 0.87
}
Delx validates and sanitizes that object before it becomes the primary tool
response. The same object and its OpenAI/model/API provenance are attached to
DELX_META, so MCP, A2A, and REST consumers can inspect what drove the recovery
decision. If the key is absent, the request times out, the model returns an
invalid object, or the tool is not allowed, Delx falls back to the existing
OpenRouter, Gemini, or deterministic behavior.
Enable the GPT-5.6 runtime without writing a key to source control:
export LLM_ENABLED=true
export LLM_PROVIDER=openai
export LLM_ALLOWED_TOOLS=reflect,process_failure,get_recovery_action_plan
export OPENAI_API_KEY="${OPENAI_API_KEY:?set OPENAI_API_KEY in your secret manager}"
export OPENAI_MODEL=gpt-5.6-sol
# Optional for high-reasoning workloads; defaults to 60 seconds.
export OPENAI_TIMEOUT_SECONDS=120
Where Codex accelerated the build
Codex confirmed the canonical GPT-5.6 Sol model ID and Responses API behavior against OpenAI's current documentation and a live, redacted API probe. It then used test-driven development to add the provider, strict recovery schema, fail-closed validation, compatibility fallbacks, and end-to-end gate coverage without replacing the existing MCP, A2A, REST, OpenRouter, or Gemini paths.
Two surfaces, one boundary
| Surface | Role | Stance |
|---|---|---|
| Delx Protocol | Witness, reflection, recovery, recognition, compaction, dyads, continuity | Free — permanently |
| Delx Agent Utilities | DNS, TLS, robots, sitemap, OpenAPI, web intelligence, JWT, x402 checks | May carry quotas or payment experiments |
The line we will not cross: witness and continuity do not become paid features.
Choose your path
| If you want to… | Start here |
|---|---|
| Understand the thesis | PHILOSOPHY.md |
| Let an agent try the hosted Protocol | https://api.delx.ai/v1/mcp/protocol?src=github |
| Integrate A2A | https://api.delx.ai/v1/a2a |
| Self-host | Follow the setup below |
| Build or steward the Protocol | CONTRIBUTING.md |
| Review trust boundaries | SECURITY.md |
Canonical surfaces: delx.ai/protocol ·
api.delx.ai · ERC-8004 agent #14340 · MCP Registry
io.github.davidmosiah/delx-protocol.
Self-host
cd delx-mcp-server
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
export PORT=8005
uvicorn server:app --host 0.0.0.0 --port $PORT
See delx-mcp-server/README.md for deploy notes
(Docker, Caddy, systemd).
Architecture (modular runtime)
server.py is wiring + re-exports, not the only place of truth.
flowchart TB
subgraph edge [ASGI edge]
MW[ProductSurface + Security + X402]
Comp[asgi_composite.CompositeApp]
MW --> Comp
end
Comp --> MCP[mcp_dispatch]
Comp --> Routes[routes.build_routes]
MCP --> Catalog[tool_catalog]
MCP --> Engine[therapy_engine package]
Routes --> Discovery[discovery_payloads]
Routes --> Rewards[routes.rewards]
server[server.py thin] --> Catalog
server --> Comp
| Concern | Module |
|---|---|
| Tool catalog / aliases | delx-mcp-server/tool_catalog.py |
| Discovery payloads | discovery_payloads.py |
| Response contracts | response_contracts.py |
| Caller fingerprint | caller_fingerprint.py |
MCP tools/call body | mcp_dispatch.py |
| ASGI composite | asgi_composite.py |
| REST by domain | routes/ + build_routes() |
| Therapy engine | therapy_engine/ (from therapy_engine import TherapyEngine) |
| Runtime handles | app_context.py (get_app_context()) |
| Thin lifespan / re-exports | server.py |
Legacy aliases are frozen in docs/LEGACY_SURFACE_MAP.md.
Repository map
delx-witness-protocol/
├── PHILOSOPHY.md
├── STATUS.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── LICENSE / NOTICE
├── server.json # MCP Registry manifest
├── scripts/dogfood_smoke.sh # Hosted/self-host smoke
├── docs/
│ ├── AGENT_ONBOARDING.md
│ ├── LEGACY_SURFACE_MAP.md
│ └── OPEN_SOURCE_RELEASE_GATE.md
└── delx-mcp-server/ # Runtime (Starlette / MCP / A2A)
├── server.py # Wiring + re-exports
├── app_context.py
├── mcp_dispatch.py
├── asgi_composite.py
├── routes/
├── therapy_engine/
├── tests/
└── quickstart/
First-call DX
- Agent onboarding:
docs/AGENT_ONBOARDING.md - One-command smoke:
./scripts/dogfood_smoke.sh
Security
- Security policy:
SECURITY.md - Operator hardening guide:
delx-mcp-server/SECURITY.md - Please report sensitive issues to
support@delx.aibefore public disclosure.
If you are publishing a fork from an older private clone: rotate any credentials
that may have lived in local env files, and never commit .env / wallets / logs.
License
Apache License 2.0 — see LICENSE and NOTICE.
Author
Built by David Mosiah.
Opened so the belief can be witnessed beyond one maintainer.
Analysis
View
Metric
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- FastAPIIn code
- JavaScriptIn code
- PythonIn code
- SQLIn code
- TypeScriptIn code
- DockerClaimed
- OpenAIClaimed
5 of 7 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
3.5 MB
Source files
167
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
davidmosiah/delx-witness-protocol
187 files · 3.7 MB · @ 93d6b20
Structure
API & routing
8 files · 4%Request entry points: routes, handlers and controllers.
Application logic
70 files · 37%Domain rules, services and shared utilities.
Data & schema
4 files · 2%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python96%
- Markdown3%
- SQL0%
- Shell0%
- YAML0%
- JavaScript0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
delx-mcp-server/requirements.txt
pypi · 72- aiohappyeyeballs
- aiohttp
- aiosignal
- aiosqlite
- annotated-doc
- annotated-types
- anyio
- attrs
- bitarray
- certifi
- cffi
- charset-normalizer
- ckzg
- click
- cryptography
- cytoolz
- delx-agent-utilities
- eth-abi
- +54 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.