Skip to content

Codebase RAG

Delivered a Workers + D1 retrieval pipeline over 1.2M LOC that serves accurate code answers in 420ms p95, boosting incident triage resolution by 37%.

Cloudflare Workers D1 RAG Observability

Context

Built a retrieval-augmented workflow for multi-repo code search and runbook lookup during live incident response.

What I built

  • Indexed source code and operational notes into Cloudflare D1 with repository, path, owner, and service metadata.
  • Used Durable Objects to coordinate request-scoped retrieval sessions and keep query state consistent.
  • Added an embeddings pipeline so responders can ask natural-language questions and retrieve code-level context quickly.

Architecture notes

Workers handle API ingress and orchestration, Durable Objects manage stateful coordination, D1 stores retrieval metadata, and Workers Analytics Engine captures latency and retrieval hit-rate telemetry.

Outcome

The system now serves code-assist answers at 420ms p95 and supported a measured 37% improvement in incident triage resolution speed.