Design a Cited Internal Chatbot over a Wiki and a News API
Improve an internal chatbot that answers employees from the company wiki and a news API, labeling and citing every claim or saying "I don't know", then design how to evaluate its answers and a post-training recipe that closes its known gaps.
Problem statement
Design an internal chatbot for a company's employees. They ask about the company wiki, the latest news, or both, and every claim in an answer must be labeled and cited, or the chatbot says "I don't know." A first version already runs.
Design three things: the overall workflow that makes the answers more accurate, how you evaluate the answers, and a post-training recipe (how you further train an existing model for this job) that closes the current system's known gaps.
The wiki retriever already exists and returns chunks (short passages of wiki pages); do not redesign it. News is a single API call, not a search system you build: search(keywords, start_time) returns articles, each with an id, headline, time, publisher, url and body.
Call it only when a question needs news, and do not crawl the web.
The answer contract: - Label each claim INTERNAL, NEWS or Both. - A wiki claim cites a page_id from the chunks returned for this turn. - A news claim cites an article id returned by the news API for this turn, and the reply shows an "as of" time.
- If the needed evidence is not in this turn's chunks or news results, the reply says "I don't know."
Today the chatbot is a frontier model (a leading commercial model used through a chat API) with one large system prompt (fixed instructions sent to the model with every question), plus the retriever and the news API.
Its known gaps are hallucination (stating things the evidence does not support), source choice, format, inaccurate citations and cost.
You can use the frontier model's chat API, with no access to its weights; open-weight models (models whose weights you can run and change); and the company's fine-tuning service (it further trains a model on your own examples) for open-weight models.
Out of scope: the retriever itself and searching the web beyond the news API. For this exercise, also assume the chat screen is out of scope.
What to build
- An employee asks a question, often as a follow-up in a conversation, and gets an answer in which every claim carries a label (INTERNAL, NEWS or Both) and citations from this turn's results; news claims come with an "as of" time.
- The chatbot uses the wiki, the news API or both, as each question needs, and calls the news API only when the question needs news.
- When the needed evidence is not in this turn's results, the answer says "I don't know" instead of guessing; for this exercise, assume it says so only for the parts without evidence and still answers the parts it can support.
- The team can measure answer quality against the contract and each known gap, and switches to a post-trained model only when it measures better than the current system.
At scale
- One company of 1,000 employees asks about 15,000 questions a week, with up to 20 answers being generated at the same time at peak. Conversations average 5 turns, and everything is in English.
- For this exercise, assume the retriever takes a query and a count and returns up to 20 chunks, each with a page_id, page title, text and last-edited time; the news API returns up to 20 articles, newest first, in about 1 second.
- For this exercise, assume an answer should be complete within about 10 seconds, today's system prompt is about 8,000 tokens (pieces of words the model reads) and is sent on every turn, and the frontier model costs about 10 times as much per token as a fine-tuned open-weight model of the size you would use.
- For this exercise, assume you have 6 months of logged turns (about 400,000), each with its chunks, news results and answer; about 5% have a thumbs up or down, experts can review about 1,000 answers a month, and the logs and the frontier model's outputs may be used to train an internal model.