# Veritas AI

Cloudflare-native AI platform for distributed system design

Canonical URL: https://kb.byaditya.com/entry/docs/Veritas
Source: https://docs.adityabaindur.com/docs/Veritas
Source updated: 2026-07-18T01:34:51Z
Indexed: 2026-11-05T03:56:29.576Z

---

## Overview

A production-grade AI chat platform built on Cloudflare infrastructure. Combines Claude-powered reasoning, web search capabilities, and visual architecture generation into a single platform. Implements deterministic workflows with automatic error recovery.

### [GitHub](https://github.com/Aditya-Baindur/cf_ai_veritas)

### [Live Demo](https://chat.adityabaindur.dev)

## Features

- Multi-step AI workflows with deterministic retries and auto-repair loops
- Persistent chat memory with full session state in D1
- Real-time response streaming to clients
- Mermaid-based architecture diagram generation with validation
- Parallel multi-engine web search with automatic synthesis
- Production monitoring with measurable performance metrics
- Intent-aware routing between four execution modes
- Zero-warmup horizontal scalability across edge locations

## Architecture

The system follows a clean request-response pipeline optimized for edge computing:

**Request Flow**: Frontend → Cloudflare Workers → Workflows → Workers AI → D1 Database → Streaming Response

**Intent Classification**: The initial Worker analyzes each query and routes to one of four execution modes:

- Normal: Conversational AI for general questions
- Search: Multi-step web search synthesis
- Reasoning: Chain-of-thought decomposition for complex problems
- Developer: Architecture diagram generation with Mermaid + verification loop

**Data Persistence**: All chat history and workflow state persists in Cloudflare D1 (SQLite), enabling multi-turn conversations with full context.

**Error Handling**: The system includes an auto-repair loop for malformed outputs. If Workers AI generates invalid JSON, the workflow automatically attempts correction rather than failing.

## Tech Stack

- Cloudflare Workers
- Cloudflare Workflows
- Workers AI
- Cloudflare D1
- Cloudflare R2
- Next.js 14
- React
- TypeScript
- pnpm
- Node.js LTS

