docker-compose.yml — 30 services

How CausalAgent is actually wired together

One docker compose up boots three things at once: a synthetic storefront that generates OpenTelemetry traffic, the CausalAgent pipeline that turns those traces into a causal graph, and a pair of LLM judges that run alongside a customer's own agent. This is the path a request actually takes, and every service in the stack.

Astronomy Shop — demo traffic source Ingestion — OTel Collector · Variable Extractor CausalAgent core — the product LLM Judges — standalone, customer-deployed
1 2 3 4 5 6 7 TRAFFIC ASTRONOMY SHOP — SYNTHETIC STOREFRONT CAUSALAGENT — INGEST & STORAGE CAUSAL DISCOVERY SURFACE LLM JUDGES Load Generator Locust · :8089 Browser traffic real usage, optional frontend-proxy Envoy · :8081 Astronomy Shop microservices cart · currency · payment · shipping product-catalog · product-reviews recommendation · ad · quote · email image-provider · frontend (11 services) infra: Kafka · Postgres · Valkey · flagd → each instrumented, all export OTel checkout :5050 checkout-agent LLM gate · :8090 ollama gemma3:1b · :11434 otel-collector gRPC :4317 · HTTP :4318 forwards to variable-extractor variable-extractor :8001 schema-driven extraction + PII blocklist ClickHouse :8123 · :9000 Redis :6379 causal-engine :8002 PC · PCMCI+ · FCI · DAGMA-DCE DoWhy · EconML · +4 more api :8000 dashboard React + D3 · :5173 beside the customer's own agent — not part of this demo's trace path hallucination-judge :8091 groundedness-judge :8092
What the numbers trace: a single request's path from synthetic traffic to a rendered causal graph.
  1. 1 Envoy routes into the shop and, in parallel, into checkout.
  2. 2 Every shop service and checkout-agent emit OTel spans.
  3. 3 The Collector forwards everything to the extractor.
  4. 4 Typed variable rows land in ClickHouse and Redis.
  5. 5 The engine reads ClickHouse and discovers a DAG.
  6. 6 The API orchestrates engine + storage + extractor.
  7. 7 The dashboard renders the graph.
The judges are deliberately disconnected — they're a separate product surface a customer runs beside their own agent, scoring (prompt, completion) pairs locally; only the verdict leaves the container, never the text.

Every service, for reference

The diagram above collapses the shop's eleven microservices into one box to keep the mechanism readable. This table doesn't — every container in docker-compose.yml, grouped the same way.

CausalAgent core6

ServicePort(s)Role
variable-extractor:8001Ingest boundary — OTel spans in, typed variable rows out, PII blocklist enforced here.
causal-engine:8002Reads ClickHouse, runs PC / PCMCI+ / FCI / DAGMA-DCE / LiNGAM / BF-BIC / KSG / Transfer Entropy / DoWhy / EconML, produces the DAG.
api:8000Public HTTP surface — orchestrates engine, storage, and extractor; the only thing the dashboard and MCP clients talk to.
dashboard:5173React + TypeScript + D3 UI — Investigate, Lenses, Operate, Simulate workspaces.
clickhouse:8123 · :9000Columnar store for extracted trace variables and causal graphs.
redis:6379Cache and stream buffer between the extractor and downstream consumers.

Astronomy Shop — synthetic storefront18

ServicePort(s)Role
otel-collector:4317 · :4318 · :8889Every shop service's OTel exporter points here; forwards on to variable-extractor.
frontend-proxy:8081Envoy — the storefront's public entry point, routes to every backend service.
frontend—React storefront UI, served behind the proxy (no directly exposed port).
load-generator:8089Locust — auto-starts 20 simulated users against the storefront.
checkout:5050Orchestrates cart, currency, payment, shipping; calls checkout-agent for the LLM decision gate.
checkout-agent:8090LLM-powered checkout decision gate — emits gen_ai.* spans (tokens, latency, hallucination flags).
ollama:11434Local LLM runtime — serves checkout-agent and product-reviews (gemma3:1b by default).
cart—Backed by valkey-cart.
currency:7001Currency conversion.
payment—Injected failures, gated by flagd.
shipping—Calls quote for rate generation.
quote—Shipping-quote generation, used only by shipping.
product-catalog:8088Postgres-backed; gated by flagd.
product-reviews:3551Postgres + Ollama-backed LLM review generation.
recommendation—Reads product-catalog.
ad—Ad service with deliberately injected latency.
image-provider—Serves product images.
email—Order-confirmation email stub.

Shop infrastructure4

ServicePort(s)Role
kafka:9092Async event bus for the shop's own internal messaging.
postgresql—Backs product-catalog and product-reviews.
valkey-cart:6380Redis-compatible store dedicated to the cart service.
flagd—Feature flags — gates injected failure scenarios across the shop.

LLM judges — standalone, customer-deployed2

ServicePort(s)Role
hallucination-judge:8091Scores a (prompt, completion) pair for hallucination. Runs beside the customer's own agent — text never leaves the container.
groundedness-judge:8092Scores whether an answer is derived from its retrieved context or fabricated. Same privacy contract as its sibling.