PROJECT / botardo
Botardo — RAG-powered AI assistant
A RAG conversational agent embedded in the site: vector retrieval over Cloudflare Vectorize with bge-m3 embeddings, generation with DeepSeek V4 Flash via OpenCode Go, and deterministic language detection with a no-LLM fallback for out-of-context questions.
Problem
My personal site was static and answered every visitor the same way. I wanted my profile to be naturally queryable, with an assistant that answers with facts from a curated knowledge base — without hallucinating or inventing data.
What I did
I built Botardo on Cloudflare Workers: the visitor's message is embedded with bge-m3 (Workers AI), the most similar chunks are retrieved from Vectorize (similarity threshold plus a 4-chunk cap), and the reply is generated with DeepSeek V4 Flash through OpenCode Go. Language (es/en) is detected deterministically, and when no context is retrieved the bot replies with an automatic fallback without calling the model. The knowledge base is fed by my linkedin-markdownificator exporter. Includes retry with backoff, CORS restricted to the site's origins, and 33 Vitest tests.
Highlights
- Full RAG on Cloudflare: Workers + Vectorize + bge-m3 embeddings (Workers AI).
- Generation with DeepSeek V4 Flash via OpenCode Go.
- Deterministic language detection (es/en) and a no-LLM fallback when no context is retrieved: zero cost for off-topic questions.
- Retry with backoff, restricted CORS, and 33 Vitest tests.
- Curated knowledge base synced from linkedin-markdownificator.
Stack
- Astro
- TypeScript
- Cloudflare Workers
- Cloudflare Vectorize
- Workers AI
- OpenCode Go
- DeepSeek V4 Flash
- Vitest
Links