NeuralRepo is an edge-first application built entirely on the Cloudflare developer platform. Every request is handled at the edge, keeping latency low regardless of where you are in the world.
The API server runs on Cloudflare Workers using the Hono framework. Hono provides Express-like routing with middleware support, optimized for the Workers runtime. Every API endpoint, MCP handler, and OAuth flow runs here — and the Worker is configured to run before static assets so security headers apply to the SPA’s HTML too.
D1 (SQLite)
All structured data — users, ideas, tags, relations, sessions, billing events — lives in Cloudflare D1, a serverless SQLite database at the edge. Includes an FTS5 virtual table for full-text search.
Vectorize
Semantic search and duplicate detection are powered by Cloudflare Vectorize (index neuralrepo-ideas), storing 1024-dimension embeddings alongside metadata. Uses cosine similarity for nearest-neighbor queries.
Queues
Asynchronous processing — embedding generation, duplicate detection, auto-tagging — is handled by Cloudflare Queues, in batches of up to 10 with three retries and a dead-letter queue. Ideas are processed in the background so API responses return immediately.
KV
Cloudflare KV holds short-lived counters and registrations: daily rate-limit counters, the free plan’s monthly semantic-search counter, the stale-nudge cooldown, and dynamically registered MCP OAuth clients. Every key is TTL’d.
R2
Object storage via Cloudflare R2. Today the ATTACHMENTS bucket serves exactly one thing — the demo video on the marketing page. User file attachments are not implemented.
Workers AI
Used for embeddings (@cf/baai/bge-m3), search reranking (@cf/baai/bge-reranker-base), the two keyless agent models (GPT-OSS 120B, Qwen 30B), and the agent’s sub-agents (IBM Granite 4.0 H Micro for utility work, Qwen 30B for creative work) — none of which need a user API key.
AI Gateway
All AI requests — BYOK Anthropic calls and Workers AI calls alike — are routed through Cloudflare AI Gateway, providing logging, caching, and rate limiting.
Durable Objects
The AI agent (NeuralRepoAgent) runs as a Cloudflare Durable Object, giving each user a persistent, stateful WebSocket session. Conversation history is stored in the Durable Object’s SQLite storage.
Worker Loaders
Code mode — both the MCP code_mode tool and the agent’s — executes user-authored JavaScript in a dynamically loaded, isolated Worker via the LOADER binding.
Email Routing
idea@neuralrepo.com is routed to the Worker, which parses the message into an idea and replies. The send_email binding handles the confirmation.
Cron Triggers
Four schedules: the Sunday weekly digest, Monday stale-idea nudges, a daily trial-expiry sweep, and an hourly job that re-queues ideas whose background processing never ran.
The web dashboard is a React 19 SPA built with Vite, with hand-rolled routing and plain CSS — no router library, no CSS framework, and no data-fetching library:
Technology
Purpose
React 19
UI framework
Vite
Build tool and dev server
3d-force-graph + three
3D mind map visualization
d3
2D force-directed mind map
@dnd-kit/*
Drag and drop for the kanban board and the mind map
react-markdown + remark-gfm
Rendering idea bodies and agent replies
rehype-highlight + rehype-sanitize + dompurify
Syntax highlighting and sanitizing rendered Markdown
mermaid
Diagram rendering inside idea bodies and agent output
The SPA is served via Cloudflare Workers static assets and communicates with the Workers API.
Configuration is a plain JSON file at ~/.config/neuralrepo/config.json, written with node:fs —
there is no config library and no OS keychain integration. The CLI is published to npm and
communicates with the same REST API.
NeuralRepo chose the Cloudflare platform for three reasons:
Edge latency. Every API call runs at the nearest Cloudflare edge location. Whether you are in Tokyo or Toronto, response times are consistently low.
Unified billing. All services (compute, storage, vectors, AI, queues) are under one account with predictable pricing. No cross-provider networking costs.
Integrated tooling. D1, Vectorize, Queues, and Workers AI are first-class bindings in the Workers runtime. No SDKs, no connection strings — just direct bindings with TypeScript types.
Three clients — the React web app, the Node.js CLI, and the remote Claude MCP
connector — all reach the same Workers (Hono) API, which binds D1, KV, R2, the agent
Durable Object, and the Queue directly. Background queue jobs call Workers AI and
Vectorize; Workers AI and BYOK Anthropic calls both go through AI Gateway.