Skip to content

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.

D1 (SQLite)

All structured data — users, ideas, tags, relations, sessions — lives in Cloudflare D1, a serverless SQLite database at the edge. Includes FTS5 virtual tables for full-text search.

Vectorize

Semantic search and duplicate detection are powered by Cloudflare Vectorize, a vector database that stores embeddings alongside metadata. Uses cosine similarity for nearest-neighbor queries.

R2

Object storage via Cloudflare R2, an S3-compatible store with zero egress fees. Reserved for future use.

Queues

Asynchronous processing — embedding generation, duplicate detection, auto-tagging — is handled by Cloudflare Queues. Ideas are processed in the background so API responses return immediately.

KV

Cloudflare KV handles rate limiting counters, feature flags, and cached configuration. Its global replication ensures consistent rate limiting across edge locations.

Workers AI

NeuralRepo uses Workers AI for embedding generation (@cf/baai/bge-m3) and for running AI agent sub-agent models (Qwen 30B, Llama 70B, Granite Micro, and others) without requiring a user API key.

AI Gateway

All AI requests — BYOK Anthropic calls and Workers AI agent calls — are routed through Cloudflare AI Gateway, providing logging, caching, rate limiting, and fallback handling.

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

The web dashboard is a React SPA built with Vite:

TechnologyPurpose
React 19UI framework
ViteBuild tool and dev server
TanStack RouterFile-based routing
TanStack QueryData fetching and caching
Tailwind CSSStyling
RechartsAnalytics charts
Three.js + 3d-force-graph3D mind map visualization
D3.js2D force-directed mind map
Vercel AI SDK (ai)Streaming AI responses, tool call handling
Agents SDK (agents/ai-chat-agent)WebSocket-based agent session management
workers-ai-providerWorkers AI model integration via Vercel AI SDK

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
ConfLocal configuration storage

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 all request/response types
  • TypeScript types generated from the Zod schemas
  • Constants for statuses, relation types, and limits
  • Validation helpers used by both client and server

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 (300+ cities). 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.

┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Web App │ │ CLI │ │ Claude MCP │
│ (React) │ │ (Node.js) │ │ (Remote) │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
└────────────────┼────────────────┘
┌─────▼─────┐
│ Workers │
│ (Hono) │
└─────┬─────┘
┌────────────┼────────────────┐
┌─────▼─────┐ ┌────▼────┐ ┌───────▼───────┐
│ D1 │ │ R2 │ │ Queues │
│ (SQLite) │ │ (Files) │ │ (Background) │
└───────────┘ └─────────┘ └───────┬───────┘
┌────▼─────┐
┌────▼──┐ ┌────▼──────┐
│Workers│ │ Vectorize │
│ AI │ │ (Vectors) │
└───────┘ └───────────┘