Case Study · AI Runtime

EtherCode OS

AI backend for commercial support and lead capture

Alejandro Mendoza
April 20268 min

Workers + DO

serverless runtime

D1 + KV

operational persistence

Multi-tenant

per demoId isolation

EtherCode OS

It was not a reply bot. It was a digital employee per business.

EtherCode OS runs on Cloudflare Workers and operates per demoId to provide business-specific context, conversational memory, and commerce execution connected to catalog and checkout.

Real problem#

Commercial teams lose opportunities when every conversation depends on human operators without continuous context, useful memory, or direct catalog/checkout integration.

Solution#

I designed a multi-tenant architecture by demoId combining intent classification, lead memory, dynamic context, and response guardrails to convert conversations into qualified opportunities.

What the app is#

It is an AI backend for commercial assistance and lead capture built on Cloudflare Workers. It acts as a Digital Employee per business demo (demoId), with conversational memory, response rules, and ecommerce/payment support.

Technical base (stack)#

●

Runtime: Cloudflare Workers + Durable Objects + D1 + KV.

●

AI: Cloudflare AI binding (configurable model, default @cf/meta/llama-3-8b-instruct).

●

Integrations: Tienda Nube, Mercado Pago, Supabase.

●

Main code: src/index.js and wrangler.toml.

How it works (technical flow)#

●

Client calls /chat or /v1/demo/chat.

●

Rate limiting is applied per IP (RateLimiterDO) and per session/day (ChatSessionDO).

●

In demo mode, business profile and dynamic context are loaded (agent-context-service.js).

●

Commercial enrichment with Tienda Nube catalog and Mercado Pago checkout (commerce-runtime-service.js).

●

Intent is classified, structured context is built, and LLM is invoked.

●

Response is validated/sanitized (length, forbidden phrases, CTA rules, and no price hallucinations).

●

Messages are persisted in D1 and returned through SSE streaming.

Integrated modules#

●

Conversation engine and API router: src/index.js.

●

Intent classification: intent-classifier.js.

●

Lead operational memory: memory-summary.js.

●

LLM context builder: context-builder.js.

●

Prompt/policy/validation: system-prompt.js, response-policy.js, response-validator.js.

●

External integrations: tiendanube-client.js, mercadopago-client.js, supabase-source.js.

●

Database schema: migrations.

Functional endpoints#

●

Health: /health, /v1/health.

●

General chat: /chat, /v1/chat.

●

Per-business demo chat: /v1/demo/chat.

●

Lead capture: /lead, /v1/lead.

●

Business config: /v1/demo/business, /v1/demo/business/get, /v1/demo/business/list.

●

Runtime/admin config: /v1/admin/agent/source, /v1/admin/agent/integration, /v1/admin/messages, /v1/admin/runtime/ip-rate-limit.

●

Public demo view: /v1/demo/public.

Architecture#

Serverless system with per-business isolation (demoId), state control via Durable Objects, lightweight persistence with D1/KV, and real-time commerce integration that turns conversation into action.

Runtime

Cloudflare Workers + Durable Objects

Data

D1 for conversation, KV for fast state

AI

Cloudflare AI binding with configurable model

Commerce

Tienda Nube + Mercado Pago + Supabase

Strengths

●

Scalable serverless architecture with low operational cost.

●

Per-demoId multi-tenancy with business context isolation.

●

Useful conversational memory for lead qualification.

●

Real commerce integration: catalog + checkout.

●

Response guardrails for commercial quality and risk control.

●

Operational governance through admin endpoints protected by X-Admin-Key.

Result#

EtherCode OS enables deploying a digital employee per business with dedicated context and operational control, reducing commercial friction and accelerating opportunity capture.

CapabilityBeforeWith EtherCode OS
Per-business contextManual and fragmentedAutomatic by demoId
Commercial supportOperator-dependentAgent-assisted with guardrails
Sales integrationDisconnectedCatalog and checkout connected

Project summary#

I built EtherCode OS as a B2B conversational backend on Cloudflare Workers, with per-demoId multi-tenant architecture, conversational memory, and response guardrails. I integrated real-time catalog (Tienda Nube), checkout (Mercado Pago), and external context (Supabase), plus admin endpoints for runtime governance and observability.

If you are hiring to build production AI platforms, I want to contribute to that team.

I focus on robust architecture, technical execution, and measurable outcomes in real systems.

Alejandro Mendoza

Alejandro Mendoza

Software Engineer · Systems Builder · AI Developer

Builds digital systems and products by integrating backend, frontend, data and artificial intelligence. Focused on creating complete, scalable platforms applied to real-world problems.

More about the author →
© 2026 Alejandro Mendoza. All rights reserved.|Privacy