Retrieval-augmented generation
Chat answers over a customer's own documents, returned with the matched document names, after a check that the caller may use that persona.
Try it
Ask about the engineering use cases I have published on gusit.de. The demo retrieves with the hybrid method described here, answers only from the passages it finds, and shows the score behind each one. If nothing clears the threshold, it says so instead of answering.
Public demo on Cloudflare Workers AI. Inputs are screened by Llama Guard 3 before any other model runs, requests are rate limited, and nothing here connects to a Luca or customer system.
How it works
- Scope the sourcesI sit with the data owner, list every document source, and record who may read each one. No document is embedded until those access rules are agreed.
- Embed on a local GPULuca splits each uploaded file into overlapping passages of about 1,200 characters, then embeds them. By default it calls an embedding model on a local GPU, so the text stays inside the environment. If the local model is unreachable or the call fails, Luca falls back to a hosted embedding model. I tell the data owner about that fallback before any restricted document is loaded.
- Hybrid retrievalLuca blends semantic similarity with keyword overlap, weighted 85 to 15 by default, then diversifies the results with Maximal Marginal Relevance. By default it keeps at most two passages from one document, so one long document cannot crowd out the rest. Passages under a minimum similarity score are dropped first, and I test that cut-off against the customer's own questions.
- Answer with sourcesLuca adds the retrieved passages to the persona's chat prompt and tells the model to mention the document name when it cites one. The reply comes back with the matched document names and their scores. Luca does not refuse on its own when nothing matches, so I add that rule to the persona prompt and test it.
Tools
| Tool | What it does here | Status |
|---|---|---|
| Luca Express RAG engineAvailable | Uploads and embeds documents into one store per persona, with a query API that checks persona and document access. | Available |
| Luca persona chatAvailable | Adds retrieved passages to a persona's chat prompt and returns the matched document names and scores with the reply. | Available |
| Luca OnEarly access | Embeddable website chat that answers from a knowledge base built from each customer's site and documents. | Early access |
| Cloudflare Workers AIDemo only | Runs this public demo: bge-base embeddings, Llama 3.3 70B for the answer, and Llama Guard 3 to screen each question. | Demo only |
Available means shipped and in use. Early access means built but not generally available. Roadmap means designed, not built. Demo only means it powers the public demo, not customer deployments.
The write-up has every step of how I deliver this at a customer, with the tools and their status.
Read the write-up on gusit.deThe other answers
Built by Gus Assuncao of Gus IT LLC for a Forward Deployed Engineer application. Luca is the AI platform Gus IT builds and operates. Contact gus@gusit.de. Claude is a product of Anthropic PBC. Cloudflare and Workers AI are trademarks of Cloudflare, Inc. Llama is a trademark of Meta Platforms, Inc. Other names are trademarks of their respective owners. Gus IT LLC is an independent engineering firm and is not affiliated with or endorsed by these companies.