Skip to content
Series
10 posts

Ask AI in Practice

Follow the real quidproquo Ask AI data path from indexing, hybrid retrieval, writing, and source gates through streaming, caching, incident analysis, and reproducible evaluation. Each post traces one responsibility and the boundary of what its evidence can prove.

ai guide Ask AI in Practice

How a Question Moves Through Ask AI: UI, API, Agents, and Source Cards

Ask AI splits one question across the UI, `/api/chat`, Planner, Research, Writer, Validation, Critic, and Related stages. Answer text, displayed sources, and related-reading cards come from separate paths with separate gates.

ai guide Ask AI in Practice

How Ask AI Indexes Posts: Chunks, D1 FTS5, and Vectorize

Ask AI indexing runs in two production stages: source-hash changes update D1, post chunks, and FTS5 first; embedding checkpoints and a delete queue then let Vectorize catch up asynchronously. The two stores do not share one transaction.

ai guide Ask AI in Practice

How Ask AI Finds Posts: Planner, Hybrid Retrieval, and Retry

Ask AI first extracts intent, complexity, and 1–4 search terms. It then routes across metadata, BM25, Vectorize, and RRF; a retry adds Critic gaps and disables the first-pass-only BM25 short circuit.

ai guide Ask AI in Practice

How Ask AI Turns Evidence into an Answer: Writer Context and Citation Contracts

Writer sees the first 8 candidates for a factual query or 12 for a recommendation by default. Citations must use an exact `source_url` from that set, and weak or empty retrieval triggers an instruction to abstain rather than fill gaps from model knowledge.

ai guide Ask AI in Practice

When Ask AI May Show Sources: Validation, Critic Review, Degradation, and the Source Gate

Ask AI finding a post does not mean the UI should display it as a source. An answer must pass deterministic Markdown and URL validation, then the Critic's relevance, intent, and grounding checks; if either gate fails, source cards are withheld.

ai guide Ask AI in Practice

Debugging Ask AI in Production: SSE, Traces, Cache, Checkpoints, and Shadow Runs

One Ask AI request leaves five different evidence surfaces: public SSE, Langfuse traces, D1 logs, semantic cache, and a hidden shadow run. They expose different data, and no single surface reconstructs the complete retrieval context.

When Search Returns Only 10 Results: Fixing CJK Recall in Cloudflare D1 FTS5 Hybrid Search

Querying “認證” returned only ~10 hits while 149 files (509 occurrences) matched; 41 posts and 76 chunks were found via LIKE, but D1 chunks_fts had 0 rows and unicode61/trigram both returned 0 for 2-char CJK terms. Fix: LIKE fallback with char-level OR first, then trigram migration + pnpm sync, then pagination beyond the hard limit of 12.

Why Did 'I Want a Beginner AI Course' Return Zero Results? Debugging Chinese Tokenization and a Broken RAG Data Path

Entering '我想找入門的ai課程' in Ask AI showed zero searched posts and triggered a refusal, while Related Reading recommended exactly the right article. The first fix addressed Chinese tokenization, the LIKE fallback, and the Vectorize data path. A second pass added short Han-and-number tokens, post metadata retrieval, and a rule that exposes sources only after both Validation and Critic pass.

ai debug Ask AI in Practice

Why Ask AI Could Not List Its Course Maps: A Catalog Retrieval and Convergence Incident

The first observation of 'What course articles do you have?' was contaminated by an old cache entry. A real cache miss retrieved all four university maps but spent 51.169 seconds across three Writer and Critic passes; after catalog-specific retrieval and review fixes, one uncached production observation passed q21 in 26.821 seconds.

ai guide Ask AI in Practice

Evaluating Ask AI Retrieval: Golden Contracts, Fixtures, Live Runs, and Evidence Boundaries

Ask AI keeps golden contracts, offline fixtures, live SSE output, and production observations separate. A passing fixture proves harness reproducibility; public sources can measure expected-source recall, but they do not expose hidden ranked chunks or establish model-graded faithfulness.