Skip to content
NeuralRepo
Get Support

Tech Stack

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.

Workers + Hono

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 Worker itself has a deliberately short dependency list:

PackagePurpose
honoHTTP routing and middleware
arcticGitHub, Google, and Apple OAuth flows
zodRequest validation, shared with the CLI and frontend
ai + @ai-sdk/anthropic + workers-ai-providerAgent model calls across Anthropic and Workers AI
agentsThe AIChatAgent base class behind the Durable Object
@cloudflare/codemodeSandboxed code-mode execution
stripeBilling and webhook signature verification
fflateZipping multi-file exports

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:

TechnologyPurpose
React 19UI framework
ViteBuild tool and dev server
3d-force-graph + three3D mind map visualization
d32D force-directed mind map
@dnd-kit/*Drag and drop for the kanban board and the mind map
react-markdown + remark-gfmRendering idea bodies and agent replies
rehype-highlight + rehype-sanitize + dompurifySyntax highlighting and sanitizing rendered Markdown
mermaidDiagram rendering inside idea bodies and agent output

The SPA is served via Cloudflare Workers static assets and communicates with the Workers API.

The @neuralconfig/nrepo CLI is built with:

TechnologyPurpose
Commander.jsCommand parsing and help generation
ChalkTerminal styling
OraSpinner animations
ZodResponse validation

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.

The @neuralrepo/shared package contains code shared between the API, frontend, and CLI:

  • Zod schemas for request and settings validation
  • TypeScript types inferred from those schemas
  • Constants — the status, source, link-type, and relation-type enums
  • LIMITS, the single source of truth for field limits enforced across API, MCP, and CLI

This ensures type safety and validation consistency across all three surfaces.

NeuralRepo chose the Cloudflare platform for three reasons:

  1. Edge latency. Every API call runs at the nearest Cloudflare edge location. Whether you are in Tokyo or Toronto, response times are consistently low.

  2. Unified billing. All services (compute, storage, vectors, AI, queues) are under one account with predictable pricing. No cross-provider networking costs.

  3. 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.

Web App(React)Workers(Hono)CLI(Node.js)Claude MCP(Remote)D1SQLiteKVCountersR2Demo assetDurable ObjectNeuralRepoAgentQueues(Background)AI GatewayWorkers AIVectorize