AI Assistants
Conversational, support, research, coding and internal assistants share one shape and differ on four axes — knowledge, tools, risk and latency — which decide the architecture.
One shape, four axes
An assistant is a conversation loop wrapped around some combination of knowledge (RAG), actions (tools) and rules (system prompt plus guardrails). What separates a harmless FAQ bot from a coding agent that runs shell commands is not the model; it is where the product sits on four axes.
Fix the axes first and the architecture mostly follows. A read-only, low-latency assistant over a stable corpus is RAG plus one model call. A high-risk, tool-rich assistant on a slow task is an agent loop with approval gates and a trace for every run.
- Knowledge: what must it know beyond the model? None, a curated corpus, live systems, or the user's private data.
- Tools: read-only lookups, reversible writes, or irreversible actions (payments, deletes, sending mail).
- Risk: cost of a wrong answer — mild annoyance, refund, legal exposure, or a deleted production table.
- Latency: chat expects a first token under ~1 s and an answer in a few seconds; a research job may take minutes.
Conversational and customer-support assistants
A general conversational assistant has broad knowledge, few or no tools, low risk per answer and strict latency. Architecture: system prompt, conversation history with a rolling summary, optional web search tool, output guardrails. The hard part is consistency at scale — the same question asked 10,000 ways should get the same policy-compliant answer — and knowing when to say "I don't know".
A customer-support assistant narrows knowledge to a product corpus and adds tools that touch real accounts. Knowledge: RAG over help articles and policies with metadata filters per product and plan. Tools: get_order, get_subscription (read), issue_refund, cancel_plan (write, gated). Risk is moderate to high because the bot speaks for the company. Latency: a few seconds is fine; users are used to waiting for support.
- Support hard parts: grounding answers in the current policy version, refusing to promise what policy forbids, and escalating to a human without losing the conversation — see In-the-Loop vs On-the-Loop and Escalation.
- A deterministic router in front (billing / technical / account) usually beats one giant prompt — see Router Architecture.
- Measure with a golden set of real tickets and a judge for policy compliance — see Golden Datasets.
Research and coding assistants
A research assistant gathers and synthesizes: search, fetch, read, compare, cite. Knowledge is live and untrusted (the open web); tools are read-only; risk is mostly fabrication; latency is relaxed, minutes are acceptable. This is a genuine agent: the number of searches depends on what the first ones return. Hard parts: deciding when enough evidence has been collected, deduplicating sources, and citations that really support the claim — see Citations and Citations in the challenges.
A coding assistant operates on a repository with tools like read_file, search, edit_file, run_tests, run_command. Knowledge is the codebase (often retrieved on demand rather than pre-indexed). Risk ranges from trivial (suggesting a diff) to severe (running rm -rf in a real environment). Latency tolerance is high for autonomous tasks, low for inline completion. Hard parts: sandboxing, keeping the context window from filling with file contents, and verifying work with tests rather than trusting the model's claim of success.
- Research: cap searches per run (e.g. 8) and require each claim in the answer to map to a fetched source id.
- Coding: run tools in an isolated sandbox with an allowlist; treat test output as the termination signal, not model confidence.
- Both: untrusted content (web pages, README files) is a prompt-injection surface — see Indirect Prompt Injection.
Internal company assistants
The "ask anything about our company" assistant combines RAG over wikis, tickets and docs with tools into HR, CRM and engineering systems. It looks like the support bot but the knowledge axis is dominated by permissions: an engineer must not retrieve the CEO's compensation memo because it embedded well. Every retrieval must be filtered by the caller's identity before ranking, not after — see Metadata Filtering and Permissions, Authentication and Authorisation.
Latency expectations are chat-like, corpora are messy (Confluence exports, PDFs, slide decks), and freshness matters: yesterday's org chart is wrong. Hard parts: ingestion quality, access control, and stale content that ranks well. A modest scope with clean data beats company-wide coverage with 40% stale hits.
- Enforce document ACLs as a retrieval pre-filter using the user's token, never as a post-generation guardrail.
- Show the source and its last-updated date on every answer so users can judge freshness.
- Start with one department's corpus and a golden set of 100 real questions before widening.
Key points
- All assistants share one loop; knowledge, tools, risk and latency decide how much machinery wraps it.
- Read-only, low-risk assistants are RAG plus a model call; tool-rich, high-risk ones are agents with approval gates.
- Support assistants live or die on grounding in current policy and clean escalation to humans.
- Research and coding assistants are true agents; termination must come from evidence or tests, not model confidence.
- Internal assistants are an access-control problem first and a retrieval problem second.
- Every assistant needs a golden set of real conversations and a trace per session before launch.
When to use — and when not to
- Users have open-ended questions over a knowledge base that changes too often for a static FAQ.
- Tasks are conversational and benefit from clarification turns.
- A human currently answers the same questions repeatedly and their answers can be documented.
- The interaction is a form — structured fields, fixed validation — build the form.
- Answers must be exactly right every time with no human fallback (medical dosing, legal filings).
- The corpus is not maintained; the assistant will confidently serve stale content.
- Latency budget is under ~300 ms end to end.
Failure modes
- Confident answers from model weights when the corpus did not contain the fact.
- Retrieval ignoring document permissions and leaking restricted content across users.
- A write tool exposed without approval, so a misread "cancel my newsletter" cancels the subscription.
- Conversation history growing until the system prompt is effectively forgotten.
- Coding agents declaring success on untested edits.
- No escalation path, so frustrated users loop with the bot instead of reaching a human.
Tradeoffs
Ranges widely: a RAG-only FAQ assistant is 2/2/2/4/4; a tool-rich coding agent is 4/4/4/3/2.